Re: [TODO] Serial port losing data when several threads are
Posted: Thu Nov 21, 2013 3:01 pm
Hi,
It is possible it is related to the internal USART state machine, it is possible it requires a full frame after a reconfiguration.
About the previous problem, I found several workaround but still have to understand the real cause, for example:
Removing optimizations from JUST the ISR eliminates the problem:
Removing this (apparently unrelated) snippet from the ISR also eliminates the problem:
I am narrowing it but it is very elusive.
Giovanni
It is possible it is related to the internal USART state machine, it is possible it requires a full frame after a reconfiguration.
About the previous problem, I found several workaround but still have to understand the real cause, for example:
Removing optimizations from JUST the ISR eliminates the problem:
Code: Select all
__attribute((optimize("O0")))
static void serve_interrupt(SerialDriver *sdp) {
Removing this (apparently unrelated) snippet from the ISR also eliminates the problem:
Code: Select all
#if 0
if (sr & USART_SR_LBD) {
chSysLockFromIsr();
chnAddFlagsI(sdp, SD_BREAK_DETECTED);
chSysUnlockFromIsr();
u->SR &= ~USART_SR_LBD;
}
#endif
I am narrowing it but it is very elusive.
Giovanni