-
Notifications
You must be signed in to change notification settings - Fork 1.3k
USB fails to enumerate when CIRCUITPY_USB_HID = 0 #2840
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
Comments
Just to double check, did you do a I tested this on an nRF52840 on Ubuntu 20.04. Tagging @hathach, who may want to know more. |
Yes, the tinyusb module is at a74a823b0a140667a4e4e80fa2678870faba2bd0 committed 30/04 at midnight, although the only updates I see to nrf module in tinyusb in the past month have to do with renaming the irq handler to dcd_init_handler. |
On what kind of host is this, and do you see the same thing on a different OS?
That's a very good question. This is on a Windows machine. It's difficult to move the board between machines, because the power cables are a little fragile. However, I also see errors when I plug it into a Raspberry Pi:
Windows is much pickier when it comes to USB errors, so I could definitely see it issuing a reset when it failed to set the config, which is probably causing hathach/tinyusb#179 So it does seem like I'm getting USB errors on Linux as well as on Windows, they're just more catastrophic on Windows. |
I tried this with a Circuit Playground Bluefruit (nRF52840) on a Dell Intel laptop and a desktop, both running Windows 10, and they seem to be enumerating fine. Both MSC and CDC are working. I then also tried on an RPi, and the logs don't show the errors you have above. I'm not sure why it would be peculiar to the '833. |
Me neither. Maybe it has something to do with v7.0.1 of the SR? I'm still unclear how that factors into it. |
I just tried on a NRF52833-DK EVK board, and I see the same thing. If you have one of these, I can give you instructions on how to reproduce the issue. This is using the Simmel bootloader (https://github.com/simmel-project/bootloader) which shrinks the bootloader partition to 16 kB and removes bluetooth/serial from the bootloader. |
Do you have an nRF52840 board you can try with the same CircuitPython commit? It would have 6.1.1, unless you went to some effort to upgrade the build. I guess you could try rolling the '833 SD back to 6.1.1, since it appeared to work. I agree that I don't see why that should make a difference. I successfully tried with a Feather nRF52840 on Windows too, because the CPB has only a 32MHz crystal. The Feather has both 32kHz and 32MHz, which is more typical. I don't have an '833 dev board but I'll order one. I think @hathach might have one. |
@tannewt said he had one, which is why he said I should create a PR for Simmel. I won't have access to an NRF52840 (specifically a PCA10059) for a few days. |
I have an 833 DK, but I don't see why it could run on 840 but 833. @xobs could you try to flash our stock bootloader on your 833 (best to be DK) with SD 6.1.1 to see if that would works. Since we don't enable SD, it wouldn't be an issue for testing USB with it. Also it is helpful if you could provide bus capture along with tinyusb log as well by changing @dhalbert do we have any printf debug log via RTT SWD now, I can submit an RTT to make getting log from tinyusb easier for future troubleshooting hathach/tinyusb#367 |
I created a PR to circuitpython to add the PCA10100 (aka NRF52833-DK). It uses v6.1.0 You can build it with:
It also exhibits the same issue. |
PR is at #2844 |
This is the output I get from RTT:
And a screenshot of the USB log: It trips the assert fairly quickly, the final SETUP error is due to the assert being triggered which prevents the system from responding. |
If you could upload the datacenter packet log as well, that would be helpful to @hathach. Thanks! I have an nRF52833 DK board arriving in a day or two, and will try to reproduce the problem. |
I'm beginning to think it's not hardware related, but rather to the fact that, in order to save space, I have I think the nRF52833 is a red herring. Setting I'll update the title of this bug. |
Closing this in favor of #2850 now that we understand the issue. |
Beginning with b3b6a64, USB no longer enumerates when using Simmel, based on the nRF52833. Reverting that commit fixes USB.
After doing a
mass_erase
of the internal flash and loading the SD and bootloader, I loadfirmware.uf2
via USB. The device resets itself, attempts enumeration, and a short time later triggers an assert:The text was updated successfully, but these errors were encountered: