Skip to content

nRF52840 USB Device Implementation #10689

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

Merged
merged 42 commits into from
Jun 18, 2019

Conversation

AGlass0fMilk
Copy link
Member

Description

Implemented USBPhy on the Nordic nRF52840 target.

  • Added legacy driver files (nrf_drv_usbd.*)
  • Pulled in new errata fixes and driver changes from Nordic SDK version 15.3
  • Added implementation code for the USBPhy in usb/device/targets/TARGET_NORDIC/...

Extensive testing has been done and the basic USB test suite has passed hundreds of times. Admittedly, I have only been building with the GCC_ARM toolchain.

See comments on #7674 for test results

See original PR here: https://github.com/TacoGrandeTX/mbed-os/pull/10
This is a rebased version of this PR here: #10457
This is a rebased version (after SDK15 changes were pulled into master) of this PR here: #10526

Pull request type

[ ] Fix
[ ] Refactor
[ X ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@0xc0170
@c1728p9

…c EP0STATUS task triggering at end of DMA transfer
…aring the Nordic HW for the status stage of a control transfer would sometimes cause the HW to automatically ACK an "invalid" command during the control stall test. This would cause the test to fail (because an invalid request was not stalled).
…bort would not be called on ISO endpoints (this currently causes an ASSERT in the Nordic driver
…ndpoints in nordic driver to prevent an ASSERT when it is called on ISO endpoints
…hanges to fail. Endpoints were not being removed properly in the Nordic driver
…terrupt. Not entirely sure this is appropriate.
…le and then reenable when USBPhyHw::endpoint_unhalt() is called.
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 13, 2019

This should get into 5.13.1 (will reschedule CI once rc3 completes) . I reached out to @maciejbocianski to get review complete but should not block this any longer

@maciejbocianski
Copy link
Contributor

maciejbocianski commented Jun 13, 2019

@AGlass0fMilk
I failed running USB tests on nRF52840-Preview-DK, all hanged at the beginning.
Is this preview version supported or maybe special board setup is required?

@AGlass0fMilk
Copy link
Member Author

@maciejbocianski The preview DK chips have so many USB-related errata that one Nordic employee said:
nordic-usb-quote

Can you try the tests on a production-quality nRF52840 DK?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 13, 2019

CI started

@maciejbocianski
Copy link
Contributor

@AGlass0fMilk
Yeah, I will try tomorrow

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2019

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 14, 2019

There's fix proposed in #10833, will restart CI after

@maciejbocianski
Copy link
Contributor

Unfortunately I don't have access to non-Preview version of the board to run the tests

@40Grit
Copy link

40Grit commented Jun 14, 2019

@maciejbocianski

We can probably get one sent to you.
Contact @AGlass0fMilk and I at our @embeddedPlanet.com emails

See @Loverdeg for my email.

@40Grit
Copy link

40Grit commented Jun 14, 2019

Correction @loverdeg-ep for my email

Copy link
Contributor

@maciejbocianski maciejbocianski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just wonder how to prevent running the USB stuff on nRF52840-Preview-DK board

@0Grit
Copy link

0Grit commented Jun 14, 2019

We literally destroyed all our PDK's. That solved most of our problems.

@0Grit
Copy link

0Grit commented Jun 14, 2019

Yes. In case that did not come through; I recommend anybody who reads this to destroy your NRF52840-PDK. Preview Development Kit

QSPI is irreparably broken, USB as well, among many other erratas.

Don't let somebody suffer by letting them borrow it or by giving it to them.

Literally snap it in half or sledge it and recycle it at an appropriate facility.

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 15, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@adbridge
Copy link
Contributor

Lots of random failures over the weekend. Restarting CI.

@mbed-ci
Copy link

mbed-ci commented Jun 17, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@AGlass0fMilk
Copy link
Member Author

@adbridge I'm having trouble viewing the details of why the greentea test failed. Is there any way the logs can be made public?

@adbridge
Copy link
Contributor

@AGlass0fMilk the current failures we think are internal to the CI. A fix has been applied and we are waiting to see if it has fixed things. If it has then I will restart the tests on here.

@0Grit
Copy link

0Grit commented Jun 17, 2019

@AGlass0fMilk Sounds like we need to make an issue for publication of the tests.
There are some discussions about this in issues/docs of this repository but also in the handbook.

@adbridge adbridge merged commit 07f1e06 into ARMmbed:master Jun 18, 2019
@AGlass0fMilk
Copy link
Member Author

Hooray! Resolves #7674

@trowbridgec
Copy link

trowbridgec commented Jul 5, 2019

I found an issue when updating to mbed-os-5.13.0 with an nRF52840 where the UART's RX didn't work (TX worked fine as I was getting debug data out of the board).

Initially, I updated to mbed-os-5.13.1 (we saw a tag for mbed-os-5.13.1 in our locally mirrored copy of mbed-os), and that seemed to fix the issue. I also tried using master, and the issue is fixed there as well.

After some troubleshooting, it turned out that cherry picking the commits from this PR re-enabled the UART RX.

@adbridge @0xc0170 @maclobdell

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 8, 2019

5.13.1 will be release in a week so should have the fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants