I have a 2119 target and using an Olimex ARM-JTAG-USB-TINY or whatever its called. So far pretty good. However a few funny things.
-
Sometimes it just doesn’t connect. Most times it does. No pattern I can discern. I’ve played with the jtag_khz setting.
-
I have the GNUARM tools under Linux/64. I think the gdb build (6.4) doesn’t have expat and therefore on XML, therefore it doesn’t know about the memory regions. To get flash debug to work I have to force hardware breakpoints (not a big deal). I can also manually issue “mem” commands to gdb and then info mem gives me the right stuff. Not a big deal.
2a) I tried to get the source to insight and rebuild it (Kubuntu). Builds fine but then tells me that I don’t have tk installed properly. Tried many things to fix this and a quick google says I’m not alone and didn’t turn up an answer. Not a big deal really, but just annoying.
- monitor flash write_image erase somefile.elf elf Seems to work ok! Hooray. But just doing a gdb “Download” does NOT work. It looks like it tries to write to RAM. This is even when you use the mem command.
So…
(gdb) info mem
Num Enb Low Addr High Addr Attrs
2 y 0x40000000 0x40003fff rw nocache
1 y 0x00000000 0x0001ffff ro nocache
(gdb) load
Loading section startup, size 0x20 lma 0x0
Error: Memory access error while loading section startup.
- Oddly enough, no matter what I do, flash info shows all sectors protected. Always. Even after explicit “monitor flash protect 0 0 15 off”
(gdb) monitor flash protect 0 0 15 off
cleared protection for sectors 0 through 15 on flash bank 0
(gdb) monitor flash info 0
#0: lpc2000 at 0x00000000, size 0x00020000, buswidth 0, chipwidth 0
# 0: 0x00000000 (0x2000 8kB) protected
# 1: 0x00002000 (0x2000 8kB) protected
# 2: 0x00004000 (0x2000 8kB) protected
# 3: 0x00006000 (0x2000 8kB) protected
# 4: 0x00008000 (0x2000 8kB) protected
# 5: 0x0000a000 (0x2000 8kB) protected
# 6: 0x0000c000 (0x2000 8kB) protected
# 7: 0x0000e000 (0x2000 8kB) protected
# 8: 0x00010000 (0x2000 8kB) protected
# 9: 0x00012000 (0x2000 8kB) protected
# 10: 0x00014000 (0x2000 8kB) protected
# 11: 0x00016000 (0x2000 8kB) protected
# 12: 0x00018000 (0x2000 8kB) protected
# 13: 0x0001a000 (0x2000 8kB) protected
# 14: 0x0001c000 (0x2000 8kB) protected
# 15: 0x0001e000 (0x2000 8kB) protected
lpc2000 flash driver variant: 1, clk: 19660
My cfg file, for what its worth:
# REFERENCE: http://www.olimex.com/dev/arm-usb-tiny.html
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY"
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15ba 0x0004
#LPC-2119 CPU
# would not swear the following is right:
reset_config trst_and_srst srst_pulls_trst
jtag newtap LPC2119 cpu -irlen 4 -ircapture 0x1 -irmask 0xF
target create LPC2119.cpu arm7tdmi -endian little -chain-position 0 -variant arm7tdmi-s_r4
LPC2119.cpu configure -work-area-virt 0x40000000 -work-area-phys 0x40000000 -work-area-size 16384 -work-area-backup 0
#flash bank <driver> <base> <size> <chip_width> <bus_width>
flash bank lpc2000 0x0 0x20000 0 0 0 lpc2000_v1 19660 calc_checksum
gdb_detach resume
gdb_memory_map enable
gdb_flash_program enable
# supposedly this is not necessary with gdb_memory_map on but apparently it is
# with our version of gdb
gdb_breakpoint_override hard
# should also be able to say:
# mem 0 0x200000 ro
# mem 0x40000000 0x40002000 rw
jtag_khz 1000 # works ok at 3000 at least
jtag_nsrst_delay 200
jtag_ntrst_delay 200
No real show stoppers. You can download code and debug. It just isn’t as easy to integrate with gdb with the XML turned off and vFlash apparently not working. I suspect it is the GNUARM gdb debugger build options/version and not the OpenOCD software itself. Any ideas?