Hello Everyone!!
I am just trying to understand what "reset_mode" is and what are the impacts of this on boot (flow of main.c) specifically for stm32 port.
It would be of a great help, if someone could point me out the right direction in understanding the flow of main.c
Many thanks!!
understanding reset_modes in ports/stm32/main.c
Re: understanding reset_modes in ports/stm32/main.c
The reset_modes essentially parallel the modes documented here:
https://docs.micropython.org/en/latest/ ... boot-modes
https://docs.micropython.org/en/latest/ ... boot-modes
reset_mode = 0 not used
reset_mode = 1 means boot normally (i.e. execute boot.py and main.py)
reset_mode = 2 means safe boot - don't run boot.py or main.py
reset_mode = 3 means reset the filesystem back to factory default
So the flow is pretty much exactly the flow of the stm32_main function.
* Do one-time initialization
* soft_reset label
* Do other initialization (i.e. first time and on every soft reset)
* Execute boot.py
* Execute main.py
* Enter the REPL
* Deinitialize peripherals
* goto soft reset label
https://docs.micropython.org/en/latest/ ... boot-modes
https://docs.micropython.org/en/latest/ ... boot-modes
reset_mode = 0 not used
reset_mode = 1 means boot normally (i.e. execute boot.py and main.py)
reset_mode = 2 means safe boot - don't run boot.py or main.py
reset_mode = 3 means reset the filesystem back to factory default
So the flow is pretty much exactly the flow of the stm32_main function.
* Do one-time initialization
* soft_reset label
* Do other initialization (i.e. first time and on every soft reset)
* Execute boot.py
* Execute main.py
* Enter the REPL
* Deinitialize peripherals
* goto soft reset label