Bug: On STM32 USARTv3 SIO LLD, sio_lld_update_enable_flags() does not clear USART_CR1_RXNEIE_RXFNEIE. As a result, RXNE/RXFNE interrupts can remain enabled even after sioWriteEnableFlagsX(..., SIO_EV_NONE), causing spurious SIO IRQs (and the “spurious interrupt” assert) when no callback is configured.
Trigger: Typical sequence is:
1. sioStart(&SIODx, ...)
2. sioWriteEnableFlagsX(&SIODx, SIO_EV_NONE) (or no callback + no events enabled)
3. USARTv3 still has RXNEIE/RXFNEIE set → IRQ fires with no enabled events : spurious ISR assertion
Proposed fix (USARTv3 only): Clear RXNE/RXFNEIE in the CR1 mask before re‑applying enabled flags.
Code: Select all
/* in USARTv3/hal_sio_lld.c::sio_lld_update_enable_flags() */
cr1 = siop->usart->CR1 & ~(USART_CR1_IDLEIE | USART_CR1_TCIE |
USART_CR1_PEIE | [b]USART_CR1_RXNEIE_RXFNEIE[/b]);
Note: USARTv2 LLD is already correct — it clears USART_CR1_RXNEIE inside its sio_lld_update_enable_flags().
And a SIO related question : I see that idle line detection is handled by SIO, but what about RTO (configurable receiver timeout), is it usable in the actual state of the driver ?
Alexandre