BLE name: Bluefruit.setName() was given BLE_DEVICE_NAME, which defaults to the
build-time ADVERT_NAME. That only ever seeds a fresh install, so once the whole
test fleet runs one image every board advertises the same string regardless of
`set name`, and a BLE scan cannot tell them apart. Four boards were advertising
"bench-board" simultaneously here -- including the one with the dead radio, which
is precisely the board you least want to mistake for a working one. Now it
advertises the prefs name, with the build constant as the fallback for a node
that has never been named. Prefs are loaded by the_mesh.begin() well before
Bluefruit.begin(), so the name is available.
xiao_uf2_flash.sh, after four rounds of it being not quite foolproof enough:
- takes an explicit target (serial or fleet number 0..4) and refuses to write
to any other board; the earlier version reported x4's port after flashing
x3, which reads exactly like a successful flash of the wrong board
- rejects a file that is not a UF2 (a .hex or .zip dropped on the drive is
ignored by the bootloader and looks like success)
- refuses an image older than firmware.elf, and demands the version stamp
- resolves drives through sysfs by USB serial, never by label -- every drive
is XIAO-SENSE, numbered in plug order
- retries the mount (the automounter loses the race with a fresh drive) and
the version read-back (the port enumerates seconds before the firmware
answers on it). A check that cries wolf is worse than no check.
- proves the flash by reading `ver` off the board and comparing it to the
image, instead of trusting that some XIAO came back on USB
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>