Code.py Does Not Execute After Boot.py On Hard Reset #17576
-
After months of development and a fair bit of code, I was ready to use my device - but after a hard reset it only runs boot.py, and then exits. As I was doing a fair amount of work in this code organized between boot.py/config.py/code.py and custom modules, I have stripped everything to a bare minimum but still have this problem. Here is stripped down case: Chip is an ESP-32 Pico-V3 - 2, 40MHz xtal, sitting atop an Adafruit HUZZAH V2 board. Bare board, nothing attached to board except cable connection to PC via USB port. Erased flash on chip: python -m esptool --chip esp32 erase_flash Installed MP: esptool --baud 460800 write_flash 0x1000 ESP32_GENERIC-20241129-v1.24.1.bin. The binary obtained from: https://micropython.org/download/ESP32_GENERIC/ Code on chip, nothing else: Running this through Thonny serial/usb connection: REPL says:
But then the problem: Same result initiating hard reset from reset switch on board, or via software command:
I tried using ESP32_GENERIC-SPIRAM-20241129-v1.24.1.bin, same result. I have also tried both Generic and SPIRAM v1.24.0 versions to no avail. In my project I am doing a fair bit of signal processing, so I was using a pre-built binary that includes ulab/numpy. This was using MP v1.23, obtained from https://github.com/v923z/micropython-builder/releases, courtesy of Mr. Zoltán Vörös. Code works fine, but has same hard reset issue. Also tried his bundle that uses MP v1.24.0 with same result. Am I missing something very fundamental in my understanding that the boot sequence should simply be boot.py => code.py, with no intervention on my part (per MP docs), or is there something wrong in the hardware? Or my flash process? Or? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Since when does a ›code.py‹ starts automagically? |
Beta Was this translation helpful? Give feedback.
-
can you point us to the part of the documentation where it says that code.py is run from boot.py? |
Beta Was this translation helpful? Give feedback.
MicroPython: main.py
CircuitPython: code.py