Linux 5.0 shown to boot on ESP32 processor

ESP32 IoT processor supports up to 8MB PSRAM which makes it just enough to run a minimal version of Linux. There’s little practical application for it, but it may be fun to try, and one developer apparently managed to boot Linux 5.0.0 on a board with an ESP32 dual-core Xtensa processor connected to 8MB PSRAM and a 2MB SPI flash.

Linux ESP32

The shortened boot log above shown the bootloader output with ESP32-D0WD dual-core Xtensa processor eventually booting Linux 5.0.0. But the boot process is somewhat convoluted as the bootloader jumps to “Juice Vm” described as a “small RISC-V virtual machine” which then calls OpenSBI RISC-V Open Source Supervisor Binary Interface which loads the Linux kernel and a small file system.

The full boot log and binary images were shared on a Reddit thread and Whycan with the latter in Chinese. The total image size is around 1.5 MB that almost entirely fills the 2MB flash used in the board used for testing. SPI and UART interfaces are clearly supported, but they don’t seem to boot to a serial console just yet.

Good luck finding out what to do with the two binary images provided, as there’s no explanation at all of all this all works. It’s quite confusing, and initially, I even thought it showed Linux booting on ESP32-C3 RISC-V processor since Juice VM is a RISC-V virtual machine which, as a side note, can also be used to boot FreeRTOS, RT-Thread, and other OS. But I was eventually told JuiceVm rv64 virtual machine had been ported to the ESP-IDF with support for ESP32, ESP32-S2, and ESP32-C3.

Note it’s not the first time somebody runs Linux on ESP32, as last year the older Ubuntu 9.04 was demonstrated on ESP32.

Share this:

Support CNX Software! Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples

Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
13 Comments
oldest
newest
Brian
Brian
4 months ago

The SPI PSRAM on ESP32 is super slow, I dread to think how long this boot took (at least several minutes I would imagine)

juiceRv
juiceRv
4 months ago

Uploaded the runtime video to youtube
URL:https://youtu.be/w9UlZIYZtwI

muti
muti
4 months ago

The description says the video is sped up 30x

willy
willy
4 months ago

My understanding from the full dump is that it’s JuiceVM that was ported to ESP32, and that it boots a RISCV kernel under emulation. Finally not much different from my ESP8266 that emulates a Z80 and runs CP/M 🙂

willy
willy
4 months ago

By the way the kernel image booted above seems to be the same as the one booted as an example of Juice VM images, look at the last dump in the readme there: https://github.com/juiceRv/JuiceVm

Chris
Chris
4 months ago

I’m no virtual machine or emulator expert but wouldn’t it make more sense to virtualize an RV32 CPU?

nuha
nuha
4 months ago

remind of of someone run linux on top atmega

Philipp Blum
Philipp Blum
4 months ago

Some people have too much time 😀

vvdb.fr
vvdb.fr
4 months ago

he learned so much from doing that …

Arnd Bergmann
Arnd Bergmann
4 months ago

It’s also been possible for a while to boot native xtensa nommu linux on the esp32:

https://github.com/jcmvbkbc/linux-xtensa/commits/xtensa-5.6-esp32

However, this has never been upstreamed.

juiceRv
juiceRv
4 months ago

WOW,I will try to add mmu support base on this branch !!! thx for share

Advertisement