Context
PR #387 added make daplink-firmware / make daplink-deploy-usb to build and update the DAPLink interface firmware via the MAINTENANCE USB volume. This covers the routine update path (no external probe needed).
For bootloader updates and for interface updates without entering MAINTENANCE mode, an external SWD probe is required. These cases are not yet covered by the Makefile.
Background
DAPLink consists of two parts:
| Part |
Address |
Update path |
| Bootloader |
0x08000000 |
External SWD probe only (rarely needed) |
| Interface firmware |
0x08002000 |
MAINTENANCE USB (routine) or external SWD probe |
A board with a working bootloader can update its interface firmware via MAINTENANCE USB without any external hardware. But an external SWD probe (ST-Link, J-Link, or another DAPLink board) can flash either part.
Proposed targets
make daplink-deploy-bootloader # Flash bootloader via SWD probe (default: pyocd)
make daplink-deploy-bootloader-pyocd # Flash bootloader via pyOCD
make daplink-deploy-bootloader-openocd # Flash bootloader via OpenOCD
make daplink-deploy-pyocd # Flash interface firmware via pyOCD (no MAINTENANCE mode)
make daplink-deploy-openocd # Flash interface firmware via OpenOCD (no MAINTENANCE mode)
daplink-deploy-pyocd / daplink-deploy-openocd are useful when:
- Recovering from a bricked interface firmware that prevents MAINTENANCE mode
- Automating CI flashing without manual button press
- Flashing via an external probe attached to the SWD pins (not the on-board DAPLink)
Implementation notes
Addresses
- Bootloader binary:
stm32f103xb_bl_crc.bin at 0x08000000
- Interface firmware:
stm32f103xb_steami32_if_crc.bin at 0x08002000
pyOCD command
pyocd flash -t stm32f103rb --base-address 0x08000000 stm32f103xb_bl_crc.bin
For the interface firmware, the same pattern with --base-address 0x08002000.
OpenOCD command
openocd -f interface/stlink.cfg -c "transport select swd" \
-f target/stm32f1x.cfg \
-c "init; reset halt; stm32f1x unlock 0; reset halt" \
-c "program <bin> verify <address>" \
-c "reset; exit"
Bootstrap problem
A board's own DAPLink cannot reflash itself (the SWD probe cannot reset its own host MCU). For initial flash or recovery via SWD, an external probe is required (not the board's own DAPLink). This must be documented clearly in the help text and CONTRIBUTING.md.
Bootloader build
The DAPLink build also produces stm32f103xb_bl_crc.bin — already available in $(DAPLINK_BUILD_DIR) after make daplink-firmware. No separate build step needed.
Tasks
Related
Context
PR #387 added
make daplink-firmware/make daplink-deploy-usbto build and update the DAPLink interface firmware via the MAINTENANCE USB volume. This covers the routine update path (no external probe needed).For bootloader updates and for interface updates without entering MAINTENANCE mode, an external SWD probe is required. These cases are not yet covered by the Makefile.
Background
DAPLink consists of two parts:
0x080000000x08002000A board with a working bootloader can update its interface firmware via MAINTENANCE USB without any external hardware. But an external SWD probe (ST-Link, J-Link, or another DAPLink board) can flash either part.
Proposed targets
daplink-deploy-pyocd/daplink-deploy-openocdare useful when:Implementation notes
Addresses
stm32f103xb_bl_crc.binat0x08000000stm32f103xb_steami32_if_crc.binat0x08002000pyOCD command
For the interface firmware, the same pattern with
--base-address 0x08002000.OpenOCD command
Bootstrap problem
A board's own DAPLink cannot reflash itself (the SWD probe cannot reset its own host MCU). For initial flash or recovery via SWD, an external probe is required (not the board's own DAPLink). This must be documented clearly in the help text and CONTRIBUTING.md.
Bootloader build
The DAPLink build also produces
stm32f103xb_bl_crc.bin— already available in$(DAPLINK_BUILD_DIR)aftermake daplink-firmware. No separate build step needed.Tasks
daplink-deploy-bootloader(alias todaplink-deploy-bootloader-pyocd)daplink-deploy-bootloader-pyocdanddaplink-deploy-bootloader-openocddaplink-deploy-pyocdanddaplink-deploy-openocdfor interface flash via SWD (no MAINTENANCE mode required)Related