[Gnuk-users] Did I brick my fst-01?

micah micah at riseup.net
Wed Feb 4 04:25:43 UTC 2015


NIIBE Yutaka <gniibe at fsij.org> writes:

> I don't think your FST-01 is bricked.  I guess that you probably
> flashed wrong image.
>
> On 02/03/2015 12:00 PM, micah wrote:
>> there must be better connectors that can be used for this!
>
> I agree.  In future, when I will visit China, I will ask their
> recommendation as a manufacturer on site.

Great!

>> muck# ./tool/stlinkv2.py -u
>> 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
>> Flash ROM read protection disabled.  Reset the board, now.
>> SUCCESS
> [...]
>> muck# ./tool/stlinkv2.py src/build/gnuk.bin 
>> 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
>> SPI Flash ROM ID: bf254a
>> WRITE
>> VERIFY
>> PROTECT
>> Flash ROM read protection enabled.  Reset the board to enable protection.
>> SUCCESS
>
> It looks no problem.
>
>> I then unplugged everything and then plugged in the fst-01 alone, but no
>> blue light and nothing in the journal, or in lsusb.
>
> How did you build the gnuk.bin?
>
> Most possible case would be some configuration error.  In Gnuk 1.0.x
> and 1.1.n (0 <= n <= 3), default target is Olimex STM32 H103.  You
> need to explicitly specify FST-01 for those versions.  Since Gnuk
> 1.1.4, its default is FST-01.

./configure --vidpid=234b:0000 --enable-keygen
make

>> muck# ./tool/stlinkv2.py -s
>> ST-Link/V2 version info: 2 17 4
>> Change ST-Link/V2 mode 0100 -> 0001
>> CORE: 00000000, 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)
>> 
>> I quadruple checked the wires, and tried a number of different times,
>> but I still receive the above message.
>
> It seems that there were some connection error(s).  If not physical,
> it would be protocol-wise.  But, in most of my cases, it was physical.
>
> We should see something like:
>
> 	CORE: 1ba01477, CHIP_ID: 20036410
>
> even if the core of MCU did not halt.  Under some unstable physical
> connection, still, we could see like:
>
> 	CORE: 1ba01477, CHIP_ID: 00000000
>
> I mean, it can detect the ID of core correctly.

Yeah, it doesn't appear to be detecting the core. When I plug-in the
stlink, there are no lights, either on the stlink, or on the fst. When I
do the tool/stlinkv2.py -s, the red light on the stlink device comes on,
but nothing on the fst.

> Another thing would be using OpenOCD.  stlinkv2.py is a work of
> reverse engineering.  There are another independent work in OpenOCD.
> If it's protocol thing which caused an error, another implementation
> to access ST-Link/V2 helps.
>
>
> I sometimes access FST-01 by ST-Link/V2 with OpenOCD.  Nowadays, it's
> version is 0.8.0 (in Debian jessie).

I have 0.8.0-4, from sid.

> $ openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init; reset halt; shutdown"

if I do this, I see:

# openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x_stlink.cfg -c "init; reset halt; shutdown" 
Open On-Chip Debugger 0.8.0 (2014-10-20-21:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.528299
Error: init mode failed
in procedure 'transport'
in procedure 'init'

I tried the version that is in experimental, this is what it reported:

# openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x_stlink.cfg -c "init; reset halt; shutdown"
Open On-Chip Debugger 0.9.0-dev-snapshot (2014-08-31-11:44)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
WARNING: target/stm32f1x_stlink.cfg is deprecated, please switch to target/stm32f1x.cfg
Error: session's transport is not selected.
Info : session transport was not selected, defaulting to JTAG
Error: Debug adapter doesn't support 'jtag' transport
Runtime Error: embedded:startup.tcl:20: 
in procedure 'script' 
at file "embedded:startup.tcl", line 58
at file "/usr/share/openocd/scripts/target/stm32f1x_stlink.cfg", line 2
at file "/usr/share/openocd/scripts/target/stm32f1x.cfg", line 6
in procedure 'transport' called at file "/usr/share/openocd/scripts/target/swj-dp.tcl", line 23
in procedure 'ocd_bouncer' 
at file "embedded:startup.tcl", line 20

because it said that cfg was deprecated, I tried the one it suggested:

# openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "init; reset halt; shutdown" 
Open On-Chip Debugger 0.9.0-dev-snapshot (2014-08-31-11:44)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Error: session's transport is not selected.
Info : session transport was not selected, defaulting to JTAG
Error: Debug adapter doesn't support 'jtag' transport
Runtime Error: embedded:startup.tcl:20: 
in procedure 'script' 
at file "embedded:startup.tcl", line 58
at file "/usr/share/openocd/scripts/target/stm32f1x.cfg", line 6
in procedure 'transport' called at file "/usr/share/openocd/scripts/target/swj-dp.tcl", line 23
in procedure 'ocd_bouncer' 
at file "embedded:startup.tcl", line 20



More information about the gnuk-users mailing list