Hi,
I tried to program my LPC2138 board from Embedded Artists with JTAG interface, but it failed every time.The program doesn’t want to work . I use OpenOCD commands scripts.
I tried to program with the olimex USB JTAG and Olimex Jtag PPort, the problem is still there.
When I donwload the program with “Philips Flash Utility”, the program works well ( flashing leds).
This is the scripts that I use for the USB JTAG:
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ft2232
ft2232_device_desc “Olimex OpenOCD JTAG A”
ft2232_layout “olimex-jtag”
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 3
jtag_nsrst_delay 500
jtag_ntrst_delay 500
#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_init 0 arm7tdmi-s_r4
run_and_halt_time 0 30
#Flash Option LPC2138
target_script 0 reset openocd_lpc2138_flash.script
working_area 0 0x40000000 0x4000 nobackup
#flash configuration
flash bank lpc2000 0x0 0x7D000 0 0 lpc2000_v2 0 14765 calc_checksum
For more information about the configuration files, take a look at:
http://openfacts.berlios.de/index-en.ph … p+Debugger
-------------------openocd_lpc2138_flash.script ---->>
The following command wills 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 all banks:
#flash protect 0 0 0 off
flash erase 0 0 26
flash write 0 main.bin 0x0
reset run
sleep 10
shutdown
During the flash process the message is:
C:\Documents and Settings\GigaByte>load
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
Info: target.c:227 target_init_handler(): executing reset script ‘openocd_lpc2138_flash.script’
Info: configuration.c:50 configuration_output_handler(): dcc downloads are enabled
Info: configuration.c:50 configuration_output_handler(): waiting for target halted…
Info: configuration.c:50 configuration_output_handler(): target halted
Info: configuration.c:50 configuration_output_handler(): target state: halted
Info: configuration.c:50 configuration_output_handler(): target halted in ARM state due to debug request, current mode: System
Info: configuration.c:50 configuration_output_handler(): cpsr: 0x2000001f pc: 0x00002294
Info: configuration.c:50 configuration_output_handler(): flash ‘lpc2000’ found at 0x00000000
Info: configuration.c:50 configuration_output_handler(): erased sectors 0 through 26 on flash bank 0 in 0s 187500us
Info: configuration.c:50 configuration_output_handler(): wrote file main.bin to flash bank 0 at offset 0x00000000 in 12s 656250us
Warning: arm7_9_common.c:685 arm7_9_assert_reset(): srst resets test logic, too
I tried several configurations , the problem is still there:
-
with several jtag speed 0 to 6
-
several flash banks for erase process.
-
BSL Pin connected/not connected to the Ground.
-
two LPC2138 boards
-
I used main.bin and main.hex files ( I know that OpenOcd doesn’t accept *.hex files)
I tried to contact Embedded Artists, they told me that they use keil Ulink and Segger J-link and it works well.
I don’t know where is the problem ?
Thanks,