乐鑫 ESP32-S31 发布:可原生运行 Linux,性能接近树莓派

Hacker News 热门(buzzing.cc 中文翻译)·2026-09-24 22:41·1小时前·adunk
AI 导读

乐鑫推出新款 ESP32-S31 微控制器,配备千兆以太网 MAC、USB 2.0 High-Speed OTG 主控、双槽 SD 卡接口和摄像头输入,并采用两颗最高 320 MHz 的 32 位 RISC-V 核心。

Hacker News 热门(buzzing.cc 中文翻译)
50AI 编辑部评分,满分 100

乐鑫 ESP32-S31 发布:可原生运行 Linux,性能接近树莓派

2026-09-24 22:41· 1小时前· adunk
AI 导读

乐鑫推出新款 ESP32-S31 微控制器,配备千兆以太网 MAC、USB 2.0 High-Speed OTG 主控、双槽 SD 卡接口和摄像头输入,并采用两颗最高 320 MHz 的 32 位 RISC-V 核心。

Espressif has a new ESP32, the ESP32-S31, and that ESP32 comes with a gigabit Ethernet MAC, a USB 2.0 High-Speed host controller, an SD card interface with two slots, and a camera input. It's a pretty standard set of features for a Linux single-board computer, but a rather strange list of things to find on a microcontroller.

I've spent a lot of time with microcontrollers, and it's typical to find a couple of cores, a small amount of RAM, GPIO pins, and maybe Wi-Fi on one. Something more advanced typically uses a Raspberry Pi, yet the ESP32-S31 comes with a whole lot more than your typical microcontroller setup. Espressif has also made a big change to the CPU that makes it more like an SBC than ever.

Peripherals already change how it looks

It can do a whole lot more

esp32-s31-featured Credit: Espressif

The biggest news about the ESP32-S31 is its networking capabilities, packing a 1000 Mbps Ethernet MAC and a big jump over the slower 100 Mbps found on the ESP32-P4. It uses an 8P8C connector (commonly referred to as RJ45) and has a PHY that utilizes the chip's RGMII interface. RGMII is specifically what enables gigabit; otherwise, it would use standard RMII.

On top of that, then, there's USB, but it's not "standard" USB. The S31 has a USB 2.0 High-Speed OTG controller, and it's a full-size Type-A socket that can supply 500 mA in host OTG mode. Alongside that sits an SDIO host controller with two slots, a DVP camera interface taking 8 to 16 bits, and a parallel LCD controller that supports up to 24-bit RGB as well as I8080 and MOTO6800 panels. There are two I2S controllers with hardware Bluetooth audio sync, fourteen capacitive touch channels, a CAN FD controller, and four MCPWM units.

A block diagram of the ESP32-S31. The chip sits in the centre and lists its two 320 MHz RISC-V cores, a 40 MHz low-power core, 512 KB of SRAM, and its Wi-Fi 6, Bluetooth 5.4 and 802.15.4 radios. On the left, flash (up to 256 MB) and PSRAM (up to 64 MB) connect over separate buses. On the right, lines labelled with each interface lead to an Ethernet PHY and RJ45 port over RGMII (highlighted), a USB Type-A socket over USB 2.0 High-Speed OTG, two SD card slots over SDIO, a camera over DVP, an LCD p

Just from that list alone, it's clear that this is a new type of ESP32, and not one that we've really seen before. Wired networking? A USB host? Camera, display, audio? Everything here is more akin to an SBC than a microcontroller, but that's still not all.

On the CPU side, there are two 32-bit RISC-V cores running at up to 320 MHz and a floating point unit on each, a 128-bit SIMD data path for one of them, and a separate 40 MHz low-power core, too. Each core gets 32KB of L1 instruction cache and they share 64KB of data cache. Memory gets even more interesting: the S31 supports up to 64 MB of PSRAM over a 250 MHz 8-bit DDR interface, and supports up to 256MB of flash, too. On the ESP32-S3 the PSRAM interface was shared with flash, making this a rather big step-up.

Espressif put a real MMU in the ESP32-S31

Very different to the old "MMU"

A two-part diagram comparing the two things Espressif has called an MMU. The top part, for the ESP32-S3 and ESP32-P4, shows the CPU sending an address to an MMU with one map for the whole chip, which points into SPI flash or PSRAM; all code on the chip uses the same map. The bottom part, for the ESP32-S31, shows an Sv32 virtual address split into VPN[1] (bits 31 to 22), VPN[0] (bits 21 to 12) and a 12-bit offset. Each field indexes one step of the lookup: the satp register (highlighted) points t

Espressif has been using the term "MMU" for quite a long time, including on the ESP32-S3 and the ESP32-P4. However, the MMU in that case was a block that maps external flash and PSRAM to address space, nowhere near the complexity of a modern MMU that can also do things like process isolation and page tables. As a result, when Espressif said the S31 has MMU support, it appeared to be more of the same.

However, there's a big difference this time around. In the S31's datasheet, Espressif says that the cores do "Sv32 two-level page-table address translation" and implement "Machine, Supervisor and User privilege modes." Sv32 is the actual RISC-V paging scheme, and having all three privilege modes is what enables a regular kernel to run in supervisor mode with firmware underneath it in machine mode. And this is how RISC-V-based Linux machines work.

A three-layer stack showing how Linux runs on the ESP32-S31’s RISC-V privilege modes. User processes such as the shell and SSH run in U-mode, where each process has its own address space; they make system calls down to the Linux kernel in S-mode, which is highlighted and keeps the Sv32 page tables the hardware uses to translate virtual addresses. The kernel in turn makes SBI calls down to OpenSBI firmware in M-mode, which keeps full access to the chip and provides timer, interrupt and reset serv

Unlike previous hacky attempts at getting Linux running on past ESP32 microcontrollers, the S31 has a lot more out of the box to natively support it. For starters, Espressif already published a Linux BSP back in August, built on Buildroot and U-Boot, and it includes a kernel, device tree, and root file system. Espressif says that it's "not yet recommended for production use," but the point is that it works.

That also hasn't stopped the community from iterating fast. One port sees Linux 6.18 running in supervisor mode, complete with working drivers for practically all of the hardware. There's another, based on Linux 7.1, that supports an 800x480 LCD panel connected, capable of showing a console. Being able to plug in a display, use wired Ethernet, and use a mouse and keyboard sound a lot more akin to an SBC than a microcontroller.

Memory is the biggest downfall

A lot less than would-be SBC competitors

Milk-V-Duo-S-5

The S31 starts to lag behind when looking at the RAM it carried: there's 512KB of SRAM on chip, and two variants are available with either 16MB or 32MB of in-package PSRAM. The maximum memory it can carry is 64MB, and there's no DRAM controller anywhere to be found. Compared to the likes of the Milk-V Duo S with its 512MB of RAM, you're reminded by the competition very quickly that the ESP32-S31 is a microcontroller.

This is exactly why those Linux builds execute the kernel from flash, in order to avoid spending precious PSRAM on it. As well, there's no GPU or NPU on-board, and while the ESP32-P4 has video encode and MIPI interfaces, those are traded out for additional radios on the S31. You still get a JPEG codec, a 2D pixel-processing accelerator, and 2D DMA, but that's not really enough to show a full Linux desktop.

The clock speed also raises some questions about the gigabit Ethernet NIC. At 320 MHz, you get approximately 3,900 CPU cycles per maximum-size Ethernet frame, and about 215 per minimum-size frame. With a theoretical PSRAM maximum of 500 MB/s, it may be possible to get closer to those gigabit speeds in bulk transfers, but I would be skeptical when it comes to saturating the connection with a lot of smaller packet transfers.

Those radios are a big deal, as comparable SBCs for the price skip an on-board wireless stack. You get 2.4GHz Wi-Fi 6, Bluetooth 5.4 with both LE and Classic BR/EDR, and an 802.15.4 radio for Thread and Zigbee, alongside the gigabit MAC. Matter works over Wi-Fi and Thread, and going back to Bluetooth Classic for a moment, the fact it's there on an ESP32 is arguably pretty unusual. But it means older audio gear will work perfectly.

Power consumption is pretty great even with those radios, too, as Wi-Fi receive consumes between 110 mA to 117 mA depending on the mode, transmit peaks at 265 mA on 802.11b at 15 dBm, and both cores in modem-sleep at 320 MHz draw 91 mA with peripheral clocks off or 147 mA with them on. It's the power profile of a microcontroller despite having an SBC's set of peripherals.

The "S31" name is a bit of a mess

But the rest is pretty good

Two USB-C ports on the ESP32-S3

The fact that this is called an "S31" board is a little bit strange; "S31" implies an S3 revision, despite it essentially being totally irrelevant to the regular S3. Espressif defines the S series as "high-performance feature-rich SoCs", nothing to do with instruction sets, but one big difference between both lineups were the RISC-V cores used in the C series and the Xtensa LX7 cores used in the S series.

In a comment section on Hackaday, Jeroen Domburg, Technical Marketing Manager for Espressif, said that "We actually never intended the CPU architecture to be part of the name." He also states that the core is derived from the P4's and puts the S31 at nearly twice the speed of the S3.

Unfortunately, the S31 datasheet is still out of date, stuck at version number 0.5 and a big "PRELIMINARY" watermark across the first page. it's quite detailed and mostly consistent, at least, though one example of its preliminary status is that the PSRAM is listed as having an 80 MHz maximum clock; directly at odds with Espressif's published 250 MHz PSRAM speed. To be fair, slightly messy documentation isn't particularly out of the ordinary for Espressif, but it's proof of just how early we are into the ESP32-S31's lifecycle. The Linux side is essentially just a toy to play around with, and it will be for quite a while.

The S31 isn't an SBC, but it is the first ESP32 where many of its features, from the peripherals, bandwidth, and CPU privilege model all happen to be adjacent to a modern SBC. The gap between a microcontroller with good I/O and an SBC has been closing over the past couple of years, and while you still can't run a desktop on 16 MB of PSRAM, you can get a Linux terminal up and running on it without too much trouble. And that's the first step.

来源:Hacker News 热门(buzzing.cc 中文翻译)· xda-developers.com