- Brace yourself
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0-dev
mkdir ~/proj
cd ~/proj
git clone https://github.com/texane/stlink stlink-repo
cd stlink-repo
make
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0-dev
mkdir ~/proj
cd ~/proj
git clone https://github.com/texane/stlink stlink-repo
cd stlink-repo
make
@Joypacharya I had a similar problem:
EraseFlash - Sector:0x4 Size:0x20000 2020-12-03T13:14:56 INFO common.c: Flash page at addr: 0x08020000 er ased
EraseFlash - Sector:0x5 Size:0x40000 2020-12-03T13:14:58 INFO common.c: Flash page at addr: 0x08040000 er ased
2020-12-03T13:14:58 INFO common.c: Finished erasing 6 pages of 262144 (0x40000) bytes
2020-12-03T13:14:58 INFO common.c: Starting Flash write for F2/F4/F7/L4
2020-12-03T13:14:58 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 32768
2020-12-03T13:14:59 ERROR flash_loader.c: flash loader run error
2020-12-03T13:14:59 ERROR common.c: stlink_flash_loader_run(0x8000000) failed! == -1
stlink_fwrite_flash() == -1
I had the st-link version st-flash 1.6.1-115-g8560f93-dirty
(st-flash --version). I tried to checkout to version 1.6 and it worked!
Steps:
sudo git checkout 6aa08a6
sudo make
I hope this helps!
Because I could not erase the read-only protection bits with st-link, I switched to openocd. It installed fine on RP ( using apt-install ) and works fine: erasing, resetting read-only protection fuses, and flashing an image. Thats all I need.
The GUI version of st-link can reset the protection bits. I could however not find how to do this from the commandline version of st-link. If somebody knows if and how this can be done I would be happy to hear it.