reset software

Maple Mini, Maple Rev3, Maple Rev 5 and Maple Ret 6, iTead Maple etc
Post Reply
frankz
Posts: 10
Joined: Sat Apr 10, 2021 8:05 am

reset software

Post by frankz »

is it possible to reset the board (or mcu) by code, instead of pressing the connected pin "reset" button?
ag123
Posts: 1089
Joined: Thu Dec 19, 2019 5:30 am
Answers: 9

Re: reset software

Post by ag123 »

try

Code: Select all

HAL_NVIC_SystemReset();
or

Code: Select all

nvic_system_reset();
mrburnette
Posts: 615
Joined: Thu Dec 19, 2019 1:23 am
Answers: 6

Re: reset software

Post by mrburnette »

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?
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.
dannyf
Posts: 96
Joined: Sat Jul 04, 2020 7:46 pm

Re: reset software

Post by dannyf »

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".
Post Reply

Return to “Maple & Maple mini etc”