With the price of single board computers like the Raspberry Pi increasing all the time, news that Espressif's latest low-cost ESP32 can run Linux is to be welcomed. And its official!
It is a bit too early to say how useful this is, but it does give you a good feel for the way that microcontrollers such as the ESP line of devices is progressing and getting so much more powerful. The latest, the ESP 32 S31, is a dual-core RISC-V device running at 320MHz. This should be enough for most embedded projects, but the addition of more sophisticated memory management than you usually find in microcontrollers, even RISC-V based devices, means it much easier to run a real operating system. The S31 has a two-level page table with address translation. In addition, it has different levels of privilege operation, which makes isolating a kernel from user space possible.
This makes it possible, but the hardware is still a bit limited the most limiting being the amount of memory there is - 521K of SRAM and up to 64MBytes of SRAM. Also on the minus side is the lack of a GPU, so don't expect to run a GUI or do any big AI work. On the other hand, it does have a Gigabit Ethernet connection as well as WiFi/Bluetooth/Zigbee and all the things you expect on a microcontroller - GPIO, SPI, I2C, Camera,. audio I2S and so on.

So with that spec you start to think that maybe it could run Linux and be useful— after all, it's more powerful than many a desktop machine from the late 80s. Some experimenters have managed to get Linux running on other Espressif devices, but this time it is an official Expressif fork with support for the ESP32 S31. As the Github repo states -
Developer Preview**: This branch (`integration/v6.18-esp32s31`) is currently in developer preview and is **not yet recommended for production use**.
Notice the use of "not yet recommended for production use", which suggests they intend it to be so at some point in the future. At the moment, there is an official GitHub repo, but no binary. If you want to try the official port then you will have to build the kernel yourself. For a quicker start, you can try one of the unofficial ports that do have binaries. Probably the best to try is grieferpig's linux 6.18 port. This has been put together with the help of AI, but it goes a lot further than the official port. It uses the Linux device tree for customization and, at the moment, many of the features are experimental, but there is a good core of features that claim to be stable. You can, for example, program the GPIO using libgpiod. It also uses a BusyBox installation to provide the usual Linux command line.
Is this a good idea?
Personally I think its great, but I wouldn't use it for real— I'm too happy with Free RTOS and the Expressif SDK, but I can see that this is a stepping stone for perhaps a more powerful ESP32 in the future, really taking on the Raspberry Pis and Arduinos of this world. Watch this space.
- Harry Fairhead, I-Programmer's hardware guru, has written versions of his popular introductory IoT titles for the ESP32, including Programming The ESP32 RISC In C Using The Espressif IDF and its companion volume Programming the ESP32 RISC V in MicroPython.
More Information
https://github.com/espressif/linux
Related Articles
CoreBoard 1 Makes The New ESP32 S31 Top Of The S Family
New ESP32-S31 Super Dual RISC V With WiFi 6
Programming the ESP32 in MicroPython (I/O Press)
Programming The ESP32 In C Using The Espressif IDF (I/O Press)
Programming the ESP32 In C Using the Arduino Library (I/O Press)
Master The ESP32 In C (I/O Press)
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info
<ASIN:B0GX372RM5>
<ASIN:B0DKB5JPDD>
<ASIN:B0DHKT342W>
<ASIN:B0DSSVDV76>
