cancel
Showing results for 
Search instead for 
Did you mean: 

UART Receive (RX) IDLE Interrupt gets triggered before completion of a data transfer

TJosi.1
Associate

Hi,

I use the following setup:

EVAL BOARD: NUCLEO-G070RB

MCU: STM32G070RB

System Clock: PLLCLK (source HSI) running at 60 Mhz

UART: UART2,

UART2 Clock: SYSCLK (60 Mhz)

UART Buad Rate: 460800

I'm using UART RX IDLE Interrupt with DMA for receiving input data of unknown length from serial port. But for some data transfers, the RX IDLE interrupt is getting triggered more than once, before completion of an entire input data transfer, causing the interrupt handler to process a single input as multiple inputs. I tried with another NUCLEO-G070RB board, and a different serial port, still issue occurs.

The UART communication is through the USB Micro-B connector on the NUCLEO. So I dont use separate connection from UART2 pins for communication.

The issue never occurs if I lower my baud rate to 115200 instead of 460800.

Also the same code works without any issues even with baud rate of 460800 in a custom board that uses the same MCU (different package), and using the same UART controller (UART2).

Is 460800 a stable baud rate for the NUCLEO-G070RB platform? Or what can be the possible causes of this issue?

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

IDLE is detected if the Rx line is inactive for a full frame. At 400kBaud it's 4x shorter time than at 100kBaud. Also, at 400kBaud, it's more likely that the USB-to-UART process will contain spaces, depending on the exact implementation of the USB stack in STLink, the driver stack in PC, the workload on PC, the end application in PC.

The communication shouldn't depend on IDLE, especially if PC and USB are involved. Find another way to frame your messages, e.g. similar to HDLC (as in PPP).

JW

View solution in original post

1 REPLY 1

IDLE is detected if the Rx line is inactive for a full frame. At 400kBaud it's 4x shorter time than at 100kBaud. Also, at 400kBaud, it's more likely that the USB-to-UART process will contain spaces, depending on the exact implementation of the USB stack in STLink, the driver stack in PC, the workload on PC, the end application in PC.

The communication shouldn't depend on IDLE, especially if PC and USB are involved. Find another way to frame your messages, e.g. similar to HDLC (as in PPP).

JW