For years it was a given that it was impossible to run a Linux based operating system on a less powerful computer whose architecture lacked a memory management unit. There were projects such as uCLinux which sought to provide some tidbits to low computing power Linux users, but ultimately they came to naught. It is achievable after a fashion though, by using the limited architecture to emulate a more powerful one. It’s been done on AVR chips emulating ARM, on ARM chips, and now someone’s done it on an ESP32-C3 microcontroller, a RISC-V part running a RISC-V emulator. What’s going on?
RISC-V is an architecture specification that can be implemented at many levels from a simple microcontroller or even a pile of 74 logic to a full-fat application processor. The ESP32-C3 lies towards the less complicated end of this curve, though that’s not the whole reason for the emulation. The PSRAM storage is used by the C3 as data storage and can’t be used to run software, so to access all that memory capacity an emulator is required that in turn can use the PSRAM as its program memory. It’s a necessary trick for Espressif’s implementation of the architecture.
Surprisingly it’s not as slow as might be expected, with a boot-up time under two minutes. It’s not what we’d expect from our desktop powerhouses, but it’s not so long ago that certain lower-power full-fat processors could be just as lethargic. For past glories, see the AVR running Linux, and the RP2040.
Clever solution to unmappable SPI-based RAM. Similar troubles existing in Harvard Archtectures…
Also, another interesting finding, having gone down this rabbit hole: apparently uClinux did not come to naught, as “NOMMU” seems to be a thing, now, and since some years.
According to Wikipedia https://en.m.wikipedia.org/wiki/%CE%9CClinux uCLinux was merged into mainline Linux 2.5.46
So after 2.5/2.6 it was not a separate project anymore as I understand it.
Yup. You can run modern Linux on MCUs just fine. I’ve done commercial products with Linux running on Cortex M4. I needed to place a 4MB SDRAM to make it happen.
he mentions ESP32S3 can actually run code from PSRAM, is that right? doesn’t it make it much easier? what can be actually be done in Linux with a 240mhz mcu with 8MB PSRAM? they are about 6$ on aliexpress
S-series uC’s are xtensa. And it would be a *lot* of work to coax Linux to boot on one.
yes, but why would you (apart from the fun of getting it to run) want to run linux on a esp32? It’s much nicer to use RTOS!
Main reason is to get easy access to a large amount of software that’s already written. For example, you get a mature network stack, filesystems and security protocols.