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
Principal

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

TDK
Guru

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
Lead II

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 Can't Believe It's Not Butter. If you find my answers useful, click the accept button so that way others can see the solution.