2022-10-06 04:13 AM
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?
Solved! Go to Solution.
2022-10-31 02:31 AM
I solved it by setting Overrun: Disable
2022-10-31 02:31 AM
I solved it by setting Overrun: Disable