-
I have a couple of questions about loading mods dynamically on an esp32, meaning over the network by an app that is running on the board. What I'd like to do is receive a mod over the network and save it to flash, then perform a reset such that this mod gets loaded. I'm trying to understand what is required to do that safely currently, and perhaps how it could be made more flexible. Questions:
Looking at future options:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 26 replies
-
That's a lot of questions. I won't try answering all of them completely at once.
Correct.
The default mod loader needs to run early because of symbol mapping.
Correct. If the mod is in-use, overwriting it is problematic since that would alter its bytecode and strings. FWIW – in a project where flash was tight, instead of an A/B scheme, we have just a single mod partition. When an update is available, we invalidate the current mod, restart, download the mod over the previous one, and then restart. It is basically invisible to the user.
The mctest tool -- what we use to run unit tests -- enables an obscure feature (see Finally, as I may have mentioned previously, XS has provisions for other mod loaders. We use that in some private projects but haven't yet published. It supports multiple mods active simultaneously, loading mods at any time, and running mods from RAM. It works by building on the Compartment module loader in Hardened JavaScript. It works well, but you won't like it because it isn't well documented yet. ;) |
Beta Was this translation helpful? Give feedback.
That's a lot of questions. I won't try answering all of them completely at once.
Correct.
The default mod loader needs to run early because of symbol mapping.