interestingly, this is the first esp32 firmware i've seen that claims to support loadable native code applications ("elf apps"), even though it seems to come with only a single example:
https://github.com/ByteWelder/Tactility/blob/main/App/Source...
since a lot of the newer esp32 devices purport to be computers (e.g. lilygo t-deck/t-lora pager, m5stack cardputer, ...), it's a bit strange that with a typical esp-idf setup you can't actually run arbitrary code on them.
It isn't easy but flipper did a remarkable work demonstrating it was possible. Tactility is following a similar concept and in my opinion is the project that implemented it best after flipper.
In the past, the solution for arbitrary code was running scripts such as Wrench: https://github.com/jingoro2112/wrench
More recently also became possible to run Java apps with a JVM on ESP32: https://github.com/FlintVN/FlintESPJVM which is not yet arbitrary (e.g. download and run) but that is the route of development.
Even Linux was demonstrated running on ESP32 albeit I've never tried it: https://www.youtube.com/watch?v=pj0a91vlcGo
I've been toying with the ESP32 architecture for a few years. (I began with ESP32-DevKitC in 2022.) I recently got four ESP32-S3 modules with the intent of trying out the ESP32 Bus Pirate (https://github.com/geo-tp/ESP32-Bus-Pirate).
I hadn't heard about any Linux ports until I saw your comment here. Thanks!
The "playground" Linux port looks interesting, but it hasn't seen any updates for nearly a year. Still, I'm going to try it on a ESP32-S3 N16R8 and see how it goes.
It's funny, because I first ran Linux (SLS & Yggdrasil) on a PC with a 33MHz clock, 32MB RAM, and a 70MB hard drive. The N16R8 clock speed, RAM, and flash are all within an order of magnitude of what was on that old PC.
https://github.com/ESP32DE/Boot-Linux-ESP32S3-Playground
Yes, kind of crazy for those of us that remember those days. ESP32 are quite the magical devices when considering the price/features ratio.
If you try the Linux build I'd appreciate to read your feedback/experience when running it.
> interestingly, this is the first esp32 firmware i've seen that claims to support loadable native code applications ("elf apps"),
Very skeptical that this is of any use; after bootup you have, what ... 260kb of RAM? Just doing runtime linking/relocations would eat up some of that. Just how small would your application have to be to be loaded at runtime?
Maybe they don't load the whole think into RAM, but thunk it somehow (I assume that elf supports that)?
Some variants of the ESP32 support executing code from external memory (PSRAM) too. That gives you 8MB more to play with.
Some ESP32's have 8MB of PSRAM and 16MB of flash "storage". You can theoretically also add external SRAM modules but I've never seen that IRL for the ESP32 family. I've occasionally seen the flash used as slower, persistent RAM.
You don't link bunch of stuffs in RAM at execution time on embedded devices... all static and anything static stays in ROM. "eXecute In Place". ROM's just slow RAM that forget writes. Only variables goes on to RAM, and 260kB is enough for a lot of non-multimedia data.
Pretty sure with xtensa and gcc you can compile to PIC. Google says a linker only would need to modify the Global Offset Table and Procedure Linkage Table. That doesn't sound too terrible.
Also 260kB of RAM on a 32bit processor could be a fair bit of code. Plus you could write it to external or internal flash. Though I don't know if esp-idf supports XIP (Zephyr does).
> esp-idf supports XIP
XIP depends on hardware support, not software.
The Apollo Guidance Computer only had 4kb of RAM and got to the moon and back.
There must be some a.out format there or .com like in Dos. Also original Unix run at 48kb of ram
That app is just an internal one for when people build their own firmware. The external apps have recently moved to https://github.com/ByteWelder/TactilityApps
It's still not much, but more will be made in the coming months. I wanted to stabilize the APIs a bit more before making more apps. I almost finished a Diceware app.
I am also looking for this.
I envision an OS that handles networking, remote maintenance and updates and possibly even some scheduling for multiple applications, so that I don’t have to do all that in my application code. I don’t see what conceptually would make this hard and it would be a great step up in hobbyist development experience to me.
As far as I’m aware NuttX (POSIX-like) even has a shell, so I don’t see what should be so hard about it (please correct me).
Edit: Apparently Zephyr is also gaining support for this. Whoever builds a simple platform on top of one of these definitely had my attention.
You can technically do it on any processor that allows you to execute code from RAM. Loading ELF files at runtime is a whole process provided by an OS kernel, which ESP-IDF is not.
Zephyr support ESP32 and LLEXT