#micro-controller #teensy #bits #programming #collection #utilities #utility

weensy

A collection of useful bits and bobs for programming the Teensy 4.1 microcontroller

3 releases

0.1.2 Oct 22, 2023
0.1.1 Oct 22, 2023
0.1.0 Oct 22, 2023

#804 in Embedded development

GPL-3.0 license

18KB
68 lines

weensy.rs CI/CD Crates.io

A collection of useful bits and bobs for programming the Teensy 4.1 microcontroller using Rust.

NOTE: This package is meant to be used as an extension of teensy4-bsp. It is strongly recommended that you familiarize yourself with that library's API before using this package.

USAGE

This package should be used by an executable crate targetting the Teensy 4.1. The following configuration of cargo is required to build your executable properly:

[build]
target = "thumbv7em-none-eabihf"

[target.thumbv7em-none-eabihf]
rustflags = ["-C", "link-arg=-Tt4link.x"]

This code should be placed in <CRATE_ROOT>/.cargo/config.toml. It can also be passed directly to the cargo command using CLI flags, but this is not recommended because it's clunky.

See cargo's documentation for more details. The t4link.x file will be generated by teensy4-bsp's build.rs file. teensy4-bsp is included by this package, and thus the build script will run when building any crate importing this package. All feature flags for this package's dependencies are re-exported, and enables teensy4-bsp's rt feature by default.

Once this is done, cargo install cargo-binutils and then run the following in the root directory of your executable crate:

cargo objcopy --release -- -o ihex out.hex

You can then flash out.hex to your Teensy board using the Teensy's provided tools.

Dependencies

~27MB
~739K SLoC