Dobrica Pavlinušić's random unstructured stuff
FST-01: Revision 8
* http://www.seeedstudio.com/wiki/FST-01
* https://gitorious.org/gnuk
* http://www.fsij.org/doc-gnuk/index.html

^ SWD flashing using ST Link v2

* http://www.gniibe.org/memo/development/fst-01/dongle/fst-01-swd-connection
* http://no-passwd.net/askbot/question/48/how-can-i-re-flash-fst-01/

Problem:

.pre
dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk/tool$ ./stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
CORE: 0de01477, CHIP_ID: 00000000
Flash ROM read protection: off
Option bytes: 00000000
Core does not halt, try API V2 halt.
ValueError('Status of core is not halt.', 128)
.pre

after several re-runs:

.pre
dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk/tool$ ./stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
CORE: 1ba01477, CHIP_ID: a0036410
Flash ROM read protection: off
Option bytes: a0036410
Core does not halt, try API V2 halt.
ValueError('Status of core is not halt.', 128)
.pre

after a bit of fiddling with cables (it's always cables, right?)

.pre
dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: ON
Option bytes: 03fffffe
The MCU is now stopped.
SUCCESS

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -u
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
Status is 0081
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: ON
Option bytes: 03fffffe
Flash ROM read protection disabled. Reset the board, now.
SUCCESS

# plugin, plugout st-link/v2

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0100 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: off
Option bytes: ffff5aa5
Flash ROM blank check: True
SUCCESS

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -b ../binaries/gnuk/gnuk.bin
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0001 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: off
Option bytes: ffff5aa5
Flash ROM blank check: True
SPI Flash ROM ID: bf254a
WRITE
VERIFY
PROTECT
Flash ROM read protection enabled. Reset the board to enable protection.
SUCCESS

# power cycle

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0100 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: ON
Option bytes: 03fffffe
The MCU is now stopped.
SUCCESS
.pre

plugin just FST-01:

.pre
[ 9890.019368] usb 1-1.6.4: New USB device found, idVendor=234b, idProduct=0000
[ 9890.019372] usb 1-1.6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9890.019374] usb 1-1.6.4: Product: Gnuk Token
[ 9890.019375] usb 1-1.6.4: Manufacturer: Free Software Initiative of Japan
[ 9890.019377] usb 1-1.6.4: SerialNumber: FSIJ-1.0.4-50FF7006
.pre