You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue while using the serial addMemoryForWrite() function, which I believe I've tracked down to an bug in the teensy3 serialX.c.
In teensy3/serialX.c, the buffer head and tails (tx_buffer_head, etc.) are declared as different types depending on what SERIALX_TX_BUFFER_SIZE is set to. However, this does not take into account memory added using addMemoryForWrite() at runtime. With the default SERIAL_TX_BUFFER_SIZE the head/tail will beuint8_t, so if I pass in say an extra 256 bytes of buffer memory then they will be unable to point to data in the upper part of that extra buffer.
Looking at the serial output with a logic analyzer, this will show up as unexpected serial write behavior (e.g. extra bytes being sent periodically). Below is a script that will intermittently show such behavior (tested on a Teensy 3.2):
I ran into an issue while using the serial
addMemoryForWrite()
function, which I believe I've tracked down to an bug in the teensy3serialX.c
.In
teensy3/serialX.c
, the buffer head and tails (tx_buffer_head
, etc.) are declared as different types depending on whatSERIALX_TX_BUFFER_SIZE
is set to. However, this does not take into account memory added usingaddMemoryForWrite()
at runtime. With the defaultSERIAL_TX_BUFFER_SIZE
the head/tail will beuint8_t
, so if I pass in say an extra 256 bytes of buffer memory then they will be unable to point to data in the upper part of that extra buffer.Looking at the serial output with a logic analyzer, this will show up as unexpected serial write behavior (e.g. extra bytes being sent periodically). Below is a script that will intermittently show such behavior (tested on a Teensy 3.2):
The text was updated successfully, but these errors were encountered: