cancel
Showing results for 
Search instead for 
Did you mean: 

Not getting uart Interrupt

Error_Code
Associate II

Hi,

Im doing a project where uart is configure in interrupt method to receive 5 bytes.For this I'm using stm32h743 mcu.Im facing an issue with the uart reception.As mentioned above i expected to get an interrupt after receiving 5th byte if of the packet, in that case its working finebut when i try to seng 8bytes  of data im getting an interrupt for the very first time in that case after that im not getting any interrupt. On that that in used to get an hal ok from the "HAL_UART_Receive_IT". How can i fix this , could some one help me out.Thanks in advance.

3 REPLIES 3
Bob S
Super User

Show us your code (insert code snippets using the "</>" icon above). 

TDK
Super User

If you don't know beforehand how many bytes you are receiving, either receive every character individually or use HAL_UARTEx_ReceiveToIdle to receive as many characters until the line becomes idle or the buffer fills up.

And +1 to show code.

If you feel a post has answered your question, please click "Accept as Solution".
Karl Yamashita
Principal

Since you have variable length packets, you should use HAL_UARTEx_ReceiveToIdle_DMA with HAL_UARTEx_RxEventCallback

 

See this git project which explains how it works

https://github.com/karlyamashita/Nucleo-G431RB_Three_UART/wiki

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.