Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 1.84 KB

File metadata and controls

27 lines (23 loc) · 1.84 KB

Bluetooth Receiver Using Rust on NUCLEO-F401RE ARM32 Board

This example showcases how the adafruit-bluefruit-protocol crate can be used with an Adafruit Bluefruit LE UART Friend on an STM32F4 chip. It uses RTIC (Real-Time Interrupt-driven Concurrency) underneath.

The example logs all events (and other messages) using defmt. After the application has started you can connect using the Adafruit smartphone app and send any data packages and they will be printed 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 bluetooth module is connected on USART1 using the following pins (or the code adapted accordingly):

  • TX (of the microcontroller - this is RX for the bluetooth module!) on PB6
  • RX (of the microcontroller - this is TX for the bluetooth module!) on PB10

Prerequisites

  1. Optional: ensure that the rust toolchain is up-to-date: rustup update
  2. Install probe-run: cargo install probe-run
  3. 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.
  4. Install the cross-compile target: rustup target add thumbv7em-none-eabihf
  5. Optional: install the LLVM tools: rustup component add llvm-tools-preview
  6. Install the STLink drivers

Build & Download to Board

  1. Connect the board via USB
  2. Run cargo run (the correct chip & target is already defined in Cargo.toml and .cargo/config)
  3. Enjoy your running program :)