Closed hippiefm closed 1 year ago
Hi @hippiefm,
Thank you for this report. We have actually performed some fixes related to this issue. Please check this commit available in the stm32l0xx_hal_driver repository.
As several types of events could occur (IDLE event, Half Transfer event, or Transfer Complete event), a new function HAL_UARTEx_GetRxEventType()
has been added to retrieve the Rx Event type that has lead to Rx Event callback execution. This allows thus to provide the Rx Event type that has lead to RxEvent callback execution.
With regards,
Hi @cnxiaochun,
I hope you are fine.
The issue you reported has been fixed in the frame of version v1.12.2 of the STM32CubeL0 published recently on GitHub.
Thank you again for having reported.
BeST Regards, Rania
Hello,
for now, RxEventCallback does not allow to distinguish interrupt reason, in DMA mode this could be RX half transfer, RX transfer complete or RX line idle. Adding information about interrupt reason would allow end user to react only on certain situations, eg. RX line idle interrupt is really helpful in communication with GSM modems.
Proposed solution
Changes inside stm32l0xx_hal_uart.h contain adding meaningful information about DMA specific interrupts (not covered by UART status register) and extending RxEventCallback with interrupt reason.
Changes inside stm32l0xx_hal_uart.c
Rationale
Adding above changes will allow end user to distinguish various interrupt reasons, either by checking SR flags or checking predefined values for DMA interrupts.