2026 dongle: own firmware for the USB nRF24 stick, wire-free USB flashing

Reverse-engineered the AliExpress "USB_24RF Ver3.1" stick (STM32F030F4P6 +
Si24R1 + AT2401C PA + CH330N) and replaced its closed AT-command firmware so it
can be the PC-side radio for the hexapod.

- Pin map found over SWD and confirmed at runtime: USART1 PA9/PA10 (CH330N),
  SPI1 PA5/6/7, nRF CSN PA3 / CE PA4 / IRQ PA2. LED + AT2401C control are among
  the 5 free pins, still to map.
- Two-stage firmware so wire-free flashing can't be broken by an app update:
  - safeboot (4 KB, pages 0-3): permanent recovery bootloader, fixed-baud flash
    protocol over USB, only it survives every update;
  - app (12 KB, pages 4+): the radio firmware, the only part updates rewrite.
  The app updater never erases safeboot; recovery works even with a dead app.
- tools/dongle_flash.py: one-time install via the STM32 ROM bootloader (the only
  time the BOOT0 wire is used). tools/safeboot_flash.py: wire-free app updates.
- dongle/README.md documents the hardware, pin map, RDP1 (factory fw can't be
  dumped), the memory map and the flashing workflow.
- README: add dongle/ to the layout and the PC-radio plan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 4.8 committed 2026-11-14 23:14:16 +01:00
1 parent 0f9655d646
commit 97f580b6a5
12 files changed
+885 -10

No files matched your search

+9 -10
View File
@@ -16,6 +16,7 @@ remote/ remote firmware: 2 x 3-axis sticks, MPU6050 tilt, Nex
shared/ HexapodProtocol: the CmdPacket wire format + radio settings used by both
sim/ the unchanged robot firmware compiled into a DLL for the simulation
Hexapod_Simulation_Unity/ Unity project that runs that DLL on the 3D model
dongle/ USB nRF24 stick firmware (STM32F030): the PC-side radio, see dongle/README.md
hardware/openscad/ OpenSCAD model of the robot (rebuilt from the Fusion designs) and the new remote
hardware/openscad/stl/ print-ready STL exports
hardware/fusion360/ Fusion 360 designs: body, legs, servo, servo horn, remote case
@@ -78,16 +79,14 @@ Design notes, checks and open points: [hardware/openscad/PLANNING.md](hardware/o
## Planned
- **PC radio link (owner, later):** a USB nRF24L01 stick on the PC (it
probably shows up as a serial port), on the same radio as the robot and the
remote, so Unity on the PC can both receive data from (telemetry) and send
data to the robot and the remote. Not designed yet. To work out:
- what the stick's firmware does: many of these sticks are a USB-serial
chip with a microcontroller set up by AT commands (address, channel, data
rate) that passes raw payloads through; check that it can match
`HXP_RADIO_*` in `shared/HexapodProtocol/HexapodProtocol.h` (channel 96,
250 kbps, 5-byte address `HXPD1`, fixed payload of `sizeof(CmdPacket)`)
and whether it can do auto-ack and ack payloads;
- **PC radio link (owner, later):** a USB nRF24L01 stick on the PC as the
PC-side radio, on the same air settings as the robot and the remote, so Unity
on the PC can both receive data from (telemetry) and send data to the robot
and the remote. The stick is now reverse-engineered and reflashed with our own
firmware (STM32F030 + Si24R1 + AT2401C); it shows up as a COM port and is
updated wire-free over USB. See **[dongle/README.md](dongle/README.md)**. Still
to do:
- map the stick's LED and AT2401C power-amp control pins (app toggles them);
- the radio protocol: today the remote only transmits a `CmdPacket` to the
robot and nothing comes back. Three nodes need an address per node (or
per pipe), a packet type byte, and telemetry back (e.g. as ack payloads