-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Hi everyone,
I'm trying to run a simple blinky.rs code on the nucleo-f446re (with stm32f446re chip) using the following commands
cargo run --bin blinky.rs --release
The first time, the cde flashes fine. However, if I try this command a second time, my board shows this error:

The error indicates that the board is locked.
Although I have 2 work arounds, it is still frustrating the board gets locked everytime I use cargo to flash my code.
To reproduce:
- Connect NUCLEO board to the computer and ensure the computer can detect it
- Flash the board using
cargo run --bin blinky.rs --release
- Unplug NUCLEO board
- PLug In NUCLEO board
- Attempt to flash again with
cargo run --bin blinky.rs --release
Workaround 1
- If OpenOCD is not installed, then enter this command:
sudo apt -y update sudo apt -y install openocd
- Copy the reset.txt and change the extension from .txt to .cfg
- Enter this command:
openocd -f <path to reset.cfg file>/reset.cfg
. - If no errors occur, then try
cargo run --bin blinky.rs --release
again, it should work this time
Note: If at Step 3, there are errors, this workaround will not work as the board is deeply locked. At that point, switch to workaround 2
Workaround 2
- On the Nucleo board, connect the BOOT0 pin to the 3V3 pin
- Press the RESET button (black button)
- Enter this command
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg
ypearson
Metadata
Metadata
Assignees
Labels
No labels