schteve / nucleo-f446re

Rust BSP for Nucleo-F446RE dev board

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crates.io docs.rs

Nucleo-F446RE

A Board Support Package (BSP) for the Nucleo F446RE development board. This board has a few basic features as well as breakout headers for daughter boards such as Arduino shields. It is a starting point to evaluate or develop basic applications for the STM32F446 product line.

This crate intends to be a beginner-friendly way to use this Nucleo board. It handles linker configuration, board initialization, and provides access to implementations of the board's features without needing to directly use a HAL. It may also be helpful as an example for learning embedded Rust with the STM32F446. For advanced applications you likely want to use the stm32f4xx-hal crate directly.

Note: this crate doesn't select the build target for your application. You can do this by copying the .cargo/config.toml to your application, or by setting the target on each build e.g. cargo run --target thumbv7em-none-eabi.

Board features

  • User LED
  • User button
  • Serial port (via the on-board ST-Link)
  • Blocking timer for delays

Examples

There are two main ways to make use of this BSP:

  • Let the BSP perform all board initialization and give you access to the board features. This is the simplest option if you don't have any other hardware connected to your board since the unused PAC peripherals are dropped.
  • You perform the board initialization and then directly instantiate the BSP features you want to use. This lets you control what happens to the rest of the PAC peripherals.

Many examples are provided to illustrate both ways of using the BSP, which can be found in the examples directory. Use a USB cable to connect the Nucleo board's debugger to the host computer, and then run an example with cargo:

cargo run --example blinky

Here, cargo run implicitly makes use of probe-rs to flash, execute, and handle panic and backtrace info. If you prefer GDB and OpenOCD, you can change the behavior of cargo run by editing .cargo/config.toml (basic scripts for GDB and OpenOCD are provided).

Reference material

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Rust BSP for Nucleo-F446RE dev board

License:Apache License 2.0


Languages

Language:Rust 86.9%Language:GDB 10.3%Language:Shell 1.6%Language:RPC 1.3%