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 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. 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" 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. 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 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 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.
The newest ESP32 can actually run Linux, and it's getting uncomfortably close to a Raspberry Pi
Full Article
Original Source
Read the full article at Xda-developers →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.