Add support for rebooting debugprobes, and list command#350
Conversation
Will work with the current master branch, and the next firmware release
| + option("--debugprobe").set(settings.target_debugprobe) % "Force a DebugProbe device version >2.3.1 to reset so the command can be executed. After executing the command (unless the command itself is a 'reboot') the device will be rebooted back to application mode" | ||
| + option('f', "--force").set(settings.force) % "Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the command (unless the command itself is a 'reboot') the device will be rebooted back to application mode" + | ||
| option('F', "--force-no-reboot").set(settings.force_no_reboot) % "Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the command (unless the command itself is a 'reboot') the device will be left connected and accessible to picotool, but without the USB drive mounted" | ||
| + option("--only-force").set(settings.only_force) % "Same as --force, but will only target devices not currently in BOOTSEL mode" |
There was a problem hiding this comment.
Hmmm? The help-text for --force says "Force a device not in BOOTSEL mode..."
There was a problem hiding this comment.
Yes, but -f will disengage if it detects a device in BOOTSEL mode and use that instead - this allows always passing -f to commands, and they will work if the device is running or in BOOTSEL mode
This new option ignores devices already in BOOTSEL mode
There was a problem hiding this comment.
Hmmm, so I guess this is effectively --force-but-ignore-bootsel? 😉
I'm not sure that the --only-force name makes it clear what this is doing, so I'll have a ponder... 🤔
As a start, perhaps the help-text ought to be changed to "Same as --force, but will ignore devices in BOOTSEL mode" ?
There was a problem hiding this comment.
I've reworded it - maybe --force-ignore-bootsel for the option, but that feels too long?
| " appears to be an RP-series DebugProbe device not in BOOTSEL mode, but with a USB reset interface, so consider --debugprobe to force reboot it in order to run the command."); | ||
| if (settings.target_debugprobe) { | ||
| printer(dr_vidpid_debugprobe_no_reset, | ||
| " appears to be an RP-series DebugProbe device not in BOOTSEL mode, but it does not have a USB reset interface so must be manually entered into BOOTSEL mode."); |
There was a problem hiding this comment.
I'm not sure if the "must be manually entered into BOOTSEL mode" phrasing here sounds correct 😕 But the best alternative I could come up with is "must be manually put into BOOTSEL mode".
There was a problem hiding this comment.
This phrasing is used in a few places, so I just copied it here - I can change them all to “manually put into” if that is clearer
There was a problem hiding this comment.
I think it is clearer, but perhaps @JeuneseRPi can offer a second opinion?
| --rp2040 | ||
| Assume the device is an RP2040 - this is only required when using a custom vid/pid | ||
| with an RP2040 on Windows, and is ignored on other operating systems | ||
| --debugprobe |
There was a problem hiding this comment.
I guess that once #342 has been merged, these --debugprobe and --only-force help sections will become part of the device-selection help topic?
There was a problem hiding this comment.
Yep, that was part of my reason for doing the topics, because I knew I wanted to add the debugprobe argument
Also apply suggestions from code review
chip_name (RP-series, RP2040 or RP2350) is printed at the start of the line anyway by bus_device_string Also reword some of the strings, so all strings explain how to put the device into BOOTSEL mode
Uses the
--debugprobeargument, to explicitly target only running debugprobes, and ignore any BOOTSEL devicesWill work with the current master branch, and the next firmware release
Also refactors the usb reset support to be clearer what is going on, and add
--serfiltering for custom vid/pid which was missingAlso adds
--only-forceargument for the same behaviour, in case that functionality is usefulAlso adds
picotool listcommand, which just prints the no device found help text, including BOOTSEL devices