Two methods: SWD (via OpenOCD) or UART (via resmed_flash.py).
Requires the device to be opened with a programmer attached and OpenOCD running.
In the OpenOCD console:
flash_new build/stm32-patched.bin
Takes about 30 seconds. The device reboots automatically.
flash_new stm32.bin
Uses the USART3 accessory port. Requires a serial connection - either a USB-serial adapter with edge connector breakout PCB, or AirBridge over WiFi.
Does not require opening the device.
./python/resmed_flash.py -p /dev/ttyACM0 -f build/stm32-patched.bin
./python/resmed_flash.py -p tcp:airbridge-host -f build/stm32-patched.bin
By default, resmed_flash.py flashes CMX (CCX+CDX combined). To flash only one region:
./python/resmed_flash.py -p /dev/ttyACM0 -f build/stm32-patched.bin --block ccx
./python/resmed_flash.py -p /dev/ttyACM0 -f build/stm32-patched.bin --block cdx
For block description see Firmware regions
./python/resmed_flash.py -p /dev/ttyACM0 -f stm32.bin
The 1MB flash is divided into regions:
| Region | Offset | Size | Content |
|---|---|---|---|
| BLX | 0x00000 | 16 KB | Bootloader |
| CCX | 0x04000 | 240 KB | Configuration (variable descriptors, signal tables, strings) |
| CDX | 0x40000 | 768 KB | Application firmware (therapy algorithms, GUI, drivers) |
| CMX | -- | -- | CCX+CDX combined (used by the flash protocol as a single block) |
All devices within the same firmware version share the same CDX. The CCX determines which features and therapy modes are enabled.