2024-03-15 06:37 AM
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.
2024-03-15 06:57 AM
Show us your code (insert code snippets using the "</>" icon above).
2024-03-15 07:01 AM
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.
2024-03-15 08:52 AM
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