OpenOCD script results in endless loop

Hello everyone

I program my AT91RM9200 with OpenOCD and JTAGkey. Because the mcu has no internal Flash I use a little trick to program my external Flash :

I first load a flashloader into internal tiny 16 kb SRAM.

It sets up all connected hardware like the Flash and the SD-RAM.

Then I write the flash-image via OpenOCD load_binary command into the SDRAM.

The Flashloader write it to flash.

Heres the Script :

sleep 500
halt
load_binary flash.bin 0x200000
resume 0x200000
sleep 15000
halt
poll
sleep 1000
load_binary image.bin 0x20000000
sleep 1000
resume

BUT :shock: the script for OpenOCD results in endless loop at the first poll-command.

OpenOCD always loop from beginning of the script to the poll-command.

When I send the same commands via Hyperterminal or windows-telnet everything works great.

Did I do something wrong within the script, or could there be a bug in the OpenOCD scriptfeature ?

Hello Falcon,

I could not help here, but you should post which version of

OpenOCD you use.

:slight_smile:

Michael

:roll:

Sorry, I forgot.

Its the latest 2006re78-setup-rc01.

The previous version showed the same behaviour.

Could you try to insert a sleep command

after the halt, and before the poll.

Regards,

Michael

I have inserted it but nothing has changed.

I think I inserted it some times ago.

I changed the script so many times. But it always result in this problem.

Heres my config script. Perhaps there is something wrong ?

#daemon configuration
telnet_port 4444
gdb_port 3333
daemon_startup reset

#interface
interface ftd2xx
ftd2xx_device_desc "Amontec JTAGkey A"
ftd2xx_layout jtagkey
ftd2xx_vid_pid 0x0403 0xcff8
jtag_speed 0

#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst srst_pulls_trst trst_open_drain srst_open_drain

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe



#target <type> <endianness> <startup mode> <chain position> <variant>
target arm920t little run_and_init 0
target_script 0 reset flash.script
# check if working area is in allowed part of internal SRAM (Stack...)
working_area 0 0x203EFF 0x0100 nobackup

# For more information about the configuration files, take a look at:
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger

[/code]

The “wait_halt” command allows you to wait until the requested halt succeeded:

resume 0x200000

sleep 15000

halt

wait_halt

poll

Please send a debug log (-d -l ) to Dominic.Rath gmx.de, and I’ll have a look at what might be going wrong.

Regards,

Dominic

Hi Falcon,

Nice tool. Would it work also for 48LC8M16A2 flash devices?

I didn’t find any tools for programming flash using serial or USB on RM9200. SAM-BA tool from Atmel doesn’t support this controller?

Would you be willing to share your downloader/flash programmer, including source?

regards,

Pecce.

Please read Intel Strataflash 28F128 instead of 48LC in the last post.