Skip to content

Commit

Permalink
Don't track RP2040 no_flash serial number when rebooting
Browse files Browse the repository at this point in the history
The RP2040 USB serial number is all EEs when running a no_flash binary, which will then change once booted into bootsel mode, so don't track it for the reboot

Fixes #144
  • Loading branch information
will-v-pi committed Sep 18, 2024
1 parent 7e2f756 commit afdfa92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7646,8 +7646,11 @@ int main(int argc, char **argv) {
libusb_get_device_descriptor(to_reboot, &desc);
char ser_str[128];
libusb_get_string_descriptor_ascii(to_reboot_handle, desc.iSerialNumber, (unsigned char*)ser_str, sizeof(ser_str));
settings.ser = ser_str;
fos << "Tracking device serial number " << ser_str << " for reboot\n";
if (strcmp(ser_str, "EEEEEEEEEEEEEEEE") != 0) {
// don't store EEs serial number, as that is an RP2040 running a no_flash binary
settings.ser = ser_str;
fos << "Tracking device serial number " << ser_str << " for reboot\n";
}
}

reboot_device(to_reboot, to_reboot_handle, true, 1);
Expand Down

0 comments on commit afdfa92

Please sign in to comment.