DigiRadio v2

The v2 firmware

v2 has two firmwares: the audio program that runs in the ADAU1452 DSP, and the ESP32-S31 firmware, which controls the radio, Bluetooth and the DSP.

Where it stands. Both compile, but neither has ever run: the v2 board hasn't been assembled yet. Everything on this page still has to be tried on the prototype. The published firmware, updatable from the app, is the v1 one.

The DSP program

v1 uses an ADAU1701, programmed with SigmaStudio. The ADAU1452 is programmed with SigmaStudio+, which can't open the old projects, so I rebuilt the program from scratch with the same audio path and the same tuning values.

Radio · Bluetooth · ESP32 · beep→Compressor→6-band EQ→Volume→Super Bass and stereo spread→Bass boost→Limiter

The program takes 706 of the 8192 words of program memory, so the ADAU1452 has plenty of room left. The EQ and bass boost filters and the compressor curve use the same coefficients as v1. Super Bass uses a different algorithm, so its sound will have to be judged by ear.

Compared with v1 there is one more source, the ESP32, and levels are read from cells in the program.

The audio ports

The DSP generates every I²S clock, at 48 kHz, with 32-bit slots and 24-bit data. The tuner, the Bluetooth module and the ESP32 receive those clocks.

DSP portConnected toDirection
SDATA_IN0Si4684radio input
SDATA_IN1FSC-BT1058Bluetooth input
SDATA_IN2ESP32-S31web radio input
SDATA_OUT0FSC-BT1058Bluetooth output
SDATA_OUT1ESP32-S31output to the ESP32
S/PDIFTOSLINKoptical output

The ESP32 firmware

Everything that doesn't depend on the board is shared with v1: tuner, audio services, web server, web radio, alarms and updates. The v2 folder holds only what changes.

v1v2
ModuleESP32-S3-WROOM-1ESP32-S31-WROOM-3-N16R16V: RISC-V, 16 MB flash and 16 MB PSRAM
FrameworkESP-IDF 5ESP-IDF 6.1, where the S31 is still a preview target
DSPADAU1701 over I²CADAU1452 over SPI, on the same bus as the Si4684
BluetoothFSC-BT1035FSC-BT1058, UART without CTS and RTS
Si4684 firmwareSent by the ESP32 at every bootStored once in the Si4684's W25Q16
Identity EEPROM24AA025E48 at 0x5224AA025E64 at 0x50
PowerAlways on3V3_AUDIO switched by ENABLE_ANALOG, battery read over I²C
Audio outputsBluetoothBluetooth and TOSLINK, generated directly by the DSP

The ESP32 connections

The pins come from the schematic netlist. While 3V3_AUDIO is off, every pin to that domain stays high impedance, so the unpowered chips aren't fed through their protection diodes.

FunctionGPIO
Control SPI: SCLK, MOSI, MISO1, 2, 3
Si4684: CS, RESET#, INT, SMODE21, 15, 16, 17
ADAU1452: CS, RESET#20, 14
I²S to the DSP: BCLK, WS, output, input46, 47, 48, 42
BT1058: RX, TX, SYS_CTRL, RESET10, 11, 12, 13
I²C: SCL, SDA50, 51
ENABLE_ANALOG19
POWER_ALERT#7

POWER_ALERT# joins the open-drain outputs of the BQ25896 charger and the MAX17048 fuel gauge on one line with one pull-up. On each alert the firmware reads both chips over I²C and clears the MAX17048 alert, which would otherwise hold the line low and hide the BQ's pulses. Periodic polling stays as a fallback, and the values show up in GET /api/health.

The boot sequence

  1. ENABLE_ANALOG turns on 3V3_AUDIO with the audio pins still floating.
  2. The ADAU1452 goes first: reset, switch to SPI mode, status check. Until it is in SPI mode it would take Si4684 traffic for I²C.
  3. If the DSP didn't start from the EEPROM, the ESP32 loads the program over SPI.
  4. The Si4684 loads its patch and checks the images in its flash with a CRC. If they differ, it rewrites them.
  5. The Si4684 boots from the flash. If writing failed, the ESP32 sends the images as on v1.
  6. The BT1058 starts in the background.

A DSP failure doesn't stop the boot: the web server and updates stay reachable.

The two memories at first boot

W25Q16, the Si4684 flash. The ESP32 can't see it directly, but the Si4684 has commands to write it (AN649, §6.5). At first boot the firmware writes the FM and DAB images, verifying each block, and from then on checks the CRC at every boot.

25AA1024, the ADAU1452 EEPROM. This one too can only be reached through its chip, and registers aren't enough: the master SPI pins, used as outputs, are driven by the DSP program. So a small "writer" program, loaded into the DSP by the ESP32, moves those pins.

The image to write is still missing, though, because SigmaStudio+ only creates it with a board connected. So at first the EEPROM stays blank and the ESP32 loads the program over SPI at every power-up. With the first prototype I'll write the EEPROM from SigmaStudio+, read it back with the firmware and put the image in the firmware, which from then on writes it to other boards by itself.

Building it

ESP-IDF 6.1 is needed. The Si4684 images aren't in the repository: the script that fetches them is described in the documentation.

idf.py --preview set-target esp32s31
idf.py build

What's left to try

All open

The ESP32 firmware is in the Hardware-v2/firmware folder on GitHub, under Apache 2.0, with the full list of checks to run on the first prototype. The board itself is covered on the DigiRadio v2 page.