|
@@ -3,7 +3,8 @@
|
|
|
An Arduino sketch for the **Waveshare ESP32-S3 Zero** that provides a WiFi interface to Analog Devices ADAU1401/1701 DSP chips:
|
|
An Arduino sketch for the **Waveshare ESP32-S3 Zero** that provides a WiFi interface to Analog Devices ADAU1401/1701 DSP chips:
|
|
|
|
|
|
|
|
- **SigmaTCP bridge** (port 8086) — lets SigmaStudio connect wirelessly to a physical DSP over I²C
|
|
- **SigmaTCP bridge** (port 8086) — lets SigmaStudio connect wirelessly to a physical DSP over I²C
|
|
|
-- **HTTP EEPROM uploader** (port 80) — flash DSP firmware binaries to a 24C256 EEPROM from a browser
|
|
|
|
|
|
|
+- **HTTP EEPROM uploader** (port 80, path `/`) — flash DSP firmware binaries to a 24C256 EEPROM from a browser
|
|
|
|
|
+- **HTTP OTA updater** (port 80, path `/ota`) — update the ESP32 firmware itself over WiFi
|
|
|
|
|
|
|
|
This sketch runs on the companion **MSD ADAU14-1701 Adapter** PCB.
|
|
This sketch runs on the companion **MSD ADAU14-1701 Adapter** PCB.
|
|
|
|
|
|
|
@@ -16,7 +17,7 @@ This sketch runs on the companion **MSD ADAU14-1701 Adapter** PCB.
|
|
|
| Microcontroller | Waveshare ESP32-S3 Zero | Onboard WS2812 NeoPixel on GPIO 21 |
|
|
| Microcontroller | Waveshare ESP32-S3 Zero | Onboard WS2812 NeoPixel on GPIO 21 |
|
|
|
| DSP | ADAU1401 / ADAU1701 | I²C address 0x68 (7-bit: 0x34) |
|
|
| DSP | ADAU1401 / ADAU1701 | I²C address 0x68 (7-bit: 0x34) |
|
|
|
| EEPROM | 24C256 (32 KB) | I²C address 0xA0 (7-bit: 0x50) |
|
|
| EEPROM | 24C256 (32 KB) | I²C address 0xA0 (7-bit: 0x50) |
|
|
|
-| Display | 20×4 hd44780 I²C LCD | Boot status and IP address |
|
|
|
|
|
|
|
+| Display | 20×4 hd44780 I²C LCD | Boot status and IP address (optional) |
|
|
|
|
|
|
|
|
### Pin Assignments
|
|
### Pin Assignments
|
|
|
|
|
|
|
@@ -26,7 +27,7 @@ This sketch runs on the companion **MSD ADAU14-1701 Adapter** PCB.
|
|
|
| I²C SCL | 12 |
|
|
| I²C SCL | 12 |
|
|
|
| Status LED (NeoPixel) | 21 (built-in) |
|
|
| Status LED (NeoPixel) | 21 (built-in) |
|
|
|
|
|
|
|
|
-The DSP, EEPROM, and LCD all share the same I²C bus at 400 kHz.
|
|
|
|
|
|
|
+The DSP, EEPROM, and LCD all share the same I²C bus at 400 kHz. The LCD is optional — if not detected at boot the sketch continues without it.
|
|
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
@@ -39,6 +40,7 @@ Install via **Sketch → Include Library → Manage Libraries**:
|
|
|
| `WiFi` | ESP32 WiFi (built-in with ESP32 core) |
|
|
| `WiFi` | ESP32 WiFi (built-in with ESP32 core) |
|
|
|
| `WebServer` | HTTP server (built-in) |
|
|
| `WebServer` | HTTP server (built-in) |
|
|
|
| `Wire` | I²C master (built-in) |
|
|
| `Wire` | I²C master (built-in) |
|
|
|
|
|
+| `Update` | OTA flash write (built-in with ESP32 core) |
|
|
|
| `LittleFS` | Embedded filesystem for web assets (built-in) |
|
|
| `LittleFS` | Embedded filesystem for web assets (built-in) |
|
|
|
| `Adafruit NeoPixel` | WS2812 status LED |
|
|
| `Adafruit NeoPixel` | WS2812 status LED |
|
|
|
| `hd44780` | I²C LCD driver |
|
|
| `hd44780` | I²C LCD driver |
|
|
@@ -71,6 +73,7 @@ The onboard NeoPixel (GPIO 21) shows current activity at a glance:
|
|
|
| Blue | DSP read in progress (SigmaTCP) |
|
|
| Blue | DSP read in progress (SigmaTCP) |
|
|
|
| Yellow | EEPROM write via SigmaTCP |
|
|
| Yellow | EEPROM write via SigmaTCP |
|
|
|
| Magenta | EEPROM upload via HTTP |
|
|
| Magenta | EEPROM upload via HTTP |
|
|
|
|
|
+| Cyan | OTA firmware flash in progress |
|
|
|
| Red flash | Error (I²C failure, buffer overflow, bad packet) |
|
|
| Red flash | Error (I²C failure, buffer overflow, bad packet) |
|
|
|
|
|
|
|
|
---
|
|
---
|
|
@@ -83,7 +86,7 @@ The onboard NeoPixel (GPIO 21) shows current activity at a glance:
|
|
|
4. Enter the ESP32's IP address and port **8086**.
|
|
4. Enter the ESP32's IP address and port **8086**.
|
|
|
5. Click **Link → Compile Download** — SigmaStudio pushes firmware to the DSP wirelessly.
|
|
5. Click **Link → Compile Download** — SigmaStudio pushes firmware to the DSP wirelessly.
|
|
|
|
|
|
|
|
-The bridge handles both **direct writes** and **safeload writes** (glitch-free atomic parameter updates on a live DSP).
|
|
|
|
|
|
|
+The bridge handles both **direct writes** and **safeload writes** (glitch-free atomic parameter updates on a live DSP). If the connection drops mid-safeload, any partial pending slots are flushed to parameter RAM on disconnect so the DSP's internal safeload counter is clean for the next session.
|
|
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
@@ -95,7 +98,18 @@ Navigate to `http://<ESP32-IP>/` in any browser:
|
|
|
2. Optionally tick **Verify (CRC32)** to read back and confirm the write.
|
|
2. Optionally tick **Verify (CRC32)** to read back and confirm the write.
|
|
|
3. Click **Upload** — the Magenta LED pulses during the write.
|
|
3. Click **Upload** — the Magenta LED pulses during the write.
|
|
|
|
|
|
|
|
-The 24C256 holds **32 KB**. The DSP reads this EEPROM at power-up via its SELFBOOT pin, allowing standalone operation without the ESP32 actively present.
|
|
|
|
|
|
|
+The 24C256 holds **32 KB**. The DSP reads this EEPROM at power-up via its SELFBOOT pin, allowing standalone operation without the ESP32 actively driving it.
|
|
|
|
|
+
|
|
|
|
|
+---
|
|
|
|
|
+
|
|
|
|
|
+## Firmware Update (OTA)
|
|
|
|
|
+
|
|
|
|
|
+Navigate to `http://<ESP32-IP>/ota` in any browser:
|
|
|
|
|
+
|
|
|
|
|
+1. In Arduino IDE, export the compiled binary: **Sketch → Export Compiled Binary** (produces a `.bin` file).
|
|
|
|
|
+2. Click **Choose File** and select the `.bin`.
|
|
|
|
|
+3. Click **Flash Firmware** — the Cyan LED indicates the write is in progress.
|
|
|
|
|
+4. On success the device reboots automatically. The page waits 5 seconds then redirects back to `/`.
|
|
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
@@ -107,8 +121,9 @@ SigmaTCP is the protocol used by Analog Devices' SigmaStudio to talk to hardware
|
|
|
|
|
|
|
|
**WRITE (opcode 0x09):**
|
|
**WRITE (opcode 0x09):**
|
|
|
- 10-byte header: command, safeload flag, placement, totalLen, chipAddr, dataLen, startAddress
|
|
- 10-byte header: command, safeload flag, placement, totalLen, chipAddr, dataLen, startAddress
|
|
|
|
|
+- `totalLen` is validated against `WRITE_HDR_LEN + dataLen` before buffering — mismatched packets drop the connection
|
|
|
- Payload forwarded to DSP or EEPROM via I²C
|
|
- Payload forwarded to DSP or EEPROM via I²C
|
|
|
-- 4-byte ACK sent back: `{0x09, 0x00, 0x04, status}`
|
|
|
|
|
|
|
+- I²C errors are reported in the 4-byte ACK `{0x09, 0x00, 0x04, status}` so SigmaStudio sees real write failures
|
|
|
|
|
|
|
|
**READ (opcode 0x0A):**
|
|
**READ (opcode 0x0A):**
|
|
|
- 8-byte header: command, totalLen, chipAddr, dataLen, startAddress
|
|
- 8-byte header: command, totalLen, chipAddr, dataLen, startAddress
|
|
@@ -116,11 +131,15 @@ SigmaTCP is the protocol used by Analog Devices' SigmaStudio to talk to hardware
|
|
|
- 6-byte response header (`0x0B, totalLen_hi, totalLen_lo, status, dataLen_hi, dataLen_lo`) + payload sent back
|
|
- 6-byte response header (`0x0B, totalLen_hi, totalLen_lo, status, dataLen_hi, dataLen_lo`) + payload sent back
|
|
|
- On I²C failure, zeros are sent rather than dropping the connection (allows SigmaStudio to probe an unresponsive DSP)
|
|
- On I²C failure, zeros are sent rather than dropping the connection (allows SigmaStudio to probe an unresponsive DSP)
|
|
|
|
|
|
|
|
-**Safeload:**
|
|
|
|
|
-When the safeload flag is set, parameters are queued into the DSP's 5 hardware safeload slots and committed atomically by writing `0x003C` to the Core Register. This avoids audio clicks when updating parameters on a running DSP.
|
|
|
|
|
|
|
+**Safeload:**
|
|
|
|
|
+When the safeload flag is set, parameters are queued into the DSP's 5 hardware safeload slots and committed atomically by writing `0x003C` to the Core Register. This avoids audio clicks when updating parameters on a running DSP. Any pending safeload slots are flushed at both the start and end of every TCP session to keep the DSP's internal counter in sync.
|
|
|
|
|
|
|
|
The TCP receive loop drains all available bytes into a 50 KB buffer every iteration (keeping the TCP receive window open), then processes complete packets from the buffer. This correctly handles large program downloads that span multiple TCP segments.
|
|
The TCP receive loop drains all available bytes into a 50 KB buffer every iteration (keeping the TCP receive window open), then processes complete packets from the buffer. This correctly handles large program downloads that span multiple TCP segments.
|
|
|
|
|
|
|
|
|
|
+### WiFi Watchdog
|
|
|
|
|
+
|
|
|
|
|
+The sketch monitors WiFi status every 5 seconds. If the connection drops it attempts `WiFi.reconnect()` on each check. On recovery it restarts the TCP server socket and updates the LCD with the current IP address.
|
|
|
|
|
+
|
|
|
### EEPROM Writes
|
|
### EEPROM Writes
|
|
|
|
|
|
|
|
Writes are chunked to ≤28 bytes, aligned to 64-byte page boundaries. After each chunk, the firmware polls the EEPROM for ACK (up to 120 ms) to wait for its internal write cycle before continuing.
|
|
Writes are chunked to ≤28 bytes, aligned to 64-byte page boundaries. After each chunk, the firmware polls the EEPROM for ACK (up to 120 ms) to wait for its internal write cycle before continuing.
|
|
@@ -140,7 +159,8 @@ ModulosDSP_101/
|
|
|
├── DSPWriter.cpp I²C write and safeload implementations
|
|
├── DSPWriter.cpp I²C write and safeload implementations
|
|
|
├── DataConversion.h 5.23 fixed-point conversion declarations
|
|
├── DataConversion.h 5.23 fixed-point conversion declarations
|
|
|
├── DataConversion.cpp Fixed-point conversion implementations
|
|
├── DataConversion.cpp Fixed-point conversion implementations
|
|
|
-└── index_html.h Embedded HTML for the EEPROM upload web UI
|
|
|
|
|
|
|
+├── index_html.h Embedded HTML for the EEPROM upload web UI
|
|
|
|
|
+└── ota_html.h Embedded HTML for the OTA firmware update web UI
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
---
|
|
---
|
|
@@ -163,15 +183,9 @@ ModulosDSP_101/
|
|
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
-## Version History
|
|
|
|
|
|
|
+## Build / Version
|
|
|
|
|
|
|
|
-| Version | Notes |
|
|
|
|
|
-|---------|-------|
|
|
|
|
|
-| 1.3.1 | Current stable. `chipAddr 0x01` fix on clean v1.3.0 base |
|
|
|
|
|
-| 1.3.0 | Fixed 6-byte SigmaTCP read response header; added write ACK; I²C read failure returns zeros |
|
|
|
|
|
-| 1.2.0 | Added WS2812 NeoPixel status LED |
|
|
|
|
|
-| 1.1.0 | Buffer overflow checks, explicit `chipAddr` lookup, safeload dataLen validation |
|
|
|
|
|
-| 1.4.0 | (Changelog entry) Block-read TCP receive with per-packet timeout for large program downloads |
|
|
|
|
|
|
|
+The build identifier uses `YYMMDD_rev` format (e.g. `260304_13` = 4 March 2026, revision 13). It is displayed on the LCD and printed to Serial at boot. When cutting a new build, update both the file header comment and the `version` constant in `ModulosDSP_101.ino`.
|
|
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|