ble_dfu.py: a XIAO no longer gets stuck in its bootloader after a failed BLE flash
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d5a4905fb
commit
dc1234a087
2 files changed
+11
-1
No files matched your search
+1
-1
@@ -42,7 +42,7 @@ a different board.
|
||||
| `xiao_uf2_flash.sh` | XIAO nRF52840 through its UF2 drive, to a named board, verified by reading the version back |
|
||||
| `xiao_serial_dfu.sh` | XIAO with a text console over USB serial DFU: no drive, no mount, no root |
|
||||
| `ble_flash_node.sh` | BLE OTA of a node out of reach of a cable, with the checks around it (silence, services, version) |
|
||||
| `ble_dfu.py` | legacy Nordic DFU over BLE for the Adafruit nRF52 bootloader (buttonless, both phases) |
|
||||
| `ble_dfu.py` | legacy Nordic DFU over BLE for the Adafruit nRF52 bootloader (buttonless, both phases). An `AdaDFU` bootloader (XIAO, SenseCap Solar) gets 20 B packets from the start: the legacy DFU takes no bigger ones, and finding out mid-image is too late (the app is already erased, the XIAO then comes back as USB DFU only). Slow (~10 min for 400 kB): for repeated bench swaps use the `-ota` images and `ota_push.py` |
|
||||
| `build_version.py` | PlatformIO pre-script: real version and build time for `ver` |
|
||||
| `pio_lock.py` | library lock for PlatformIO (`platformio.lock`): `install` the locked versions before a build, `check` that nothing else resolved, `freeze` a resolution, `moved` against git |
|
||||
| `bl_sign_pkg.py` | DFU zip for a board with the signed (`SIGNED_FW`) Adafruit bootloader: `adafruit-nrfutil dfu genpkg --key-file` with its two Python 3 bugs on that path fixed |
|
||||
|
||||
@@ -204,6 +204,16 @@ async def phase2_dfu(mac, fw_bin, fw_dat, chunk=None):
|
||||
log(f" bootloader zatím nenalezen (pokus {attempt+1})...")
|
||||
if not dev:
|
||||
raise RuntimeError("bootloader (DFU svc) nenalezen ve scanu")
|
||||
# AdaDFU (XIAO, SenseCap Solar): 20 B packets from the START, not as a retry.
|
||||
# The XIAO bootloader takes no mtu-3 (244 B) packets, and a singlebank DFU
|
||||
# erases the application at START_DFU, so finding that out mid-image is too
|
||||
# late: the retry needs a RESET, which on a XIAO ends DFU mode, and with the
|
||||
# app gone the bootloader comes back as USB DFU only -- no BLE, node stuck
|
||||
# until someone plugs a cable in (x4, 3. 12. 2026). The SenseCap Solar
|
||||
# keeps MTU 23 anyway, so 20 B is what it always got.
|
||||
if chunk is None and (dev.name or "") == "AdaDFU":
|
||||
chunk = 20
|
||||
log(" AdaDFU: posílám po 20 B od začátku (velké pakety XIAO nebere)")
|
||||
async with BleakClient(dev, timeout=30) as c:
|
||||
log(" připojen k bootloaderu:", dev.address, "mtu:", getattr(c, "mtu_size", "?"))
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user