Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1.66 KB

README.md

File metadata and controls

26 lines (21 loc) · 1.66 KB

VL53L1X (TOF) Using Rust on NUCLEO-F401RE ARM32 Board

CI

This example showcases how the vl53l1x-uld crate for the VL53L1X TOF can be used on an STM32F4 chip.

The example logs messages using defmt.

The example has been tested on a ST Nucleo-F401RE development board but should work on any STM32F4xx family microcontroller as long as the TOF is connected via I2C1 on pins PB8 (SCL) and PB9 (SDA) and the interrupt is connected on PA0, or the code is adapted accordingly.

Prerequisites

  1. Install Rust
  2. Optional: ensure that the rust toolchain is up-to-date: rustup update
  3. Install probe-run: cargo install probe-run
  4. Install flip-link: cargo install flip-link
    • Note: flip-link is not strictly necessary for this example (it doesn't need stack protection), however it can be considered best practices to include it.
  5. Install the cross-compile target: rustup target add thumbv7em-none-eabihf
  6. Install the STLink drivers

Build & Download to Board

  1. Connect the board via USB
  2. Optional: change your targeted platform in Cargo.toml and .cargo/config (it defaults to STM32F401RE)
  3. Run cargo run
  4. Enjoy your running program :)