Skip to content
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

Bare metal profile: USB class device support #12873

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Apr 27, 2020

Summary of changes

USBCDC_ECM class device uses RTOS thread APIs, so added MBED_CONF_RTOS_PRESENT conditional check to disable that class device in bare metal profile.

Note

Add "drivers-usb" config along with "bare-metal" in mbed_app.json "requires" to enable the USB class devices in bare metal profile as sample config below

{
    "requires": ["bare-metal", "drivers-usb"]
}

Impact of changes

With these changes, except USBCDC_ECM, all the below list of USB class devices can build and works in bare metal profile.

  • USBAudio
  • USBHID
  • USBKeyboard
  • USBMIDI
  • USBMouse
  • USBMouseKeyboard
  • USBMSD
  • USBSerial

Migration actions required

None.

Documentation

Bare metal profile APIs Docs PR


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@evedon @kjbracey-arm


@rajkan01 rajkan01 changed the title Bare metal profile: Disable USBCDC_ECM class device Bare metal profile: USB class device support Apr 27, 2020
0xc0170
0xc0170 previously approved these changes Apr 27, 2020
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Thinking what it would take to make this also run in baremetal, it only creates a thread for event queue dispatch - the only usage of rtos in CDC?

@rajkan01
Copy link
Contributor Author

Thinking what it would take to make this also run in baremetal, it only creates a thread for event queue dispatch - the only usage of rtos in CDC?

You are right, it uses threads for the event queue, but I have limited knowledge on this class device. I will check with @evedon for enabling this CDC_ECM class device in a separate PR.

@mergify mergify bot added the needs: CI label Apr 27, 2020
evedon
evedon previously approved these changes Apr 28, 2020
Copy link
Contributor

@evedon evedon left a comment

Choose a reason for hiding this comment

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

Minor comment but code change okay.

@@ -556,3 +556,4 @@ void USBCDC_ECM::_bulk_out_callback()

read_start(_bulk_out, _bulk_buf, MAX_PACKET_SIZE_BULK);
}
#endif // defined(MBED_CONF_RTOS_PRESENT)
Copy link
Contributor

Choose a reason for hiding this comment

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

Newline missing

Copy link
Contributor

Choose a reason for hiding this comment

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

can you quickly update the file and we restart CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Please restart the CI

@evedon
Copy link
Contributor

evedon commented Apr 28, 2020

Thinking what it would take to make this also run in baremetal, it only creates a thread for event queue dispatch - the only usage of rtos in CDC?

You are right, it uses threads for the event queue, but I have limited knowledge on this class device. I will check with @evedon for enabling this CDC_ECM class device in a separate PR.

Please add a JIRA task in our backlog

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 28, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 28, 2020

Test run: SUCCESS

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

@mergify mergify bot dismissed stale reviews from 0xc0170 and evedon April 28, 2020 15:57

Pull request has been modified.

@rajkan01
Copy link
Contributor Author

Thinking what it would take to make this also run in baremetal, it only creates a thread for event queue dispatch - the only usage of rtos in CDC?

You are right, it uses threads for the event queue, but I have limited knowledge on this class device. I will check with @evedon for enabling this CDC_ECM class device in a separate PR.

Please add a JIRA task in our backlog

Added the JIRA task : https://jira.arm.com/browse/IOTCORE-1578

@mergify mergify bot added needs: CI and removed needs: work labels Apr 29, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 29, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 29, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 2
Build artifacts

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.

None yet

4 participants