cancel
Showing results for 
Search instead for 
Did you mean: 

(STM32G431CBU6) NRST as GPIO occasionally fails

duke
Associate

NRST configured as GPIO to output MCO clock.

In rare cases after power-on, the MCO clock is not output, although the program runs normally (e.g., printf messages are visible via UART).

To increase the probability of reproducing the issue: the MCO pin is pulled up to 3.3V with only a 220Ω resistor (no other load), and power is applied rapidly using a mechanical switch. Under these conditions, the issue typically occurs within 10 attempts.

The following waveforms show the MCO output in both normal and failure scenarios after MCU power-up:

1744112158818.jpg

1744112168906.jpg

When MCO has no output, disconnecting the 220Ω resistor and briefly touching the MCO pin with tweezers causes the MCU to reset, indicating that the pin is still functioning as NRST.

When MCO is used to provide a clock signal to a third-party chip (CDCTL01A), and when the MCU fails to read correct register values via SPI, triggering a software reset using NVIC_SystemReset() can also restore MCO output. See the waveform below:

1744112142670.jpg

Zoomed-in view of the waveform during power-up:

1744112150313.jpg

Zoomed-in view of the waveform during reboot:

1744112128128.jpg

1 REPLY 1

You scope has a USB socket to get screenshots - this will give far clearer results than photographing the screen!

AndrewNeil_0-1744118441530.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.