Skip to content

Bring USB Feature branch into master #9768

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 154 commits into from
Feb 27, 2019

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Feb 19, 2019

Description

Bring feature-hal-spec-usb-device into master.

Pull request type

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

Reviewers

Release Notes

This feature brings USB Device support into Mbed OS from a feature branch. Targets that support USB include the LPC1768, ARCH_PRO, K64F, NUCLEO_F207ZG, NUCLEO_F412ZG, DISCO_F413ZH, NUCLEO_F413ZH, NUCLEO_F429ZI, NUCLEO_F446ZE, NUCLEO_F746ZG, NUCLEO_F756ZG, NUCLEO_F767ZI, DISCO_F469NI, DISCO_F746NG, DISCO_F769NI, DISCO_L475VG_IOT01A, DISCO_L476VG, RZ_A1H, GR_LYCHEE, DISCO_L496AG, NUCLEO_L496ZG, NUCLEO_L4R5ZI. Supported USB device classes include USBAudio, USBHID, USBMouse, USBKeyboard, USBMIDI, USBMSD, USBSerial and USBCDC.

@ciarmcom ciarmcom requested review from a team February 19, 2019 22:01
@ciarmcom
Copy link
Member

@c1728p9, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers @ARMmbed/mbed-os-hal please review.

@juhaylinen
Copy link
Contributor

@c1728p9 Support for USBCDC_ECM class seems to be missing from the PR. Should I add the support here? My original PR #9443

@cmonr
Copy link
Contributor

cmonr commented Feb 20, 2019

@c1728p9 Why is this PR your fork instead of ARMmbed:feature-hal-spec-usb-device

@cmonr
Copy link
Contributor

cmonr commented Feb 20, 2019

Also, any chance of progressing these other PRs coming into the ARMmbed feature branch?
https://github.com/ARMmbed/mbed-os/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+base%3Afeature-hal-spec-usb-device+

@c1728p9
Copy link
Contributor Author

c1728p9 commented Feb 20, 2019

Also, any chance of progressing these other PRs coming into the ARMmbed feature branch?

Both of these need updates. It may be best re-create these PRs against master once this goes in.

@cmonr
Copy link
Contributor

cmonr commented Feb 20, 2019

@ARMmbed/mbed-os-maintainers Note, this is a rebase ARMmbed:feature-hal-spec-usb-device and feature branch merge.

I'm fine with letting this come in asis, and removing ARMmbed:feature-hal-spec-usb-device once it's merged. Thoughts?

@c1728p9
Copy link
Contributor Author

c1728p9 commented Feb 20, 2019

Added SPDX license identifiers and fixed astyle problems.

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

Seems ok to me!

Will there be a future PR to remove the unsupported USB stack? https://github.com/ARMmbed/mbed-os/tree/master/features/unsupported/USBDevice

"""

list = [64, 256]
dev = y
Copy link
Contributor

Choose a reason for hiding this comment

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

Holy smokes, what a host test! 🚢

When you run the `tests-usb_device-basic` test suite on a Linux machine, please make
sure that at least one of the following prerequisites are met:
* using the Linux kernel ***4.17* or newer**,
* using the ***eHCI*** USB driver instead of *xHCI*.
Copy link
Contributor

Choose a reason for hiding this comment

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

@ARMmbed/mbed-os-test FYI

Copy link
Contributor

Choose a reason for hiding this comment

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

@c1728p9 What's the technical reason for this limitation?

Are we expecting devlopers to have to load a specific OS driver to be able to test in Linux?

Copy link
Member

Choose a reason for hiding this comment

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

@c1728p9 What's the technical reason for this limitation?

Basically, an incomplete implementation of xHCI driver in kernels prior to 4.17. Please see the rest of this readme. I've also included some links for reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically, an incomplete implementation of xHCI driver in kernels prior to 4.17. Please see the rest of this readme. I've also included some links for reference.

Damn, those are actually good technical reasons...

Thanks for having them in the readme.

@c1728p9
Copy link
Contributor Author

c1728p9 commented Feb 21, 2019

@ARMmbed/mbed-os-maintainers be aware, USB tests are currently not part of CI. @OPpuolitaival will need to make some infrastructure changes to enable this. The two biggest limitations are:

  • USB tests require that host tests run locally
  • CI needs to have the target USB cables connected

Add the USBPhy and USBPhyEvents abstract classes, the HAL header using
this class and the EndpointResolver utility class.
Copy the USBDevice code out of unsupported and into a top level USB
folder in preparation for development.

squash
Update USB licenses from MIT to Apache 2 and run astyle on the code.
Update the USBDevice class API so it matches mbed-os's naming
conventions, has a more robust API and uses USBPhy as its backend.
Add a USB test and the class USBTester.cpp to go along with it.
Move the LPC17xx USB driver files from
mbed-os\features\unsupported\USBDevice\targets\TARGET_NXP
and update them to match the new USBPhy API.
bcostm and others added 15 commits February 22, 2019 10:53
This function is for USB_OTG_FS devices only. Move it in the correct place (in "#ifdef USB_OTG_FS" area).
Abort all endpoint transfers before running the test again.
Use an updated vendor request to explicitly restart device reads.
Remove mbed.h from USB files and fix the build errors this causes.
This is required to pass CI.
Update the header of all files to use a newer license template which
includes SPDX-License-Identifier.
Add an upper bound to the API version of pyusb.

Co-Authored-By: c1728p9 <[email protected]>
@c1728p9 c1728p9 force-pushed the feature-hal-spec-usb-device branch from 152f9a4 to 0e6056b Compare February 22, 2019 17:16
@c1728p9
Copy link
Contributor Author

c1728p9 commented Feb 22, 2019

Rebased to fix conflicts with requirements.txt changes

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 25, 2019

While reviewing, early CI run now

@mbed-ci
Copy link

mbed-ci commented Feb 25, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@cmonr
Copy link
Contributor

cmonr commented Feb 25, 2019

@fkjagodzinski @jeromecoutant @ARMmbed/mbed-os-core @ARMmbed/mbed-os-hal @ARMmbed/mbed-os-test @bulislaw @donatieng @SenRamakri Please review. This appears to be ready for merge.

@cmonr cmonr added the risk: A label Feb 25, 2019
Copy link
Member

@fkjagodzinski fkjagodzinski left a comment

Choose a reason for hiding this comment

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

Looks good for me 👍

@bulislaw
Copy link
Member

This PR is at risk of missing 5.12 release as it's marked as "needs: review". Code freeze is coming! On Friday 1st. Please review the changes ASAP.

@ARMmbed/mbed-os-hal

1 similar comment
@bulislaw
Copy link
Member

This PR is at risk of missing 5.12 release as it's marked as "needs: review". Code freeze is coming! On Friday 1st. Please review the changes ASAP.

@ARMmbed/mbed-os-hal

@cmonr cmonr merged commit 4b13c8a into ARMmbed:master Feb 27, 2019
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.