cancel
Showing results for 
Search instead for 
Did you mean: 

UART IDLE callback not work after some time

Hiren_Patel
Associate

Hi,

Application description: -

We are using STM32G4 Series microcontroller for UART communication in our application to send data to slave device. Master broadcast one specific command at interval of 200us.

master is sending 11 bytes at a time at a speed of 2 Mbps.

our controller is running at 170Mhz frequency.

We are using DMA on RX to receive the data. Slave device is not sending any data back to master, it is only receiving the data from master.

Problem : -

To receive the data from master in UART we are using HAL_UARTEx_ReceiveToIdle_DMA function and we are receiving our data in HAL_UARTEx_RxEventCallback function.

the problem is, after continues running and receiving data from master, the HAL_UARTEx_RxEventCallback function stop to triggered, that means our callback function won't called anymore, if we disconnect the master wire connection and again reconnect then it starts work again.

While it was stopping trigger callback function, we check huart->RxState the Receive status was showing continues busy.

Our data frame time is approx. 50microSecond, and we are providing 150 microsecond delay between two Data, So I guess delay time is enough to triggered IDLE line condition.

Kindly request you to provide the solution on this issue.

4 REPLIES 4

Make sure you are handling UART errors, mainly overflow.

JW

Hiren_Patel
Associate

Hi Jan,

Can you please explain little more about your suggestion.

Currently I haven't change anything in generated file from STM CubeMX.

I don't use Cube/HAL, so I don't know how is UART overflow handled there, sorry.

JW

Karl Yamashita
Lead III

Can't figure out what's wrong unless you show us code.

The most common issue are usually developers

  • Don't check HAL status.
  • Processing too much inside the interrupt which cause other interrupts not to fire

 

If smoke escapes your device, put the smoke back in. It'll still work as a conversation piece. If you find my answers useful, click the Accept as Solution button so that way others can see the solution.