OpenOCD not working for OLIMEX USB Tiny

I’m at the end of my third week trying to get my Olimex board doing the simple LED flasher. The target board is an Olimex LPC-P2103

I have reinstalled the Olimex for dummies CD.

When I do the Run External to get the OpenOCD running I get

  • Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

    Debug: jtag.c:1210 jtag_init():

    Debug: ft2232.c:991 ft2232_init(): ‘ft2232’ interface using FTD2XX with ‘olimex-jtag’ layout

    Debug: ft2232.c:1077 ft2232_init(): current latency timer: 2

    Debug: ft2232.c:1330 olimex_jtag_init(): 80 08 1b

    Debug: ft2232.c:1373 olimex_jtag_init(): 82 09 0f

    Debug: ft2232.c:242 ft2232_speed(): 86 01 00

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: openocd.c:100 main(): jtag init complete

    Debug: arm7_9_common.c:656 arm7_9_assert_reset(): target->state: unknown

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 0

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 0

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: ft2232.c:738 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x02, high_direction: 0x0f

    Debug: ft2232.c:738 olimex_jtag_reset(): trst: 0, srst: 1, high_output: 0x03, high_direction: 0x0f

    Debug: arm7_9_common.c:722 arm7_9_deassert_reset(): target->state: reset

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 2

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: ft2232.c:738 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f

    Debug: openocd.c:104 main(): target init complete

    Debug: openocd.c:108 main(): flash init complete

    Debug: gdb_server.c:1347 gdb_init(): gdb service for target arm7tdmi at port 3333

    Debug: arm7_9_common.c:838 arm7_9_halt(): target->state: reset

    Debug: embeddedice.c:253 embeddedice_write_reg(): 9: 0xffffffff

    Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 3

    Debug: jtag.c:1096 jtag_reset_callback():

    Debug: embeddedice.c:253 embeddedice_write_reg(): 11: 0xffffffff

    Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000100

    Debug: embeddedice.c:253 embeddedice_write_reg(): 13: 0x000000f7

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1

    Debug: arm7_9_common.c:620 arm7_9_poll(): DBGACK set, dbg_state->value: 0x4f1f0f0f

    Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005

    Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000000

    Debug: arm7_9_common.c:944 arm7_9_debug_entry(): target entered debug from ARM state

    Error: armv4_5.c:186 armv4_5_mode_to_number(): invalid mode value encountered

    Error: arm7_9_common.c:972 arm7_9_debug_entry(): cpsr contains invalid mode value - communication failure

    Error: target.c:1054 handle_target(): couldn’t poll target, exiting



  • My config file is this:

  • #daemon configuration

    telnet_port 4444

    gdb_port 3333

    #interface

    interface ft2232

    ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

    ft2232_layout “olimex-jtag”

    ft2232_vid_pid 0x15BA 0x0004

    jtag_speed 3

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

    reset_config trst_and_srst separate

    #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 0 reset oocd_flash2138.script

    working_area 0 0x40000000 0x40000 nobackup

    #flash configuration

    flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum

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

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

  • Any clues?

    Hi,

    You are very close!

    My sympathy with your efforts. Also wasted a lot of time to get it working.

    My config file: (for LPC2138, but tested it with a LPC2106):

    1. Note minor differences to yours, regard to timing delays and reset action.

    2. Please edit ports for telnet and gdbserver, memory layout etc…

    3. You may also want to check the power supply is adequate. My LPC2106 behaves erratic when powerd off a 6V DC wall wart.

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

    #daemon configuration

    telnet_port 4444

    gdb_port 8888

    #interface

    interface ft2232

    ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

    ft2232_layout “olimex-jtag”

    ft2232_vid_pid 0x15BA 0x0004

    jtag_speed 3

    jtag_nsrst_delay 333

    jtag_ntrst_delay 333

    #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 100

    flash-options LPC2138

    working_area 0 0x40000000 0x4000 nobackup

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

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

    Good luck!

    Thanks jbforrer

    It turns out the OpenOCD file I was playing round with belonged with another project. I had problems trying to get the lpc2103 project sorted out and had my external tools running the wrong config. :frowning:

    So now my config is:

  • #daemon configuration

    telnet_port 4444

    gdb_port 3333

    #interface

    interface ft2232

    ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

    ft2232_layout “olimex-jtag”

    ft2232_vid_pid 0x15BA 0x0004

    jtag_speed 3

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

    reset_config trst_and_srst combined

    #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

    working_area 0 0x40000000 0x40000 nobackup

    #flash configuration

    flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum

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

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

  • I noted along the way that a lot of the comments of people's config files don't match the contents because they've modified other config files without fixing up the comments. There is also confusion about the order of the paremeters for various commands because the order has changed through the years.

    Anyway. I now seem to have got into the debugger OK and I’ll try to learn how to use that.