Hi,

I'm trying to flash an image using OpenOCD via the command line...

It works with commands issued through telnet, but fails with the same
commands supplied via -f file.cfg on the command line.  I also tried
-c options and it fails in the same way.

The error is: Runtime error ... invalid command name "reset"

Ultimately what I am trying to acheive is a non-interactive flash
programming session that can be scripted.

I am using OpenOCD 0.4.0 pre-compiled binaries from
http://www.freddiechopin.info/

I'm new to OpenOCD, and copied the commands from a HowTo I found.  Can
anyone tell me if the error is a bug or do I have wrong expectations?

I also posted to http://forum.sparkfun.com/viewtopic.php?f=18&t=20992
but no responses so far.  I am following both the Sparkfun forum and
this list.

Thanks!

--------------------------------------------------------------------------------
Cut-n-paste from DOS command line :-

D:\tmp>type arm-usb-ocd.cfg
#
# Olimex ARM-USB-OCD
#
# http://www.olimex.com/dev/arm-usb-ocd.html
#

interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003


D:\tmp>type olimex_stm32_h103.cfg
# Olimex STM32-H103 eval board
# http://olimex.com/dev/stm32-h103.html

# Work-area size (RAM size) = 20kB for STM32F103RB device
set WORKAREASIZE 0x5000

source [find target/stm32.cfg]

D:\tmp>type main.cfg
reset halt
flash probe 0
stm32x mass_erase 0
flash write_bank 0 main.bin 0
reset halt

D:\tmp>openocd -f arm-usb-ocd.cfg -f olimex_stm32_h103.cfg -f main.cfg
Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
Runtime error, file "main.cfg", lin                   <<------ *** THE ERROR ***
    invalid command name "reset"

D:\tmp>openocd -f arm-usb-ocd.cfg -f olimex_stm32_h103.cfg
Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : clock speed 1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba0
0, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410
, ver: 0x1)
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection from 0
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba0
0, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410
, ver: 0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000010 msp: 0x20000800
Info : device id = 0x20036410
Info : flash size = 128kbytes
flash 'stm32x' found at 0x08000000
stm32x mass erase complete
wrote 4052 bytes from file main.bin to flash bank 0 at offset 0x00000000 in 0.50
0000s (7.914 kb/s)
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba0
0, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410
, ver: 0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000010 msp: 0x20000800


--------------------------------------------------------------------------------
Cut-n-paste from telnet session :-

Open On-Chip Debugger
> reset halt
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, 
ver: 0x3)
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 
0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000010 msp: 0x20000800
> flash probe 0
device id = 0x20036410
flash size = 128kbytes
flash 'stm32x' found at 0x08000000
> stm32x mass_erase 0
stm32x mass erase complete
> flash write_bank 0 main.bin 0
wrote 4052 bytes from file main.bin to flash bank 0 at offset 0x00000000 in 
0.500000s (7.914 kb/s)
> reset halt
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, 
ver: 0x3)
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 
0x1)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000010 msp: 0x20000800
>

--------------------------------------------------------------------------------

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to