Managed to compile the firmware myself; importing a particular library causes a crash

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
av8r1
Posts: 3
Joined: Thu Oct 07, 2021 1:35 am

Managed to compile the firmware myself; importing a particular library causes a crash

Post by av8r1 » Thu Oct 14, 2021 7:20 am

Okay. Figure this one out.

Sparkfun ESP32 Thing Plus. Comes with the severe disadvantage of 16MB of flash instead of the obviously superior 4MB. There's no straightforward way of gaining access to three quarters of my flash storage without building the firmware myself. According to this thread you have to change one character in partitions.csv. vfs Size changes from 0x200000 to 0xE00000.

I 100% guarantee I did something wrong, because--as usual for this project--the documentation is incomplete and incorrect. Following the instructions on this Github page doesn't work because there are steps missing.

The best instructions I've found are on this Stack Overflow page. This mostly worked. It seems the instructions there were for resizing the partitions within 4MB, which wasn't what I was doing. I just wanted to change that one 2 to an E. I left all other numbers alone.

I got an error about 16MB not fitting in 4MB, as discussed in this thread. First, the error message that tells you to use that menuconfig doesn't actually tell you how to do that. How was I supposed to know that menu was even there? Change that value in that file and voila it...throws the same error. Keep reading in that thread, and you find that--even though the error message tells you it's that setting in that config menu, it's actually looking for a different value in a different config file than the one the error tells you to change. Change that, and it finally builds. Flash it to the board, and it works, and shows just over 13MB of flash memory available.

All that is background for the real problem I'm here for.

I've got a BME280 on a breakout board. I'm attempting to use this library. Storing a copy of the bme280_float.py in the board's flash, and then typing the example script from the bottom of the github page into the REPL, changing the line declaring the i2c port for the pinout of my dev board.

Using the standard firmware (esp32-20210902-v1.17.bin) this works correctly. Using the firmware I built myself, it does this:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4008af8b  PS      : 0x00060031  A0      : 0x8008b0ae  A1      : 0x3ffbe8d0  
A2      : 0x00000000  A3      : 0x3ffb7020  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0xffffff00  A7      : 0x6001301c  A8      : 0x3ffb722c  A9      : 0x3ff53000  
A10     : 0x00000901  A11     : 0x00000088  A12     : 0x3ffbf0c0  A13     : 0x00000001  
A14     : 0x00000000  A15     : 0x00000800  SAR     : 0x0000001d  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000008  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  


Backtrace:0x4008af88:0x3ffbe8d00x4008b0ab:0x3ffbe910 0x400830a1:0x3ffbe940 0x401c8fbb:0x3ffbcf90 0x400d3693:0x3ffbcfb0 0x40094d30:0x3ffbcfd0 




ELF file SHA256: 24c1b01d9c69712c

Rebooting...
Two questions:
1. how do I fix this crash? I'm a Python programmer, I don't speak hexdump.
2. Is MicroPython really this broken?

Post Reply