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

[WIP] rtic-usb example - demonstrate read/write on the Teensy 4.0 USB and the USB_OTG1 interrupt #66

Closed

Conversation

mitchmindtree
Copy link
Contributor

This is currently not working and the program terminates on usb.init as discussed here. Still, I thought I'd post progress here in case anyone else diving into this would like a head start.

Eventually I hope to come back to this, but my current priority is writing a lib for the TMC2209 motor driver.

@mitchmindtree mitchmindtree marked this pull request as draft July 5, 2020 14:37
@DusterTheFirst
Copy link

I'm really interested in getting this working, do you know where to start or what needs to be changed in the library in order to facilitate this?

@mciantyre
Copy link
Owner

I'm really interested in getting this working, do you know where to start or what needs to be changed in the library in order to facilitate this?

Thanks for your interest! The discussion that Mitch linked (here and here) still holds.

I can think of a few possible approaches, with increasing levels of effort:

  • Remove the USB driver's dependency on SYSTICK. Start by removing or replacing usage of systick_millis_count. Evaluate if we need this timing component for proper USB driver function. Once that C library links and works without any SYSTICK references, we can make the BSP features mutually exclusive. This should let us use USB logging in RTIC.
  • A much bigger leap is to rewrite it in Rust. See USB Support imxrt-rs/imxrt-hal#18 for more information on a Rust USB driver. Tom is just starting to explore this approach if you'd like to contribute there!

@mciantyre
Copy link
Owner

#91 takes the "remove the USB driver's dependency on SYSTICK" approach to provide USB support for RTIC. It uses this PR as a foundation for that work.

@mciantyre mciantyre closed this Dec 26, 2020
bors bot added a commit that referenced this pull request Jan 2, 2021
91: De-couple SysTick and USB; support USB and RTIC r=mciantyre a=mciantyre

The PR separates the USB and SysTick drivers, so we can use USB CDC logging and I/O without running SysTick. Before this PR, the USB driver depended on SysTick for timing a polling loop. With this PR, the USB driver no longer depends on SysTick, and we can use these BSP features independently.

The PR addresses the limitations noted in #66 and #64. Now that we can use USB without SysTick, **we can use the USB module with RTIC**. The PR adds two RTIC examples that use USB for logging and direct CDC I/O.

The PR includes breaking changes throughout the USB interface. These changes should support BSP power-users who want to understand USB read / write events. The changes also make USB peripheral ownership explicit in user programs, and reduce the responsibility of the BSP. See the CHANGELOG for the specific breakages and migration tips.

This PR supersedes #66.

Co-authored-by: mitchmindtree <mitchell.nordine@gmail.com>
Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants