-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to access device using stdio_usb #23
Conversation
If I use the |
Good point; |
When you've got multiple RP2040 devices plugged in at once (and so you need to use the Also, I wonder if a And finally (for now) it would be nice if picotool was able to tell the difference between a "RP2040 device with a USB serial connection" where the reset vendor interface is active (so the |
Yes, this is a (known) problem... sadly libusb on Windows does not support the good way to handle this (i.e. the ability to watch for devices appearing/disappearing)
We do not want to throw the baby out with the bath water. The single Pico case is likely to be common and an integrated We should try to improve the multiple Pico case in the future (we can probably do a diff of the set of USB descriptors to figure out which device was rebooted in the majority of cases)
That seems reasonable
All of this should be discussed in a separate issue |
For cross-linking purposes: I believe this fixes both #13 and #14 and links to raspberrypi/pico-sdk#197 |
I'm seeing this behaviour (on Linux), not sure if it's explained by picotool not waiting long enough between issuing the 'reset' command and querying the 'info' ? (this with only a single Pico, plugged directly into my laptop)
Just to be clear, I think it's the "No accessible RP2040 devices in BOOTSEL mode were found." that isn't quite right - it should instead be displaying the "Program Information" that a subsequent call to |
yes, i bet that is it |
bf829f2
to
1f833f3
Compare
I'm still seeing this behaviour on Linux - your previous reply implied this might be changing? |
If a Pico is in BOOTSEL mode, and I run EDIT: on Linux x64 |
can you include platform you are running on with the issues |
Dunno if it's deliberate behaviour or not, but on Linux when I run |
On Windows, if I run Ahh, same behaviour on Linux too. |
will fix this |
The Mac build seems to be broken again? 😕
|
On Linux x64, the "info <filename>" seems to be broken?
it just hangs (doesn't do anything), and when I Ctrl-C I get |
On Linux x64, if I do
it now reports:
The first line is good, the second line is bad 😉 But I can confirm the "ignore -f / -F flag if specified but not needed" issue seems to have been fixed 🎉 Hmmm, if I do multiple
in a row, it sometimes works with no error message, but sometimes it prints Doing multiple
or
in a row always seems to work with no errors reported. 👍 I dunno if it's worth "fixing", but these commands work:
but
reports:
and
reports:
|
(Testing on a Pi400, but I wouldn't expect other platforms to behave differently...) There seems to be an odd interaction between
Note how the |
yeah, good catch, the main issue is that |
I built and tested the latest version this afternoon on Linux x64, Raspberry Pi OS (on a Pi400), Windows 10 x64 and MacOS Catalina x64. Apart from my "little catches" mentioned earlier, it all seems to work pretty well 👍 (with the obvious difference that it's only the 'reboot' command on Windows which accepts a 'force' flag) However I do wonder if it wouldn't be simpler / more consistent to simply make:
behave the same (on Linux and Mac) as |
Oh, and I always need to apply the change from #27 before I'm able to build on Windows. |
yeah this is my preferred behavior... |
i'm not 100% convinced that it is a good general fix, but i have included it (here now), because it is probably not worse than what was there. |
I made a bunch of subtle changes to the wording of messages, so hopefully things make more sense now. If does seem possible to get the Ubuntu USB stack confused (apparently) in so far as the device can be back in USBBOOT mode, but the OS still thinks it is connected with CDC available. (This seems to be the cause of -f saying it is rebooting, then the device not being found anyway... i have made the error messages better in this eventuality) |
Running the latest version on x64 Linux, I get this sequence of commands: $ ./picotool info
No accessible RP2040 devices in BOOTSEL mode were found.
but:
Device at bus 3, address 46 appears to be a RP2040 device with a USB serial
connection, so consider -f (or -F) to force reboot in order to run the
command.
$ ./picotool info -F
ERROR: Unable to access device to reboot it; Use sudo or setup a udev rule
$ sudo ./picotool info -F
The device was asked to reboot into BOOTSEL mode so the command can be executed.
Program Information
name: hello_usb
web site: https://github.com/raspberrypi/pico-examples/tree/HEAD/hello_world/usb
features: USB stdin / stdout
The device has been left accessible, but without the drive mounted;
use 'picotool reboot' to reboot into regular BOOTSEL mode or
application mode.
$ ./picotool info
No accessible RP2040 devices in BOOTSEL mode were found.
but:
Device at bus 3, address 49 appears to be a RP2040 device in BOOTSEL mode, but
picotool was unable to connect
$ sudo ./picotool info
Program Information
name: hello_usb
web site: https://github.com/raspberrypi/pico-examples/tree/HEAD/hello_world/usb
features: USB stdin / stdout Would it perhaps make sense to also display the "Use sudo or setup a udev rule" message as part of the "Device at bus 3, address 49 appears to be a RP2040 device in BOOTSEL mode, but picotool was unable to connect" output in the penultimate command above? |
This appears to be fixed now 👍 (both |
That's fair enough. However there's part of me that wonders if, for the sake of symmetry, there ought to be a dedicated flag to the reboot command (e.g. |
Another minor-nitpick thing; in the output of
Looks a bit odd that sometimes the command-options are listed before the |
Perhaps it shouldn't mention |
this i don't care about - we might support it in the future |
Not that it matters, but any idea why an out-of-the-box build creates a I can confirm that as long as the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like this has been discussed to death and LGTM so approving
No description provided.