flash STM32 using OpenOCD

Hi Guys

I have been flashing the STM32 processor for some time through eclipse. No Problems.

Now I need to be able to run a script (windows batch or makefile I dont mind) to flash the devices for someone producing 100s of the board. I dont want them to have to load up eclipse.

I am using an olimex ARM-USB-Tiny (www.olimex.com)

My problem is that Im seeing different approaches and Im not sure which will work for me.

If I use two DOS command line boxes, the system is working like this:

open one DOS command line and execute

  1. RUN OPENOCD:

openocd-ftd2xx.exe –d 3 –l openocd.log

Now open a different DOS command line and execute

  1. RUN GDB

arm-none-eabi-gdb

  1. Issue commands through GDB

target remote localhost:3333

monitor soft_reset_halt

monitor flash protect 0 0 127 off

monitor flash erase 0 0 127

monitor flash write 0 main.bin 0

break main

cont

This all works fine and i can run two command line DOS windows to get the device programmed.

BUT how do I make a script to execute this all in one go.

one suggestion in this document

\Lab1\Work\Centron System Solutions\projects\minilink\Software\Tools\Flash Device\Flashing with OpenOCD.html

is that I can used openocd as follows

openocd -d0 -f interface/jtagkey.cfg -f target/stm32.cfg \

-c init -c targets -c “halt” -c “flash write_image erase test.elf” \

-c “verify_image test.elf” -c “reset run” -c shutdown

However I dont have openocd I have openocd-ftd2XX.exe and It doesnt take -c command line options.

Can anyone give me a pointer on this.

Many thanks for any help

Regards

Denis


http://www.CentronSolutions.com