Espressif has a new ESP32, the ESP32-S31, and that ESP32 comes alongside a gigabit Ethernet MAC, a USB 2.0 High-Speed presenter controller, an SD cardstock interface alongside two slots, and a camera input. It's a beautiful norm set of features for a Linux single-board computer, but fairly a different catalog of things to discover on a microcontroller.
I've spent a lot of period alongside microcontrollers, and it's representative to discover a brace of cores, a small amount of RAM, GPIO pins, and perchance Wi-Fi on one. Something additional advanced typically uses a Raspberry Pi, yet the ESP32-S31 comes alongside a entire lot additional than your representative microcontroller setup. Espressif has additionally made a big alter to the CPU that makes it additional akin an SBC than ever.
Peripherals already alter how it looks
It can do a entire lot more
Credit: EspressifThe biggest news concerning the ESP32-S31 is its networking capabilities, packing a 1000 Mbps Ethernet MAC and a big jump complete the slower 100 Mbps established 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 norm 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 provision 500 mA in presenter OTG mode. Alongside that sits an SDIO presenter controller alongside two slots, a DVP camera interface taking 8 to 16 bits, and a parallel LCD controller that supports up to 24-bit RGB as fine as I8080 and MOTO6800 panels. There are two I2S controllers alongside hardware Bluetooth audio sync, fourteen capacitive contact channels, a CAN FD controller, and four MCPWM units.
Just from that catalog alone, it's apparent that this is a new category of ESP32, and not one that we've really seen before. Wired networking? A USB host? Camera, display, audio? Everything current is additional akin to an SBC than a microcontroller, but that's motionless not all.
On the CPU side, there are two 32-bit RISC-V cores operating at up to 320 MHz and a floating item component on each, a 128-bit SIMD data way for one of them, and a distinct 40 MHz low-power core, too. Each center gets 32KB of L1 education cache and they portion 64KB of data cache. Memory gets equal additional interesting: the S31 supports up to 64 MB of PSRAM complete a 250 MHz 8-bit DDR interface, and supports up to 256MB of flash, too. On the ESP32-S3 the PSRAM interface was shared alongside flash, making this fairly a big step-up.
Espressif put a genuine MMU in the ESP32-S31
Very distinct to the old "MMU"
Espressif has been using the term "MMU" for fairly a lengthy time, including on the ESP32-S3 and the ESP32-P4. However, the MMU in that case was a obstacle that maps external flash and PSRAM to location space, nowhere near the complexity of a contemporary MMU that can additionally do things akin procedure isolation and leaf tables. As a result, whenever Espressif stated the S31 has MMU support, it appeared to be additional of the same.
However, there's a big difference this period around. In the S31's datasheet, Espressif says that the cores do "Sv32 two-level page-table location translation" and execute "Machine, Supervisor and User privilege modes." Sv32 is the genuine RISC-V paging scheme, and having all three privilege modes is what enables a regular kernel to run in supervisor manner alongside firmware underneath it in device mode. And this is how RISC-V-based Linux machines work.
Unlike former hacky attempts at getting Linux operating on former ESP32 microcontrollers, the S31 has a lot additional out of the box to natively assistance it. For starters, Espressif already published a Linux BSP rear in August, built on Buildroot and U-Boot, and it includes a kernel, equipment tree, and base document system. Espressif says that it's "not yet recommended for manufacturing use," but the item is that it works.
That additionally hasn't stopped the community from iterating fast. One port sees Linux 6.18 operating in supervisor mode, complete alongside operating drivers for practically all of the hardware. There's another, according to Linux 7.1, that supports an 800x480 LCD panel connected, capable of showing a console. Being capable to plug in a display, use wired Ethernet, and use a mouse and keyboard audio a lot additional akin to an SBC than a microcontroller.
Memory is the biggest downfall
A lot small than would-be SBC competitors
The S31 starts to lag rearward whenever looking at the RAM it carried: there's 512KB of SRAM on chip, and two variants are accessible alongside either 16MB or 32MB of in-package PSRAM. The maximum recollection it can transport is 64MB, and there's no DRAM controller anyplace to be found. Compared to the likes of the Milk-V Duo S alongside its 512MB of RAM, you're reminded by the competition extremely quickly that the ESP32-S31 is a microcontroller.
This is exactly why those Linux builds execute the kernel from flash, in command to evade spending precious PSRAM on it. As well, there's no GPU or NPU on-board, and during the ESP32-P4 has video encode and MIPI interfaces, those are traded out for additional radios on the S31. You motionless get a JPEG codec, a 2D pixel-processing accelerator, and 2D DMA, but that's not really adequate to display a complete Linux desktop.
The clock speed additionally raises several questions concerning the gigabit Ethernet NIC. At 320 MHz, you get about 3,900 CPU cycles per maximum-size Ethernet frame, and concerning 215 per minimum-size frame. With a theoretical PSRAM maximum of 500 MB/s, it may be imaginable to get nearer to those gigabit speeds in bulk transfers, but I would be skeptical whenever it comes to saturating the association alongside a lot of smaller packet transfers.
Those radios are a big deal, as comparable SBCs for the cost skip an on-board wireless stack. You get 2.4GHz Wi-Fi 6, Bluetooth 5.4 alongside the two LE and Classic BR/EDR, and an 802.15.4 broadcast for Thread and Zigbee, alongside the gigabit MAC. Matter plant complete Wi-Fi and Thread, and going rear to Bluetooth Classic for a moment, the fact it's there on an ESP32 is arguably beautiful unusual. But it method older audio equipment volition activity perfectly.
Power use is beautiful awesome equal alongside those radios, too, as Wi-Fi obtain consumes between 110 mA to 117 mA depending on the mode, transmit peaks at 265 mA on 802.11b at 15 dBm, and the two cores in modem-sleep at 320 MHz diagram 91 mA alongside peripheral clocks off or 147 mA alongside them on. It's the power overview of a microcontroller notwithstanding having an SBC's set of peripherals.
The "S31" name is a bit of a mess
But the remainder is beautiful good
The fact that this is called an "S31" commission is a small bit strange; "S31" implies an S3 revision, notwithstanding it basically being totally irrelevant to the regular S3. Espressif defines the S sequence as "high-performance feature-rich SoCs", nothing to do alongside education sets, but one big difference between the two lineups were the RISC-V cores used in the C sequence and the Xtensa LX7 cores used in the S series.
In a comment division on Hackaday, Jeroen Domburg, Technical Marketing Manager for Espressif, stated that "We really never intended the CPU architecture to be part of the name." He additionally states that the center is derived from the P4's and puts the S31 at nearly twice the speed of the S3.
Unfortunately, the S31 datasheet is motionless out of date, stuck at type figure 0.5 and a big "PRELIMINARY" watermark throughout the archetypal page. it's fairly detailed and mostly consistent, at least, although one example of its preliminary position is that the PSRAM is listed as having an 80 MHz maximum clock; immediately at likelihood alongside Espressif's published 250 MHz PSRAM speed. To be fair, slightly messy records isn't particularly out of the average for Espressif, but it's evidence of fair how first we are into the ESP32-S31's lifecycle. The Linux flank is basically fair a toy to perform about with, and it volition be for fairly a while.
The S31 isn't an SBC, but it is the archetypal ESP32 anywhere many of its features, from the peripherals, bandwidth, and CPU privilege example all happen to be neighboring to a contemporary SBC. The gap between a microcontroller alongside fine I/O and an SBC has been decision complete the former brace of years, and during you motionless can't run a desktop on 16 MB of PSRAM, you can get a Linux terminal up and operating on it without too much trouble. And that's the archetypal step.