Espressif Systems releases a Linux BSP developer preview for ESP32-S31 RISC-V microprocessor - CNX Software
Skip to content
The ESP32-S31 microprocessor is getting Linux support from Espressif Systems. The ESP32-S31 dual-core RISC-V microprocessor was first unveiled in March, two ESP32-S31 development boards followed in May, and mass production was announced a few weeks ago.<br>The new RISC-V chip features an MMU (Memory Management Unit), which makes Linux much easier to handle, and the development boards also come with 16MB PSRAM, so a minimal Linux image is possible. Moving from theory to practice, Espressif Systems has now released a developer preview version of the ESP Linux BSP for ESP32-S31, and some community Linux ports are also in the works (more on that at the end of the article).
Let’s focus on the official ESP Linux BSP. The aforementioned repo only contains the image layout and packaging tools used by the ESP32-S31 Buildroot integration, and the core of the project can be found in the esp-buildroot-external repo with ESP32-S31 NOR boot stack and root filesystem with Buildroot 2025.02, along with instructions to build and flash an image. You can also directly check out the source code for the Linux 6.18 kernel fork used for the developer preview.<br>I don’t own a board, so I’ll just try to build the Linux image. A recent version of the esptool utility is still needed. Mine was esptool 4.7.0, and ESP32-S31 requires esptool 5.3.0 or greater, so I’ve updated it as follows:
sudo apt purge esptool<br>sudo apt install pipx<br>pipx ensurepath<br>pipx install esptool
sudo apt purge esptool<br>sudo apt install pipx<br>pipx ensurepath<br>pipx install esptool
Let’s check the version:
$ esptool version<br>esptool v5.3.1<br>5.3.1
$ esptool version<br>esptool v5.3.1<br>5.3.1
Let’s retrieve the code following the instructions from the Buildroot External Tree repository:
mkdir ~/edev/sandbox<br>git clone --branch 2025.02 --depth 1 https://gitlab.com/buildroot.org/buildroot.git esp-buildroot<br>git clone -b buildroot/v2025.02-esp32s31 https://github.com/espressif/esp-buildroot-external.git esp-buildroot-external
mkdir ~/edev/sandbox<br>git clone --branch 2025.02 --depth 1 https://gitlab.com/buildroot.org/buildroot.git esp-buildroot<br>git clone -b buildroot/v2025.02-esp32s31 https://github.com/espressif/esp-buildroot-external.git esp-buildroot-external
You’ll notice we didn’t have to clone the esp-linux-bsp repo since it will be automatically pulled by Buildroot.<br>Let’s configure the build:
make -C esp-buildroot BR2_EXTERNAL=~/edev/sandbox/esp-buildroot-external O=~/edev/sandbox/esp32-s31-linux espressif_esp32s31_function_core_board_nor_defconfig
make -C esp-buildroot BR2_EXTERNAL=~/edev/sandbox/esp-buildroot-external O=~/edev/sandbox/esp32-s31-linux espressif_esp32s31_function_core_board_nor_defconfig
Make sure it completes successfully, and the config file is written:
make: Entering directory '/home/jaufranc/edev/sandbox/esp-buildroot'<br>GEN /home/jaufranc/edev/sandbox/esp32-s31-linux/Makefile<br># configuration written to /home/jaufranc/edev/sandbox/esp32-s31-linux/.config<br>make: Leaving directory '/home/jaufranc/edev/sandbox/esp-buildroot'
make: Entering directory '/home/jaufranc/edev/sandbox/esp-buildroot'<br>GEN /home/jaufranc/edev/sandbox/esp32-s31-linux/Makefile<br># configuration written to /home/jaufranc/edev/sandbox/esp32-s31-linux/.config<br>make: Leaving directory '/home/jaufranc/edev/sandbox/esp-buildroot'
We are now ready to build the Linux for ESP32-S31:
ESP_ESPTOOL=$(which esptool)<br>make -C ~/edev/sandbox/esp-buildroot O=~/edev/sandbox/esp32-s31-linux/ -j$(nproc)
ESP_ESPTOOL=$(which esptool)<br>make -C ~/edev/sandbox/esp-buildroot O=~/edev/sandbox/esp32-s31-linux/ -j$(nproc)
This part took a while, well over one hour, as the system downloads packages and builds them. Nevertheless, we now have our Linux image ready to be flashed to the board.
...<br>gen_esp_flash_image: wrapping SPL -> spl_app.bin (load 0x2F040000)<br>esptool v5.3.1<br>Creating ESP32-S31 image...<br>Successfully created ESP32-S31 image.<br>gen_esp_flash_image: merging slots -> s31_full_flash.bin<br>esptool v5.3.1<br>SHA digest in image updated.<br>Wrote 0xd1f000 bytes to file 's31_full_flash.bin', ready to flash to offset 0x0.<br>gen_esp_flash_image: s31_full_flash.bin (13758464 bytes) ready in /home/jaufranc/edev/sandbox/esp32-s31-linux/images<br>make: Leaving directory '/home/jaufranc/edev/sandbox/esp-buildroot'
10<br>11
...<br>gen_esp_flash_image: wrapping SPL -> spl_app.bin (load 0x2F040000)<br>esptool v5.3.1<br>Creating ESP32-S31 image...<br>Successfully created ESP32-S31 image.<br>gen_esp_flash_image: merging slots -> s31_full_flash.bin<br>esptool v5.3.1<br>SHA digest in image updated.<br>Wrote 0xd1f000 bytes to file 's31_full_flash.bin', ready to flash to offset 0x0.<br>gen_esp_flash_image: s31_full_flash.bin (13758464 bytes) ready in /home/jaufranc/edev/sandbox/esp32-s31-linux/images<br>make: Leaving directory '/home/jaufranc/edev/sandbox/esp-buildroot'
Content of the...