reset software
reset software
is it possible to reset the board (or mcu) by code, instead of pressing the connected pin "reset" button?
Re: reset software
try
or
Code: Select all
HAL_NVIC_SystemReset();
Code: Select all
nvic_system_reset();
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: reset software
The fact that it "can" be done does not mean that it is a good idea. In-code resets are not identical to hardware resets; thus, you can leave registers and I/O pins in an unknown state. Some "core" implementations do have hardware calls which simulate the hardware reset-button line but you must remember such code is chip-specific.frankz wrote: Sat Jun 05, 2021 4:01 am is it possible to reset the board (or mcu) by code, instead of pressing the connected pin "reset" button?
Re: reset software
1) use the watch dog timer(s) - if you don't feed the watch dog, it resets the device;
2) use a gpio pin to pull down the mcu line;
3) jump to the reset start address - not a full reset, however.
4) call the device start-up routine, often _main().
5) call the reset handler. for CMSIS-based environment, that's default_reset_handler() in the start up file.
6) call SystemInit() - not a true reset
...
aka lots of ways to get varying degrees of "reset-ness".
2) use a gpio pin to pull down the mcu line;
3) jump to the reset start address - not a full reset, however.
4) call the device start-up routine, often _main().
5) call the reset handler. for CMSIS-based environment, that's default_reset_handler() in the start up file.
6) call SystemInit() - not a true reset
...
aka lots of ways to get varying degrees of "reset-ness".