#cortex-m #teensy-4 #arm

no-std teensy4-bsp

Rust-based BSP for the Teensy 4. Part of the teensy4-rs project

16 releases

0.5.0 May 27, 2024
0.4.7 Jan 27, 2024
0.4.6 Dec 26, 2023
0.4.5 Nov 11, 2023
0.1.0 Oct 16, 2020

#163 in Embedded development

Download history 2/week @ 2024-08-18 2/week @ 2024-08-25 20/week @ 2024-09-01 26/week @ 2024-09-08 41/week @ 2024-09-15 85/week @ 2024-09-22 89/week @ 2024-09-29 22/week @ 2024-10-06 9/week @ 2024-10-13 12/week @ 2024-10-20 29/week @ 2024-10-27 10/week @ 2024-11-03 9/week @ 2024-11-17 23/week @ 2024-11-24 51/week @ 2024-12-01

83 downloads per month
Used in 5 crates

MIT/Apache

98KB
1K SLoC

teensy4-rs

A collection of crates for Rust development on the Teensy 4. Supports the following boards:

  • Teensy 4.0
  • Teensy 4.1
  • Teensy MicroMod

Code Checks crates.io docs.rs

API Docs (master)

Dependencies

  • A Rust installation. Install Rust using rustup. We support the latest, stable Rust toolchain.

  • The thumbv7em-none-eabihf Rust target, which may be installed using rustup:

    rustup target add thumbv7em-none-eabihf
    
  • A capable objcopy for transforming Rust binaries into hex files. The documentation and tooling in the project uses the LLVM objcopy provided by cargo-binutils. Install cargo-binutils if you want to precisely follow this documentation.

  • To download programs to your Teensy 4, you'll need either a build of teensy_loader_cli, or the Teensy Loader Application. The latter is available with the Teensyduino add-ons.

Getting started

Use our cargo-generate template, teensy4-rs-template, to bootstrap your own teensy4-rs project based on these libraries:

cargo install cargo-generate
cargo generate --git https://github.com/mciantyre/teensy4-rs-template --name hello-world
cd hello-world
cargo objcopy --release -- -O ihex hello-world.hex

Download hello-world.hex to your Teensy 4!

See the Rust documentation for API information. In particular, study the imxrt-hal APIs, since the BSP forwards many of the HAL's interfaces:

cargo doc --open

Try the various examples in this project's examples directory if you'd like to test your system.

Contributing

We welcome support! A great way to contribute is to start using the crates to develop Teensy 4 applications. Submit an issue to help us identify bugs, feature requests, or documentation gaps. See CONTRIBUTING.md to learn about the best issue tracker for your request.

If you want to directly contribute to the teensy4-rs project, read the development guidance in CONTRIBUTING.md.

Acknowledgements and References

  • The Teensy 4 is wonderful, and that's thanks to the hard work of PJRC and friends. We can find the Teensy code used in the Arduino plugins here. The code greatly influenced this library.
  • The Rust Cortex M team, specifically the cortex-m-rt crate.

License

Licensed under either of

at your option.

Dependencies

~27MB
~723K SLoC