Skip to main content
Visitor II
October 31, 2024
Question

UART frame reception issues beyond 3 bytes after Uart Wake From Stop

  • October 31, 2024
  • 1 reply
  • 1215 views
 

 

The attached code configures UART communication to wake up a microcontroller in sleep mode as soon as a frame is received. In sleep mode, the micro waits for data on the UART interface, and when a UART frame is detected, it automatically wakes up to process the received information. Each byte is then processed immediately, allowing for a quick response to incoming data.

However, with my two STM32 Nucleo L031K6 development boards, I have noticed different results during the tests of sending and receiving frames via RealTerm. Indeed, the behavior of the microcontroller becomes inconsistent when the frame sent from RealTerm exceeds three bytes.

What could be the causes of the inconsistency in the behavior of the STM32 Nucleo L031K6 microcontroller when receiving frames that exceed three bytes, and what solutions could be considered to address this issue?

    This topic has been closed for replies.

    1 reply

    ST Employee
    October 31, 2024

    Hello @messaoudi

    Try increasing the UART receive buffer, it's may be caused by buffer overflow 

    messaoudiAuthor
    Visitor II
    November 4, 2024
    Since reception is handled byte by byte, each data byte is processed as it arrives, minimizing the risk of buffer overflow. This approach eliminates the need for a large temporary storage for incoming data, making it unlikely that buffering issues will arise in this setup.
    Super User
    November 4, 2024

    Since reception is handled byte by byte, you need to ensure that the processing of each byte is completed before the next one arrives!

    Are you sure your code achieves that?

    Does it work without STOP ?

    How about using a ring-buffer to "catch" receive characters - so that you can then process them "at leisure" ... ?