From 7b471948b4d4057a6eb64f0892eeb320c7885854 Mon Sep 17 00:00:00 2001 From: Deon Spengler Date: Sat, 30 Jul 2022 12:55:04 +0200 Subject: [PATCH] How to reflash st-link --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e8b8063..1e7d0bf 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,23 @@ stm32f1x lock 0 reset halt ``` +How to reflash the ST-LINK +========================== +To reflash the ST-LINK, connect the device to a programmer as before while keeping pins 7 and 8 shorted. While the LED is blinking, run openocd. Once it’s running (i.e. it doesn’t show any errors), you can unshort the pins. + +Then use the following to unlock and reflash. +``` +reset halt +stm32f1x unlock 0 +reset halt +stm32f1x mass_erase 0 +flash write_bank 0 ./build/gnuk.bin 0 +stm32f1x lock 0 +reset halt +``` + +***Note: That reprograming will wipe the flash memory and you will lose all key's that was on the device.*** + Testing Gnuk ============ Type following command to see if GnuPG detects the Gnuk token.