cancel
Showing results for 
Search instead for 
Did you mean: 

Problems getting sd-link to flash - STM32746G-DISCO_Demo_V1.1.0.hex

peterh.m.brooks9
Associate
Posted on July 18, 2016 at 14:39

I'm having problems getting sd-link to flash. I've no tried it on linux, a mac, and a Raspberry Pi. The Raspberry Pi at least manages to read it!

I'd just like to flash the demo S

TM32746G-DISCO_Demo_V1.1.0.hex correctly - once that works, I'm hoping flashing embedded code will be easy!

What am I doing wrong?

I've got the link up:

st-util

2016-07-18T14:14:21 INFO src/common.c: Loading device parameters....

2016-07-18T14:14:21 INFO src/common.c: Device connected is: F7 device, id 0x10016449

2016-07-18T14:14:21 INFO src/common.c: SRAM size: 0x50000 bytes (320 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 2048 bytes

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: Chip ID is 00000449, Core ID is  5ba02477.

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: Chip clidr: 09000003, I-Cache: off, D-Cache: off

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c:  cache: LoUU: 1, LoC: 1, LoUIS: 0

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c:  cache: ctr: 8303c003, DminLine: 32 bytes, IminLine: 32 bytes

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: D-Cache L0: 2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: f003e019 LineSize: 8, ways: 4, sets: 32 (width: 10)

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: I-Cache L0: 2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: f007e009 LineSize: 8, ways: 2, sets: 64 (width: 11)

2016-07-18T14:14:21 INFO src/gdbserver/gdb-server.c: Listening at *:4242...

I get these errors from st-info:

st-info --chipid

[!] send_recv send request failed: LIBUSB_ERROR_IO

[!] send_recv STLINK_GET_CURRENT_MODE

[!] send_recv send request failed: LIBUSB_ERROR_IO

[!] send_recv STLINK_GET_CURRENT_MODE

[!] send_recv send request failed: LIBUSB_ERROR_IO

[!] send_recv STLINK_DEBUG_ENTER

0x0000

[!] send_recv send request failed: LIBUSB_ERROR_IO

[!] send_recv STLINK_JTAG_WRITEDEBUG_32BIT

Which doesn't look good.

I seem to be able to read from flash memory, but not write to it:

$st-flash read out.bin 0x8000000 1048576

2016-07-18T14:37:28 INFO src/common.c: Loading device parameters....

2016-07-18T14:37:28 INFO src/common.c: Device connected is: F7 device, id 0x10016449

2016-07-18T14:37:28 INFO src/common.c: SRAM size: 0x50000 bytes (320 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 2048 bytes

$/media/Ada/stlink.git♯ st-flash write out.bin 0x8000000 1048576

2016-07-18T14:37:48 WARN src/sg.c: Failed to find an stlink v1 by VID:PID

2016-07-18T14:37:48 ERROR src/sg.c: Could not open stlink device

Any suggestions?

#programming #problem #flash #stm32746g-discovery
6 REPLIES 6
AvaTar
Lead
Posted on July 18, 2016 at 15:42

> I've no tried it ...

I assume you mean ''no

w

tried it ...'' - would have a significant influence on the meaning.

> I've no tried it on linux, a mac, and a Raspberry Pi. The Raspberry Pi at least manages to read it!

 

Assuming you are running a Linux OS on the Raspberry, it should work on a ''normal'' Linux, too.

Perhaps just an issue of missing user permissions ?

Using Crossworks on Linux (supports the ST-Link), I need to add rule files to /etc/udev/rules.d, to allow others than root access to such USB devices.

AvaTar
Lead
Posted on July 18, 2016 at 15:45

BTW, forgot to mention that the ST-Link V2.1 has another product ID than the older V2.

So earlier/older udev permission rules do not apply to this new version ...

peterh.m.brooks9
Associate
Posted on July 18, 2016 at 16:06

Yes, 'now tried it' - you're right.

I've got the rules set to mode 0666 - so that shouldn't be the problem.

This is what puzzles me:

st-flash read out.bin 0x8000000 1048576

2016-07-18T16:00:54 INFO src/common.c: Loading device parameters....

2016-07-18T16:00:54 INFO src/common.c: Device connected is: F7 device, id 0x10016449

2016-07-18T16:00:54 INFO src/common.c: SRAM size: 0x50000 bytes (320 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 2048 bytes

# st-flash write out.bin 0x8000000 1048576

2016-07-18T16:01:19 WARN src/sg.c: Failed to find an stlink v1 by VID:PID

2016-07-18T16:01:19 ERROR src/sg.c: Could not open stlink device

It is happy to read - but, suddenly, can't write. 

AvaTar
Lead
Posted on July 18, 2016 at 16:17

> It is happy to read - but, suddenly, can't write.

Honestly, I don't know. Haven't tried the st-link tools since the (in-)famous vl-discovery times. I always used the boards from within Crossworks. Perhaps it's an issue with the tool itself, and the new V2.1 hardware ?

Wine/Windows as last resort ?

Walid FTITI_O
Senior II
Posted on July 18, 2016 at 16:57

Hi brooks.peter.001,

Try to upgrade the ST-Link firmware to V2-1 version through this Link

http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link009.html

through the ST-Link utility.

-Hannibal-
AvaTar
Lead
Posted on July 19, 2016 at 07:22

That requires Windows - and you could flash you application directly from the ST-Link utility then.