meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
2.98k stars 714 forks source link

Fix original esp32 boot init panic #3985

Closed mskvortsov closed 1 month ago

mskvortsov commented 1 month ago

Still no luck. Now some builds fail because of iram text segment overflow - the very reason why libc was switched to nano in the first place.

thebentern commented 1 month ago

Still no luck. Now some builds fail because of iram text segment overflow - the very reason why libc was switched to nano in the first place.

I started taking a stab at splitting things out and moving the original ESP32 back to 6.3.2. https://github.com/meshtastic/firmware/pull/3980 Still needs some love

mskvortsov commented 1 month ago

Arduino-esp32 framework uses a build of esp-idf sdk that turns on a set of compile-time optimization flags targeting speed instead of size, which leads to IRAM segment blowup*. As these flags can't be reverted after building, and sdk re-building is probably undesirable, IRAM size reduction becomes tricky.

SDK includes IRAM-placed auxiliary SPI flash chip drivers - a compromise but reasonable candidate for removal. Removing them frees up several hundred bytes just enough to make the firmware fit.

In the long term, something more systematic should be done about IRAM usage. Currently, I don't see any alternative to making a custom SDK build.

(*) Proper meshtastic code uses only a tiny portion of the segment, no chance for reduction there.