cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G071 and USART ReceiveToIdle problem?

vasilevskialeksandar
Associate III

I have project where I use 3 async UART to exchange data between 3 micros.

When I use my own FIFO stack with regular USART API everything works.

Now I need to use IDLE detection to keep calls to FIFO stack low.

Whenever I try HAL_UARTEx_ReceiveToIdle_IT or HAL_UARTEx_ReceiveToIdle_DMA API I also get HAL_UARTEx_RxEventCallback callbacks with size 1. I have checked that bytes are sent in sequence without idle between them.

When I use DMA I also use __HAL_DMA_DISABLE_IT(&hdma_usart1_rx, DMA_IT_HT); to prevent premature callbacks.

For some reason I get callback on first byte received not the last one.

Other micros are STM32l063 and they have possibility to register IDLE detection callback and works great. On latest CubeMX or G071 API is changed and there is no possibility to register IDLE callback without using HAL_UARTEx_ReceiveToIdle_IT function.

Any ideas what to try are will be greatly appreciated.

1 REPLY 1
Guenael Cadier
ST Employee

Dear @vasilevskialeksandar​ 

When using HAL_UARTEx_ReceiveToIdle_IT() or HAL_UARTEx_ReceiveToIdle_DMA() API, what value do you provide as Size parameter ?

For reference, i think a G0 UART example is available in STM32CubeG0 FW package in Projects\STM32G0C1E-EV\Examples\UART\UART_ReceptionToIdle_CircularDMA directory.

Should also be available on Github here.

Hope it could help you.

Regards