Skip to content

Conversation

Mik3Rizzo
Copy link

This pull request enhances the flexibility of the tool by expanding the supported range for the USB port parameter. The previous limit, which was hardcoded to a maximum of 6, has been updated to accept any value from 0 to 255.

Motivation

The original limitation of 0-6 ports can be restrictive for users with more complex hardware setups, such as those utilizing large or multiple USB hubs.

This modification provides a simple yet effective improvement, making the tool more versatile for a broader range of use cases.

@Mik3Rizzo Mik3Rizzo marked this pull request as ready for review September 16, 2025 10:36
@timg236
Copy link
Collaborator

timg236 commented Sep 16, 2025

The change looks ok, although for interop testing we would only claim to support a direct connection to a Pi or known good (doesn't back-power) powered USB hub on Linux (hubs are problematic in libusb on Windows)

@nbuchwitz
Copy link
Contributor

Wouldn't be the -l argument with the proper usb path a better fit for complexer setups? I use it myself quite often and ir makes it easier as from the path the topology is also clear. But just asking out of curiosity

@timg236
Copy link
Collaborator

timg236 commented Sep 16, 2025

Using a fully qualified path obtained via udev is probably the more robust solution instead of specifying numbers, although the restriction of 0..6 for this old method seems a bit restrictive

@burtyb
Copy link
Contributor

burtyb commented Sep 16, 2025

The port number is the port number on the USB hub it's connected to so additional levels of hub will most likely only have ports 0-6 for 7 port hubs, I don't remember seeing any hubs which actually have more than 7 ports without chaining.

For example on a Raspberry Pi 3B+ port 3 could be the top right USB or bottom left USB port which is why I added the option to set a path like "1-1.3" or "1-1.1.3" which allows these to be differentiated.

@timg236
Copy link
Collaborator

timg236 commented Sep 16, 2025

The port number is the port number on the USB hub it's connected to so additional levels of hub will most likely only have ports 0-6 for 7 port hubs, I don't remember seeing any hubs which actually have more than 7 ports without chaining.

For example on a Raspberry Pi 3B+ port 3 could be the top right USB or bottom left USB port which is why I added the option to set a path like "1-1.3" or "1-1.1.3" which allows these to be differentiated.

Good point. Please can the author describe their hardware setup ?

@Mik3Rizzo
Copy link
Author

Mik3Rizzo commented Sep 16, 2025

Good point. Please can the author describe their hardware setup ?

I'm using the rpiboot from a full tower windows PC that has 9 physical usb ports, but for some reason one of them is seen as USB 10 in the device manager.

Wouldn't be the -l argument with the proper usb path a better fit for complexer setups? I use it myself quite often and ir makes it easier as from the path the topology is also clear. But just asking out of curiosity

Yes, it'd be a good solution.
In my case, I've just opened the device manager on windows and I've seen that my CM4 was on USB 10.

For example on a Raspberry Pi 3B+ port 3 could be the top right USB or bottom left USB port which is why I added the option to set a path like "1-1.3" or "1-1.1.3" which allows these to be differentiated.

On windows I don't know how to obtain the usb path honestly.

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.

4 participants