Page 1 of 1

ESP32 Interactive code update

Posted: Tue Jun 24, 2025 4:21 pm
by gabrielt
I'm building a block-based web editor for microcontrollers like the ESP32 and want to make the experience more interactive by avoiding the full flash cycle. In my research, I’ve found interpreted options like MicroPython, which allow updates without reflashing the entire program—but they require switching away from native code.

Are there other ways to achieve this, such as partial updates or interpreters that still support native code?

Re: ESP32 Interactive code update

Posted: Wed Jun 25, 2025 3:19 am
by Sprite
I seem to remember we were working on something involving partial updates... let me see if I can find where that went.

EDIT: We have an internal PoC for this; ideally it'd end up in ESP-IDF eventually but I can't give a timeline, sorry.

Re: ESP32 Interactive code update

Posted: Fri Jun 27, 2025 9:46 am
by gabrielt
Thanks for the answer. If possible, could you share a description of the approach you are working on?

Re: ESP32 Interactive code update

Posted: Mon Jun 30, 2025 2:04 am
by Sprite
Sure. As far as I understand it, it works by marking components as 'stable' or 'volatile', depending on if it's expected that the code in there changes. For instance, all ESP-IDF code can be seen as 'stable'. Then there is a linker script that places the binaries generated by the 'stable' components first in flash, followed by the 'volatile' stuff. This means that if something changes in the 'volatile' bits, it can't shift any of the 'stable' stuff up or down. Finally, there's a change in esptool.py which only flashes pages that have changed; because the 'stable' stuff is, well, stable, it won't have to be reflashed.

Re: ESP32 Interactive code update

Posted: Wed Jul 16, 2025 5:13 am
by gabrielt
Hey again! I have recently noticed a few projects using WebAssembly interpreters to upload to ESP devices which seem to be quite fast when it comes to replacing/uploading programs.

How much of the ESP API and libraries do things like the [ESP-WASMachine][https://github.com/espressif/esp-wasmachine] support?