rp2: Many files at the board may block USB registration. #10376
Unanswered
robert-hh
asked this question in
RP2040 / Pico
Replies: 1 comment 1 reply
-
For anyone who comes across this, it should now be fixed thanks to #10423. (Thanks @robert-hh !) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It may be a bug or just bad habit: I encounter now for a long time that RP2040 boards would not register as USB device when connected to a USB hub. When connected directly to the PC, it works fine. Now I noticed, that this behavior correlates with the number of files in the root file system of the board. At my board, it were about 100. LFS2 is pretty slow in reading the file list and therefore it takes a while to scan these files when importing a file. So when the main.py imported a script at boot time, the board seemed to be busy scanning the file system, and USB registration failed.
Adding a delay of 1 second before importing changed the behavior, and for scripts imported as frozen bytecode changing the path order helps as well.
I did not see this behavior with other boards, but maybe there were not enough files in the file system. And since that does not happen when connected to the PC, it may as well be a problem of the USB hub not trying long enough to connect.
Beta Was this translation helpful? Give feedback.
All reactions