Building MP firmware results in boot-loop ESP32

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Building MP firmware results in boot-loop ESP32

Post by Peugot206 » Sun Apr 17, 2022 3:26 pm

Hello forum users,

After a lot of trouble trying to figure out how to be able to build your micropython firmware (viewtopic.php?f=15&t=12268) I was finally succesfull in building my own .bin file for the ESP32.

I uploaded the .bin file via Thonny on my ESP32, but it results in a boot-loop. On a fresh MicroPython installation (on Ubuntu 20.04 64-bit, with ESP-IDF tools v4.0.2 (but I also tried v4.2 and v4.4 and got the same result)) I simply went to /ports/esp32, gave the 'make' command, and used that .bin file to upload on the ESP32.

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3f400020,len:217636
Any idea on what to do?

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Building MP firmware results in boot-loop ESP32

Post by davef » Sun Apr 17, 2022 8:41 pm

Did you do a build before putting any of your files in /modules ?

Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Re: Building MP firmware results in boot-loop ESP32

Post by Peugot206 » Mon Apr 18, 2022 7:27 am

davef wrote:
Sun Apr 17, 2022 8:41 pm
Did you do a build before putting any of your files in /modules ?
Yes, I haven't added anything in my modules yet, because I wanted to test if this works first to make sure.

I also notice that the filesize is different than the ESP32 generic v1.18 which is 1.519kB (from the MicroPython download page), while mine is 1.447kB, so they are not identical either. Not that I think that is causing the problem, but there are differences. Could be the ESP-IDF version that is different, even though I used a supported one from the ESP32 readme. (v4.0.2 currently, but I basically tried all the other supported versions too, which resulted in the same).

I've been googling but can't find anything related to this problem, next to that I'm pretty new to all this, so I am really clueless on where to start! :)

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Building MP firmware results in boot-loop ESP32

Post by davef » Mon Apr 18, 2022 8:18 am

When I built the ESP32 once I also noticed it was a different size.

There was a recent thread about making sure that you building the most recent git source against a specific esp-idf version. I wasn't playing much attention.
Last edited by davef on Wed Apr 20, 2022 7:40 pm, edited 1 time in total.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Building MP firmware results in boot-loop ESP32

Post by davef » Mon Apr 18, 2022 8:25 am

viewtopic.php?f=8&t=11827
It is not for your variant of ESP32, I assume Generic, but the suggestion of which version of esptools might be relevant.

Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Re: Building MP firmware results in boot-loop ESP32

Post by Peugot206 » Mon Apr 18, 2022 9:02 am

davef wrote:
Mon Apr 18, 2022 8:25 am
viewtopic.php?f=8&t=11827
It is not for your variant of ESP32, I assume Generic, but the suggestion of which version of esptools might be relevant.
Thank you, with good hopes I tried the version they recommended. v4.4-beta1 (with MP v1.18 git), rebuild the .bin file but it still results in a boot-loop. :(

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3f400020,len:197052
I'm clueless what it could be, all the files are basically default and it does compile, but doesn't boot.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Building MP firmware results in boot-loop ESP32

Post by Roberthh » Mon Apr 18, 2022 9:09 am

There is the version 4.4, which has been used. When changing branches of the esp-idk, do not forget to run git submodule update —init in the esp-idf directory, and it cannot hurt to run install.sh as well.

Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Re: Building MP firmware results in boot-loop ESP32

Post by Peugot206 » Mon Apr 18, 2022 10:43 am

Roberthh wrote:
Mon Apr 18, 2022 9:09 am
There is the version 4.4, which has been used. When changing branches of the esp-idk, do not forget to run git submodule update —init in the esp-idf directory, and it cannot hurt to run install.sh as well.
Thanks for your response. Tried this version as well, but did it again with the 'git submodule update --init' to make sure, also ran the install.sh again (it will even tell you to do this if you forgot it). Rebuild the firmware for the ESP32 (all left default, no added modules or anything) and still results in a bootloop!

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3f400020,len:197700

Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Re: Building MP firmware results in boot-loop ESP32

Post by Peugot206 » Wed Apr 20, 2022 4:01 pm

I still haven't found a solution for this after hours. How come no one else runs into these kind of issues I wonder.. could anyone else maybe try to build the firmware for ESP32 and let me know the result? I would greatly appreciate that!

If it works, please tell what MicroPython version git you are using, ESP-IDF version and what OS + version :)

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Building MP firmware results in boot-loop ESP32

Post by davef » Sun Apr 24, 2022 1:26 am

Peugot2006,

Have you made any progress with this?

I have been building another system and have been experiencing where the code stops running, a software WDT kicks in but after a re-boot it just sits there until the WDT kicks-in again. A hard-reset regains correct operation ... for awhile.

The main change is moving to v1.18, so I might revert to 1.17 and re-test.

Another issue I had seen previously were random lock-ups, so that is when I moved to the SPIRAM version. I did that in hopes that I would get a newer chip version. The ones I seemed to have more trouble with were revision 1 chips.

Post Reply