-
Notifications
You must be signed in to change notification settings - Fork 33
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
Teensy 4.1 Support - New Features, Migration Guide #69
Comments
Happy to support Teensy 4.1 here. I have plans to get the hardware, and I can eventually bring the BSP up to parity with the 4.0 implementation. At the moment, I'm not sure what the BSP structure might look like. If we require feature flags, I might recommend that we co-locate shared code in a |
My Teensy 4.1 boards arrived. It boots, and the LED blinks, even on today's Pins 0 through 33 use the same 1062 pads on both boards. After that, the pad mappings diverge. I'm playing with 4.1 support in the Proposed Breaking ChangesBSP PinsYou create either a use teensy4_bsp as bsp;
let peripherals = bsp::Peripherals::take().unwrap();
// Constrain pads to the Teensy 4.1 pins
let pins = bsp::t41::into_pins(peripherals.iomuxc);
// Convert Pin 13 into the LED
let led = bsp::configure_led(pins.p13); At this point, the SYSTICKOne behavior we lose by dropping the custom let core_peripherals = cortex_m::Peripherals::take().unwrap();
let mut systick = bsp::SysTick::new(core_peripherals.SYST); USBAnother thing we lose without a custom bsp::usb::init(&systick, Default::default()).unwrap(); Check out the DiscussionAfter these changes, the BSP crate is responsible for booting the system, re-naming pads to pins, letting you configure SYSTICK (for the USB stack), and exposing the USB stack. There are no BSP-specific De-emphasizing the BSP's Here's some other approaches:
|
73: Prototype Teensy 4.1 support r=mciantyre a=mciantyre The PR demonstrates how we could support both Teensy 4.0 and 4.1 boards from a single BSP. This has breaking changes. See #69 for details. This work is based on the `iomuxc-integration` branch. To keep the diff relevant, this PR target that branch. Co-authored-by: Ian McIntyre <[email protected]>
73: Prototype Teensy 4.1 support r=mciantyre a=mciantyre The PR demonstrates how we could support both Teensy 4.0 and 4.1 boards from a single BSP. This has breaking changes. See #69 for details. This work is based on the `iomuxc-integration` branch. To keep the diff relevant, this PR target that branch. Co-authored-by: Ian McIntyre <[email protected]>
Merged these ideas in #73. If anyone has suggestions for improvements, open a PR! |
For anyone looking to migrate existing code to the new API, see the above post, specifically the "Proposed Breaking Changes." The feature builds on 0.4.0 of the |
We have a Teensy 4.1 board on the way that we'd like to start testing soon and ultimately use alongside teensy4-rs!
What are your thoughts on adding support into the bsp crate? I imagine this might involve splitting some of the crate into
v40
andv41
modules (or something along these lines), e.g.Pins
will likely be entirely different between both boards, only the 4.1 exposes the ethernet interface, etc.The text was updated successfully, but these errors were encountered: