Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.88 KB

README.md

File metadata and controls

56 lines (39 loc) · 1.88 KB

teensy4-bsp Examples

This directory contains examples that run on your Teensy 4.0 or Teensy 4.1. It separates examples based on their dependencies:

  • The examples prefixed with rtic_* demonstrate the RTIC framework
  • The examples prefixed with blocking_* demonstrate a basic no_main application that uses blocking APIs.

To understand what each example should do, see the example's documentation at the top of the file.

Build and run examples

Make sure you have all of the build dependencies described in the top-level README.

If you have the teensy_loader_cli command-line loader installed, you may use cargo run to automatically build an example, convert the program, then call the loader to run it on hardware. The example below will build and flash the LED example:

cargo run --release --all-features --example blocking_led --target thumbv7em-none-eabihf

If you don't have the command-line loader installed, follow these steps to build all examples, then program an example of interest.

Build all of the BSP examples for the MCU. When building all examples, enable all features:

cargo build --release --all-features --examples --target thumbv7em-none-eabihf

Convert your example of interest to a HEX file. For instance, to convert the led example, run

rust-objcopy -O ihex target/thumbv7em-none-eabihf/release/examples/blocking_led blocking_led.hex

Finally, load the HEX file onto your board.

More examples

For even more hardware examples, check out the examples in the imxrt-hal project. Nearly all of these examples run on a Teensy 4, and they may demonstrate advanced driver features.

Note that the imxrt-hal project may have a different workflow for building and flashing examples. Consult the project documentation to understand how the workflows differ.