cancel
Showing results for 
Search instead for 
Did you mean: 

Why is overrun flag set after transmitting in 1-wire (half duplex) UART mode using the standard CubeMX-code and HAL-functions?

arnold_w
Senior

I'm working with the "NUCLEO-U575ZI-Q" development board and I compile using STM32CubeIDE 1.6.1. I want to use pin PC10 as a 1-wire (half duplex) UART pin and I use CubeMX to generate code with the following settings:

Mode: Singe Wire (Half-Duplex)

Hardware Flow Control: Disable

Baud Rate: 57600 Bits/s

Word Length: 8 Bits (including Parity)

Parity: None

Stop Bits: 2

Data Direction: Receive and Transmit

Over Sampling: 16 Samples

Single Sample: Disable

ClockPrescalar: 1

Fifo Mode: FIFO mode disable

Txfifo Threshold: 1 eight full configuration

Rxfifo Threshold: 1 eight full configuration

Auto Baudrate: Disable

Tx Pin Active Level Inversion: Disable

Rx Pin Active Level Inversion: Disable

Data Inversion: Disable

TX and Rx Pins Swapping: Disable

Overrun: Enable

DMA on RX Error: Enable

MSB First: Disable

When I try the following code, it seems the ORE-bit (Overrun error) in UART4-> ISR register is set afterwards (b.t.w, the statement works, i.e. it says Hello in Teraterm):

HAL_UART_Transmit(&huart4, (const uint8_t*)"\r\nHello", strlen("\r\nHello"), 100);

Enabling "UART4 global interrupt" in CubeMX didn't help, I still get overrun error. This is a problem because if I, e.g. do a UART receive afterwards then it will automatically fail due to overrun error. What am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
arnold_w
Senior

I solved it by setting Overrun: Disable

View solution in original post

1 REPLY 1
arnold_w
Senior

I solved it by setting Overrun: Disable