Flash Programming via JTAG with PP Wiggler?

Greetings All:

It seems I can now do everything with my PP wiggler except program the FLASH. I can program RAM, debug code executing within RAM and debug code loaded with the Philips utility into FLASH.

However when I try to load the flash via OpenOCD-pp version r141 I find the process locks up into a forever loop. OpenOCD-pp seems to start OK with the usual warning message and then nothing further happens except status bar indicates progress of 0% build. My associated make file lines, console output, script and pp config files are below.

Many thanks in advance for any suggestions!

Tom Alldread


…Make File “program:” section…


BINIMAGE=pgm_mem.bin

OPENOCD_DIR = 'c:\Program Files\OpenOCD\bin'

OPENOCD = $(OPENOCD_DIR)openocd-pp.exe

OPENOCD_CFG = ‘C:\TMA\Projects\ARM-C-Src\OpenOCDcfg\lpc2103_pp.cfg’

program: $(BINIMAGE)

@echo “Now Program FLASH via OpenOCD JTAG Port…” #console msg

$(OPENOCD) -f $(OPENOCD_CFG) #onchip flash programming in progress

@echo “On-Chip FLASH Program Memory Programming Complete!”

=================================


…Output to Console…


make -k program

Now Program FLASH via OpenOCD JTAG Port…

'c:\Program Files\OpenOCD\bin'openocd-pp.exe -f ‘C:\TMA\Projects\ARM-C-Src\OpenOCDcfg\lpc2103_pp.cfg’ #onchip flash programming in progress

Info: openocd.c:86 main(): Open On-Chip Debugger (2007-04-16 19:30 CEST)

Warning: arm7_9_common.c:685 arm7_9_assert_reset(): srst resets test logic, too

==================================

------------hangs here in forever loop---------------------

==================================


Script File: “lpc2103JTAGpgm.script”


The following commands will be executed on

reset (because of run_and_init in the config-file)

- wait for target halt

- erase memory

- flash content of file main.bin into target-memory

- shutdown openocd

created by Martin Thomas

http://www.siwawi.arubi.uni-kl.de/avr_p … m_projects

based on information from Dominic Rath

arm7_9 dcc_downloads enable

wait_halt

sleep 10

poll

flash probe 0

erase first bank only:

flash erase 0 0 0

erase all banks:

flash erase 0 0 7

flash write 0 pgm_mem.bin 0x0

reset run

sleep 10

shutdown

=========================================

----------PP config file: “lpc2103_pp.cfg”


#daemon configuration

telnet_port 4444

gdb_port 3333

#daemon_startup <‘attach’|‘reset’>

#interface

interface parport

parport_port 0xA400

parport_cable wiggler

jtag_speed 0

#use combined on interfaces or targets that can’t set TRST/SRST separately

reset_config trst_and_srst srst_pulls_trst

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag_device 4 0x1 0xf 0xe

#target configuration

daemon_startup reset

#target

#target arm7tdmi

target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4

run_and_halt_time 0 30

#target_script specifies the flash programming script file

target_script 0 reset lpc2103JTAGpgm.script

RAM-options LPC2138

working_area <target#> <‘backup’|‘nobackup’>

working_area 0 0x40000000 0x4000 nobackup

RAM-options LPC2103

working_area <target#> <‘backup’|‘nobackup’>

working_area 0 0x40000000 0x2000 nobackup

FLASH-options LPC2138

LPC2138 @ 12MHz / 512K FLASH – 0x7D000 from 500*1024 (not 512!)

flash bank lpc2000 0 0 <target#> [‘calc_checksum’]

#flash bank lpc2000 0x0 0x7D000 0 0 lpc2000_v2 0 12000 calc_checksum

FLASH-options LPC2103

LPC2103 @ 19.6608MHz / 32K FLASH – 0x8000 from 32*1024 of FLASH

flash bank lpc2000 0 0 <target#> [‘calc_checksum’]

flash bank lpc2000 0x0 0x08000 0 0 lpc2000_v2 0 19661 calc_checksum

For more information about the configuration files, take a look at:

http://openfacts.berlios.de/index-en.ph … p+Debugger

=====================================================

Here is some additional information:

  • the target MPU is the LPC2103 with 32K Flash and 8K RAM.

  • I have placed the script file in the OpenOCD\bin directory and also in the target program development work space directory.

  • The pgm_mem.bin file is also located in the target program development work space directory.

  • I set the Build Make Target Eclipse command options according to Jim Lynch’s excellent Cross Devlopment tutorial.

I hope this provides more clues…

Tom

I would try to execute the commands in lpc2103JTAGpgm.script one by one from the OpenOCD telnet interface to see where in the script things go wrong.

When you have found that you can get more detailed information by setting

debug_level 3

Regards,

Magnus

Hi Magnus:

Many thanks for your suggestion. I didn’t think of trying to access OpenOCD via Telnet…I didn’t know until now that there is a whole ASCII command set. This is a very nice testing method to know about!!!

I have concluded the problem I have is that OpenOCD-pp.exe is not opening the script file. I am going to post more questions under a different subject title.

Thanks Again for the Tip!

Tom Alldread

I have the same problem with an LPC-E2294 board and the USB OCD Tiny. Have you been able to find a solution?

Greetings:

I finally gave up trying to program FLASH with my parallel port wiggler. I decided to buy an Olimex ARM-USB-OCD and installed their GCC tool chain distribution. It runs under Cygwin and so far has been working great for programming FLASH.

I think I am close to reaching the productive stage with GNUARM and remain hopeful that the time spent learning this development system will ultimately prove to have been a worthwhile effort.

Tom Alldread