Commit e46dc7b
authored
tooling(daplink_bridge): Add SWD-based DAPLink flash targets. (#394)
Closes #388.
New Make targets for flashing the DAPLink chip via an external SWD probe:
daplink-bootloader Build stm32f103xb_bl (bootloader, 47 KB at 0x08000000)
daplink-deploy-pyocd Flash interface firmware via SWD (pyocd, no MAINTENANCE)
daplink-deploy-openocd Flash interface firmware via SWD (openocd)
daplink-deploy-bootloader Alias for bootloader-pyocd
daplink-deploy-bootloader-pyocd Flash bootloader via SWD (pyocd)
daplink-deploy-bootloader-openocd Flash bootloader via SWD (openocd)
The OpenOCD sequence mirrors steamicc/DapLink-EasyFlash: ST-Link hla_swd
transport, `stm32f1x unlock 0` before `program verify` so locked chips can
be recovered. pyOCD uses the built-in `stm32f103rc` target (flash-compatible
with the STM32F103CB on the DAPLink chip for the lower 128 KB).
Every SWD target prints a bootstrap warning explaining that a board cannot
reflash its own on-board DAPLink via its own SWD pins — an EXTERNAL probe
is required on the target's SWD header.
CONTRIBUTING.md documents the new targets, the bootstrap constraint, and
the override variables (DAPLINK_OPENOCD_INTERFACE, DAPLINK_OPENOCD_TRANSPORT,
DAPLINK_PYOCD_TARGET) for non-ST-Link probes.
Since daplink-deploy-pyocd and daplink-deploy-openocd now exist, the
short-name deprecation messages for `deploy-pyocd` / `deploy-openocd` are
reverted to the standard DEPRECATED_FIRMWARE form that points to both the
micropython- and daplink- variants. The DEPRECATED_MICROPYTHON_ONLY macro
is removed.
Verified locally:
- make daplink-bootloader → builds stm32f103xb_bl_crc.bin (Start 0x8000000,
Length 0xbc00, CRC32 0x564aa44f)
- make help lists the five new targets
- make -n on each SWD target produces the expected pyocd / openocd command
with the warning prelude and the correct base address
- make lint / make test-mock still pass
Hardware verification pending: flashing with a real ST-Link on a STeaMi
board must be done before merging.1 parent a9df44c commit e46dc7b
3 files changed
Lines changed: 106 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
| 229 | + | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
238 | 248 | | |
239 | 249 | | |
240 | 250 | | |
241 | 251 | | |
242 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
243 | 257 | | |
244 | 258 | | |
245 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 154 | | |
163 | 155 | | |
164 | 156 | | |
| |||
169 | 161 | | |
170 | 162 | | |
171 | 163 | | |
172 | | - | |
| 164 | + | |
173 | 165 | | |
174 | | - | |
| 166 | + | |
175 | 167 | | |
176 | 168 | | |
177 | 169 | | |
| |||
202 | 194 | | |
203 | 195 | | |
204 | 196 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
210 | 232 | | |
211 | 233 | | |
212 | 234 | | |
| |||
248 | 270 | | |
249 | 271 | | |
250 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
251 | 281 | | |
252 | 282 | | |
253 | 283 | | |
| |||
268 | 298 | | |
269 | 299 | | |
270 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
271 | 328 | | |
272 | 329 | | |
273 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
| |||
0 commit comments