Skip to content

Fix T1000-E application reporting the bootloader's USB product name - #3226

Open
michaeljensen wants to merge 1 commit into
meshcore-dev:devfrom
michaeljensen:fix/t1000e-usb-product
Open

Fix T1000-E application reporting the bootloader's USB product name#3226
michaeljensen wants to merge 1 commit into
meshcore-dev:devfrom
michaeljensen:fix/t1000e-usb-product

Conversation

@michaeljensen

Copy link
Copy Markdown

boards/tracker-t1000-e.json set the application's usb_product to "T1000-E-BOOT". PlatformIO's nordicnrf52 builder turns that key into -DUSB_PRODUCT, which lands in the USB device descriptor, so a running node enumerates as "T1000-E-BOOT" while the Seeed bootloader enumerates as "T1000-E". The firmware that is not the bootloader is the one wearing the bootloader's name.

That misidentification is load-bearing in the web flasher. flasher.meshcore.io calls navigator.serial.requestPort() with no filters, so the row label in the browser's port chooser -- which the browser builds from the USB iProduct string -- is the only signal the user has. The nRF52 flow prompts twice, once for the 1200-baud DFU touch and again for the flash itself, with no re-enumeration watcher in between, and at that second prompt the two candidate rows read:

T1000-E-BOOT (239a:8029) <- the application
T1000-E (2886:0057) <- the actual bootloader

which is backwards at the moment the user has to tell them apart.

The same define is also the Adafruit core's CFG_DEFAULT_NAME, so it is what a companion advertises over BLE whenever the intended name is too long for the GAP device-name attribute and setName() silently fails (#1769). The string is user-visible over Bluetooth as well.

Name the application after the firmware it runs rather than after the board. This deliberately differs from the hardware-name convention in the other nRF52 board files ("WisCore RAK4631 Board", "Seeed Wio Tracker L1") because the string's job here is to distinguish the running application from a bootloader that will never claim to be MeshCore; "Seeed T1000-E" would sit one word away from the bootloader's "T1000-E".

Upload and flashing are unaffected -- PlatformIO's port autodetect matches on hwids (VID:PID), not on this string. On Linux the /dev/serial/by-id symlink does change, from usb-Seeed_Studio_T1000-E-BOOT_-if00 to usb-Seeed_Studio_MeshCore_T1000-E_-if00, so anything pinned to the old path needs updating.

boards/tracker-t1000-e.json set the application's usb_product to
"T1000-E-BOOT". PlatformIO's nordicnrf52 builder turns that key into
-DUSB_PRODUCT, which lands in the USB device descriptor, so a running
node enumerates as "T1000-E-BOOT" while the Seeed bootloader enumerates
as "T1000-E". The firmware that is not the bootloader is the one wearing
the bootloader's name.

That misidentification is load-bearing in the web flasher.
flasher.meshcore.io calls navigator.serial.requestPort() with no filters,
so the row label in the browser's port chooser -- which the browser builds
from the USB iProduct string -- is the only signal the user has. The nRF52
flow prompts twice, once for the 1200-baud DFU touch and again for the
flash itself, with no re-enumeration watcher in between, and at that
second prompt the two candidate rows read:

  T1000-E-BOOT (239a:8029)   <- the application
  T1000-E      (2886:0057)   <- the actual bootloader

which is backwards at the moment the user has to tell them apart.

The same define is also the Adafruit core's CFG_DEFAULT_NAME, so it is
what a companion advertises over BLE whenever the intended name is too
long for the GAP device-name attribute and setName() silently fails
(meshcore-dev#1769). The string is user-visible over Bluetooth as well.

Name the application after the firmware it runs rather than after the
board. This deliberately differs from the hardware-name convention in the
other nRF52 board files ("WisCore RAK4631 Board", "Seeed Wio Tracker L1")
because the string's job here is to distinguish the running application
from a bootloader that will never claim to be MeshCore; "Seeed T1000-E"
would sit one word away from the bootloader's "T1000-E".

Upload and flashing are unaffected -- PlatformIO's port autodetect matches
on hwids (VID:PID), not on this string. On Linux the /dev/serial/by-id
symlink does change, from usb-Seeed_Studio_T1000-E-BOOT_<serial>-if00 to
usb-Seeed_Studio_MeshCore_T1000-E_<serial>-if00, so anything pinned to the
old path needs updating.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant