2022-02-01 01:47 PM
i am using nucleo-f429zzi. there is reset button (B2) is connected to NRST in mcu. Is it possible to use program to detect this button is clicked? Actually, I would like to stop some digital i/o when user presses this button to reset the system. It is better to use interrupt, anybody knows any method to do it?
2022-02-01 02:04 PM
It basically a non-maskable interrupt that resets the chip. You can't read the state of the pin, or out-run the signal to do anything.
It is not a GPIO, and isn't connected via the EXTI system.
NRST is considered bidirectional, the core can generate this, say via a Watchdog, or voltage threshold for brown-out conditions, or you can pull it low externally.
You should NOT drive it high externally with a push-pull driver, as this will prevent it resetting properly.
2022-02-01 02:10 PM
NRST is a dedicated pin, which cannot be reasssigned. So, pulling it low will immediately reset. But, after the MCU reboots, you can check the reset reason in the RCC_CSR register and execute some specific code if you detect a pin reset.
Alternatively, you may program the blue user button for EXTI interrupt and execute a software reset at the end of the interrupt handler.
hth
KnarfB