Skip to content

cameronkinsella/mikoto-bot

Repository files navigation

Mikoto Bot

MTE 380 Wall Robot Embedded Software

game-day-demo.mp4

Hardware

Board: Nucleo-F401RE

Board properties

  • User led on PA5
  • User button on PC13
  • Serial port through ST-LINK on USART2, Tx: PA2 and Rx: PA3

External Sensors and Actuators

  • MPU-6050 3-axis gyroscope and a 3-axis accelerometer
  • VL53L1X time-of-flight sensor
  • FS5103R Continuous Rotation Servos (x3)

Usage: Local Environment

IMPORTANT: If you want to use WSL, you will need to do some additional setup.

Prerequisites

  1. Install rust.

  2. Install probe-run.

  3. Install cargo-flash.

  4. Add the cross compilation target: rustup target add thumbv7em-none-eabihf

    If you're using a different board then your required target may be different. List of ARM Cortex targets.

Run the main binary

Flash the program:

cargo flash --chip stm32f401re

Run with defmt debug outputs:

DEFMT_LOG=debug cargo run

Run an example

Flash the program:

cargo flash --chip stm32f401re --example button-rtic

Run with defmt debug outputs:

DEFMT_LOG=debug cargo run --example button-interrupt

If probe fails to flash your board you probably need to update the firmware on the onboard programmer. The updater can be found at: https://www.st.com/en/development-tools/stsw-link007.html

Usage: Docker (Linux/WSL)

This method only works in WSL if you have done the additional setup for it.

Find the path to your board's USB device

On Ubuntu (WSL):

export DEVICE_PATH=$(lsusb | grep ST-LINK | awk '{ print "/dev/bus/usb/" $2 "/" substr($4, 1, length($2))}')
$ echo $DEVICE_PATH
/dev/bus/usb/001/002

Run the main binary

Flash the program:

./mikoto-cargo $DEVICE_PATH flash --chip stm32f401re

Run with defmt debug outputs:

./mikoto-cargo $DEVICE_PATH run

Run an example

Flash the program:

./mikoto-cargo $DEVICE_PATH flash --chip stm32f401re --example button-rtic

Run with defmt debug outputs:

./mikoto-cargo $DEVICE_PATH run --example button-interrupt

Debugging

  • Use st_nucleo_f4.cfg if using OpenOCD.

This repository is based on https://github.com/jkristell/nucleo-f401re

About

MTE 380 Wall Robot Embedded Software

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published