Skip to main content
Visitor II
March 15, 2024
Question

Not getting uart Interrupt

  • March 15, 2024
  • 3 replies
  • 1136 views

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.

    This topic has been closed for replies.

    3 replies

    Super User
    March 15, 2024

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

    Super User
    March 15, 2024

    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.

    Graduate II
    March 15, 2024

    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