"Cannot access memory at address"

Hi.

I’m using OpenOCD re141 with NXP LPC2468 with eCos, and Amontec JTAG.

I am able to flash my 2468 with OpenOCD but when I try to connect GDB to it I get this:

GNU gdb 5.3 (eCosCentric)

(gdb) target remote localhost:3333

Remote debugging using localhost:3333

Cannot access memory at address 0x6002081

0x00000064 in ?? ()

I also see that 0x6002081 is in register r11 when I start up the openOCD with -d3. This is on the reserved address space, so why is it trying to access this memory?

I’ve attached the logfile for this short “startup”, and the OpenOCD-script at the end.

I am using the same JTAG/OpenOCD-scripts as for NXP LPC2148, which I was able to both flash and debug via JTAG and with GDB.

Any clues on what’s wrong?

/JP

(I dont know how to attach files, so I post them here instead…):

lpc2468-jtagkey-used-for-flash.cfg

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

#jtag_ntrst_delay 200

#commands specific to the Amontec JTAGKey

interface ft2232

ft2232_device_desc “Amontec JTAGkey A”

ft2232_layout jtagkey

ft2232_vid_pid 0x0403 0xcff8

jtag_speed 9

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

target arm7tdmi little run_and_init 0 arm7tdmi_r4

run_and_halt_time 0 30

flash-options LPC2468

#target_script 0 reset oocd_flash2148.script

target_script 0 reset ‘C:\Program Files\openocd-2007re131\bin\scripts\oocd_flash2468.script’

working_area 0 0x40000000 0x4000 nobackup

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

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

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

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

Flash-script: oocd_flash2468.script

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 26

flash write 0 e:/projects/granuldisk/2468_ecos/main.bin 0x0

reset run

sleep 10

shutdown

lpc2468-jtagkey.cfg:

#define our ports

telnet_port 4444

gdb_port 3333

#commands specific to the Amontec JTAGKey

#interface ft2232

#ft2232_device_desc “Amontec JTAGkey A”

#ft2232_layout jtagkey

#ft2232_vid_pid 0x0403 0xcff8

#jtag_speed 2

#jtag_nsrst_delay 200

#jtag_ntrst_delay 200

#commands specific to the Amontec JTAGKey

interface ft2232

ft2232_device_desc “Amontec JTAGkey A”

ft2232_layout jtagkey

ft2232_vid_pid 0x0403 0xcff8

jtag_speed 9

jtag_nsrst_delay 500

jtag_ntrst_delay 500

#reset_config [combination] [trst_type] [srst_type]

#reset_config srst_only srst_pulls_trst

#reset_config trst_and_srst

reset_config srst_only

#jtag_device

jtag_device 4 0x1 0xf 0xe

#daemon_startup <‘attach’|‘reset’>

daemon_startup reset

#target <reset_mode> <jtag#> [variant]

target arm7tdmi little run_and_halt 0 arm7tdmi

#target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4

#run_and_halt_time <target#> <time_in_ms>

run_and_halt_time 0 30

Output from: openocd-ftd2xx.exe -f lpc2468-jtagkey.cfg -d3

Debug: jtag.c:1335 jtag_init(): -

Debug: ft2232.c:1242 ft2232_init_ftd2xx(): ‘ft2232’ interface using FTD2XX with ‘jtagkey’ layout (0403:cff8)

Debug: ft2232.c:1331 ft2232_init_ftd2xx(): current latency timer: 2

Debug: ft2232.c:1597 jtagkey_init(): 80 08 1b

Debug: ft2232.c:1655 jtagkey_init(): 82 09 0f

Debug: ft2232.c:249 ft2232_speed(): 86 09 00

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: jtag.c:1220 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1126 jtag_reset_callback(): -

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

Debug: embeddedice.c:218 embeddedice_read_reg_w_check(): 4

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: TRST released

Debug: jtag.c:1126 jtag_reset_callback(): -

Warning: embeddedice.c:175 embeddedice_build_reg_cache(): EmbeddedICE version 7 detected, EmbeddedICE handling might be broken

Debug: embeddedice.c:218 embeddedice_read_reg_w_check(): 0

Debug: embeddedice.c:314 embeddedice_write_reg(): 0: 0x00000000

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

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: SRST asserted

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: TRST asserted

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: SRST asserted

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: ft2232.c:947 jtagkey_reset(): trst: 0, srst: 1, high_output: 0x01, high_direction: 0x0f

Debug: ft2232.c:947 jtagkey_reset(): trst: 0, srst: 1, high_output: 0x01, high_direction: 0x0f

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

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: SRST released

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: ft2232.c:947 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f

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

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

Debug: openocd.c:116 main(): NAND init complete

Debug: openocd.c:120 main(): pld init complete

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

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

Debug: jtag.c:278 jtag_call_event_callbacks(): jtag event: TRST released

Debug: jtag.c:1126 jtag_reset_callback(): -

Debug: arm7_9_common.c:873 arm7_9_halt(): target->state: running

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

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

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

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

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

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

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

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

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

Debug: arm7_9_common.c:1023 arm7_9_debug_entry(): target entered debug state in Supervisor mode

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r0: 0xe01fc000

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r1: 0x00000000

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r2: 0x000000aa

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r3: 0x00000055

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r4: 0x00000000

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r5: 0xe01fc040

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r6: 0x00001fff

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r7: 0x68580aec

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r8: 0xcda90e27

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r9: 0x15a1583c

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r10: 0x3ba81105

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r11: 0x06002081

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r12: 0xafac1521

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r13: 0x4000ffc8

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r14: 0x7fffe2a3

Debug: arm7_9_common.c:1052 arm7_9_debug_entry(): r15: 0x00000064

Debug: arm7_9_common.c:1058 arm7_9_debug_entry(): entered debug state at PC 0x64

Debug: target.c:464 target_call_event_callbacks(): target event 0

Debug: arm7_9_common.c:873 arm7_9_halt(): target->state: halted

Warning: arm7_9_common.c:877 arm7_9_halt(): target was already halted

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$Hc-1#09’

Info: server.c:67 add_connection(): accepted ‘gdb’ connection from 0

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘Hc-1’

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$qC#b4’

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘qC’

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$qOffsets#4b’

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘qOffsets’

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$?#3f

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘?’

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$S02#b5’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$Hg0#df’

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘Hg0’

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$g#67’

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘g’

Debug: gdb_server.c:553 gdb_get_registers_packet(): -

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: e01fc000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 00000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000aa

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 00000055

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 00000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: e01fc040

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 00001fff

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 68580aec

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: cda90e27

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 15a1583c

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 3ba81105

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 06002081

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: afac1521

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 4000ffc8

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 7fffe2a3

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 00000064

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 000000000000000000000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 00000000

Debug: gdb_server.c:580 gdb_get_registers_packet(): hex_buf: 400000d3

Debug: gdb_server.c:587 gdb_get_registers_packet(): reg_packet: 00c01fe000000000aa000000550000000000000040c01fe0ff1f0000ec0a5868270ea9cd3c58a1150511a83b812000062115acafc8ff0040a3e2ff7f6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d3000040

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$00c01fe000000000aa000000550000000000000040c01fe0ff1f0000ec0a5868270ea9cd3c58a1150511a83b812000062115acafc8ff0040a3e2ff7f6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d3000040#bd’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$m6002081,4#2e’

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘m6002081,4’

Debug: gdb_server.c:834 gdb_read_memory_packet(): addr: 0x06002081, len: 0x00000004

Debug: arm7_9_common.c:1723 arm7_9_read_memory(): address: 0x06002081, size: 0x00000001, count: 0x00000004

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

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

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

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

Warning: arm7_9_common.c:1845 arm7_9_read_memory(): memory read caused data abort (address: 0x06002081, size: 0x1, count: 0x4)

Debug: arm7tdmi.c:507 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$E05#aa’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+$m6002081,4#2e’

Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’

Debug: gdb_server.c:1237 gdb_input(): recevied packet: ‘m6002081,4’

Debug: gdb_server.c:834 gdb_read_memory_packet(): addr: 0x06002081, len: 0x00000004

Debug: arm7_9_common.c:1723 arm7_9_read_memory(): address: 0x06002081, size: 0x00000001, count: 0x00000004

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

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

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

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

Warning: arm7_9_common.c:1845 arm7_9_read_memory(): memory read caused data abort (address: 0x06002081, size: 0x1, count: 0x4)

Debug: arm7tdmi.c:507 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0

Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$E05#aa’

Debug: gdb_server.c:124 gdb_get_char(): received ‘+’