ESP32 OTA image shrinkage

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
smurf
Posts: 7
Joined: Wed Feb 27, 2019 11:25 am

ESP32 OTA image shrinkage

Post by smurf » Wed Jun 02, 2021 8:18 pm

Hi,

I managed to remove ~100KBytes off the ESP32 MicroPython image, which is nice if you want OTA upgrades and a file system that's larger than a megabyte. Also good for 2-MB systems.

I did this by removing support for PPP, IPv6, FAT, Ethernet, network loopback, threading, zlib and json. Dropping IPv6 support requires some annoying #ifdef hacks in ESP-IDF.

Be aware that flashing this image trashes your file system, as the partition layout changes.

Available at https://github.com/smurfix/micropython/tree/shrink, plus https://github.com/smurfix/micropython/esp-idf etc.

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

Re: ESP32 OTA image shrinkage

Post by Roberthh » Thu Jun 03, 2021 11:41 am

If the btree module is still included: that one consumes about 20k.

Post Reply