Skip to content

0.2 — native Xtensa Linux

Choose a tag to compare

@paulneja paulneja released this 17 Jul 02:25
· 384 commits to main since this release

Linux now runs natively on the ESP32-S3. v0.1 ran Linux on a RISC-V
emulator hosted on the chip; this release replaces that with a real Linux 6.11
kernel compiled for Xtensa, executing directly on the chip's own cores. No
interpreter in the middle.

Flash one file and you have it — download the .bin below, then:

pip install esptool
esptool.py --chip esp32s3 -p /dev/ttyACM0 -b 460800 erase_flash
esptool.py --chip esp32s3 -p /dev/ttyACM0 -b 460800 write_flash 0x0 Linux-on-esp32-S3-v0.2.bin

Or clone the repo and run ./flash.sh --erase, which finds esptool and the
port by itself. Log in as root / changeme123 over the serial console at
115200 baud, and join your network with wifi connect "SSID" "PASSWORD".

Verified on a fully erased board: it boots to a login prompt, the RSA
accelerator passes its self-tests, the rootfs mounts from flash, telnet comes
up and the board reaches the internet.

What's new compared to v0.1

Native instead of emulated. The whole point. v0.1 interpreted RV32IMA
instructions in software; everything now runs as native Xtensa code.

The hardware RSA accelerator is usable from Linux. New in this release: the
chip's RSA/MPI block is wired into the Linux Crypto API as rsa-esp32s3, so
any program can use it, not just a demo. The kernel stacks
pkcs1pad(rsa-esp32s3,sha256) on top, so X.509 and signature verification go
through the hardware. A self-test runs at boot at 512 and 2048 bits. It is the
only crypto block Linux can safely claim — the WiFi firmware shares the die and
uses AES and SHA for WPA2, but never RSA.

Real WiFi, joined at runtime. wifi connect "SSID" "PASSWORD" — no
recompiling to change networks, and no credentials baked into the image. v0.1
needed the WiFi credentials compiled in.

DNS works. v0.1 reached the internet by IP only; name resolution was a
known gap. Fixed here.

More userland. Lua, a BusyBox httpd with a small status page (off by
default, start it with httpd -h /www -p 80), and curl.

Services are opt-in. Telnet is on by default; SSH ships disabled and is
enabled with ssh-server on. httpd does not autostart, so nothing you are not
using costs RAM.

One image, and a flasher. A single ~11.8 MB .bin for offset 0x0 with
bootloader, partition table, WiFi firmware, /etc, kernel and rootfs. It stops
before the /home partition, so re-flashing it leaves your data alone. The
repo also ships flash.sh, and everything needed to rebuild the image from
source.

Known limitations — please read

  • curl over HTTPS is experimental. Certificate verification is real and
    works against sites like github and google, but the CA bundle is trimmed to
    34 major roots because the full 140-cert set exhausts mbedTLS's memory on
    this board, TLS is 1.2 only, and RAM is tight. Fine for light fetches, not a
    robust tool. Expect rough edges.
  • The SoftAP does not work. The closed WiFi blob beacons as WEP instead
    of WPA2, so clients reject it or fail to get an IP. The proper fix (hostapd
    generating the beacon) is blocked by the lack of an MMU — there is no
    fork(). Note the esp32-linux SSID is visible in a scan even when
    ap status reports off
    , because the beacon comes from the firmware while
    the ap command only controls the Linux side. Do not rely on it. Use the STA
    mode above instead.
  • RAM is tight. Right after boot, while services start, a command can
    occasionally be killed by the OOM killer. Wait a few seconds and retry.
  • No MMU means no fork(): bash, python, nginx and anything else that
    depends on it cannot run. BusyBox ash and everything shipped here work
    within that.

Hardware

ESP32-S3 with 16 MB flash and 8 MB Octal PSRAM (an N16R8 module, e.g.
DevKitC-1). The 8 MB Octal PSRAM is required — it is the system RAM.

Checksum

sha256  43124f8cb96bfa4f74e507a7aa23e4e751aae8b4d5995193411d1491b955aaa5
        Linux-on-esp32-S3-v0.2.bin

Built on the Xtensa Linux, buildroot and esp-hosted work of
jcmvbkbc, and on Espressif's esp-hosted
firmware. See NOTICE for full credits and licenses.