cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 and UART single-wire, half-duplex comm. fails after software reset

Kmax18
Senior

I am using the NUCLEO-G071RB, STM32CubeIDE (v1.14.0), and the HAL library STM32Cube_FW_G0_V1.6.2 for prototyping firmware that should communicate with an external device using UART single-wire, half-duplex communication.
The expected startup response from the device is 0x73xxxxxx, which works after a full power-cycle (power off/on). However, after a software reset using the HAL function NVIC_SystemReset(), the startup response has a leading zero byte: 0x0073xxxx, which invalidates the packet and causes communication to fail.
Question:
How to prevent the leading zero byte? Does a software reset require an additional command to flush the UART RX buffer?

Thank you!

1 REPLY 1
TDK
Guru

A software reset also completely resets the UART peripheral. It doesn't keep stored information or previously received bytes. There is likely some other explanation as to what's happening here. Use a logic analyzer and show the UART lines along with NRST to see what's happening on the line.

If you feel a post has answered your question, please click "Accept as Solution".