example cfg with flash script

What is the new syntax for calling a script file for flashing memory?

The old one was

target_script 0 reset stm32-flash.script

but this doesn’t work anymore.

My config file works fine except for this. I have tried

$_TARGETNAME configure -event reset-end “script stm32f-flash.script”

based on some material that I found on the web. When I append this line to the end of my openocd config file stm32f-OpenOCD.cfg, and do:

openocd -f stm32f-OpenOCD.cfg

the connection is made to the board and I get:

Open On-Chip Debugger 1.0 (2008-12-27-11:22) svn:1284

BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS

$URL: http://svn.berlios.de/svnroot/repos/ope … /openocd.c $

500 kHz

jtag_speed: 2

Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info : JTAG Tap/device matched

Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)

Error: JTAG tap: stm32.bs got: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)

Error: JTAG tap: stm32.bs expected 1 of 1: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)

Error: trying to validate configured JTAG chain anyway…

Warn : no telnet port specified, using default port 4444

Warn : no gdb port specified, using default port 3333

Warn : no tcl port specified, using default port 6666

and it hangs there. When I delete the line from stm32f-OpenOCD.cfg and execute

openocd -f stm32f-OpenOCD.cfg

by hand, and open the telnet session from another window, it all works fine and I flash the memory properly. I do get the same messages as above. It appears that with the line in stm32-OpenOCD.cfg, it still isn’t executing the script, and is still waiting for a telnet session.

What am I doing wrong?

Regards,

Peter

Hi,

I have encountered similar problems, using the same syntax like you.

The problem seems to be that the simple ‘reset’ event cannot be used anmore.

So I have tried some of the other events, that are listed in the current openocd manual. None of these causes the script to be executed:

reset-assert-pre

reset-assert-post

reset-end

reset-deassert-pre

reset-deassert-post

reset-init

reset-start

However, I guess you might at least get rid of the below errors by commenting out the correct silicon revision of the stm32 in the stm32.cfg:

"Error: JTAG tap: stm32.bs got: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)

Error: JTAG tap: stm32.bs expected 1 of 1: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)

Error: trying to validate configured JTAG chain anyway…"

Jan

Hello,

i too tried with the reset events for runing a programming script but no success. Anybody managed to work this thing out?

Regards,

Borut

try

$_TARGETNAME configure -event reset-end { script stm32f-flash.script }

as this is tcl you could do this

$_TARGETNAME configure -event reset-end {

flash write_image erase image.elf

verify_image image.elf

shutdown

}

or even do it as part of the cfg file

… rest of config

init

reset halt

flash write_image erase image.elf

verify_image image.elf

shutdown

and not even have to call a script.

Cheers

Spen