MTE 380 Wall Robot Embedded Software
game-day-demo.mp4
Board: Nucleo-F401RE
- User led on PA5
- User button on PC13
- Serial port through ST-LINK on USART2, Tx: PA2 and Rx: PA3
- MPU-6050 3-axis gyroscope and a 3-axis accelerometer
- VL53L1X time-of-flight sensor
- FS5103R Continuous Rotation Servos (x3)
IMPORTANT: If you want to use WSL, you will need to do some additional setup.
-
Install rust.
-
Install probe-run.
-
Install cargo-flash.
-
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.
Flash the program:
cargo flash --chip stm32f401re
Run with defmt debug outputs:
DEFMT_LOG=debug cargo run
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
This method only works in WSL if you have done the additional setup for it.
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
Flash the program:
./mikoto-cargo $DEVICE_PATH flash --chip stm32f401re
Run with defmt debug outputs:
./mikoto-cargo $DEVICE_PATH run
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
- Use
st_nucleo_f4.cfg
if using OpenOCD.
This repository is based on https://github.com/jkristell/nucleo-f401re