LOGBOOK

HELP

← again tap: answer good → ↑ swipe up at the end: next

1 / 9 Part 1 of 2
Other keys: show • Space: good • 1-4: rate • 0: skip • 5: flag

Question

On an ESP32-DevKitC, which layers sit between the board you plug in and the processor core that runs your code?

Answer

Board → ESP32-WROOM-32D module → ESP32 chip → two Xtensa LX6 cores. The LX6 is the processor design inside the chip, licensed from Tensilica (now Cadence).

Nested layers of an ESP32-DevKitC: the board holds the WROOM-32D module, the module holds the ESP32 chip, and the chip holds two Xtensa LX6 cores

* Each layer adds what the one inside it can't do alone. *

Each layer wraps the one below it and adds what the inner part can't do alone:

  1. The DevKitC board adds what you need on a desk: the USB connector, a USB-to-UART bridge for flashing and the serial console, a voltage regulator, the BOOT and EN buttons, and pin headers.
  2. The ESP32-WROOM-32D module is the metal-shielded part soldered onto the board. It holds the ESP32 chip, a separate SPI flash chip for the firmware, the crystal and the antenna, already certified for radio use. A product maker can solder this module onto their own board without designing any radio circuitry.
  3. The ESP32 chip (a system on chip) holds the CPU cores, RAM, Wi-Fi and Bluetooth radios, and the peripherals such as GPIO, I2C and UART.
  4. The Xtensa LX6 cores are what actually execute instructions. Espressif did not design them: it licensed the LX6 from Tensilica and configured it for the ESP32.

Cadence markets the LX6 as a DPU, a "dataplane processing unit": a processor you tailor to a data-processing job rather than a fixed, general-purpose CPU. That configurability is the subject of the next cards.

Tip: When someone says "the ESP32 runs at 240 MHz", they mean the LX6 cores inside the chip inside the module.

Go deeper:

ESP32 function block diagram
ESP32 function block diagram
Brian Krent (talk · contribs) · CC0 · Wikimedia Commons
or press any other key

Question

What does it mean that the Xtensa LX6 is a "customizable" processor, and what follows for the code you compile for it?

Answer

The chip designer picks the processor's features before the chip is made, and Cadence's tools generate the hardware design for that choice. Two chips with "Xtensa LX6" inside can therefore have different instructions, so the compiler has to target the exact configuration.

The Xtensa LX6 base ISA with the options the ESP32 took (multiplier and divider, MAC16, single-precision FPU, register windows, narrow instructions, zero-overhead loops, JTAG debug) and those it left out (double-precision FPU, DSP extensions, MMU)

* The ESP32's option set, from ESP-IDF's processor configuration header. *

Most processors are fixed: every ARM Cortex-M4 runs the same instruction set, with at most an optional FPU. Xtensa works differently. Tensilica (bought by Cadence in 2013) sells a tool that takes a list of chosen options and generates the RTL for that processor. RTL ("register-transfer level") is the hardware description that is turned into the actual circuit. The options are fixed at synthesis time, before manufacturing. A hardware multiplier, a multiply-accumulate unit, a single- or double-precision floating-point unit and various DSP extensions can each be added or left out.

The trade-off is silicon area and power against speed. A feature you leave out costs nothing on the chip, but any program that needs it has to emulate it in software. For a battery-powered IoT chip that matters: you pay only for the features the product needs.

The consequence for software is that "Xtensa" alone is not enough to compile for. The compiler must know which options exist, or it may emit instructions the chip doesn't have. That is why ESP-IDF calls the compiler as xtensa-esp32-elf-gcc for the ESP32: it targets the ESP32's LX6 configuration specifically, and the ESP32-S3, with its LX7 cores, has its own variant.

Go deeper:

Simplified block diagrams of HiFi audio engine and Xtensa LX
Simplified block diagrams of HiFi audio engine and Xtensa LX
ScotXW · CC0 · Wikimedia Commons
or press any other key