Arduino_Core_STM32 icon indicating copy to clipboard operation
Arduino_Core_STM32 copied to clipboard

HardwareSerial/Uart write and flush lock up when interrupts are disabled #472

Open fpistm opened this issue 3 years ago • 0 comments

Looking good. There is one worry I have still - if this code is called from inside an ISR (or another context where interrupts are disabled) and Serial has TX ongoing, I think this will result in an infinite loop, right? I know that logging/serial printing from inside an ISR is often considered unsupported and should not be done, but it is often very useful so if at all possible, we should support it (or at least not lock up - dropping output might be preferable then). For example AVR HardwareSerial does support it, and there's an issue about SAMD here (which also has some details on how it works on AVR).

Originally posted by @matthijskooijman in https://github.com/stm32duino/Arduino_Core_STM32/pull/1826#pullrequestreview-1116691995

fpistm avatar Sep 27 '22 11:09 fpistm