SHA2017-badge / micropython-esp32

MicroPython ported to the SHA2017 badge
https://micropython.org/
MIT License
12 stars 16 forks source link

soft reboot in raw REPL mode skips boot.py (for ampy, pyboard) #203

Closed projectgus closed 7 years ago

projectgus commented 7 years ago

I needed this to use "import shell" and then use ampy or pyboard to run code, without delays or weirdness caused by the "soft reboot" triggered by these tools.

Before this change, I found ampy/pyboard would reset the board from "shell mode" into normal running mode, and there were races with power management & the WiFi OTA check which could make it fail.

After this change, the badge will stay in "shell mode" each time ampy/pyboard runs, until a hard reset or a soft reset from the "friendly" REPL.

Remaining downside, because boot.py doesn't run the hardware isn't fully initialised when ampy/pyboard runs code. ampy ls returns no files and ampy put returns ENODEV (without this change, I find ampy ls crashes the badge.)