| 1 | = OpenOCD Configuration for LPC17xx = |
| 2 | |
| 3 | [[TOC(Debugging/OpenOCD/LPC17xx , depth=2)]] |
| 4 | |
| 5 | The OpenOCD includes directly configuration for MBED LPC1768 based board |
| 6 | ([http://sourceforge.net/p/openocd/code/ci/master/tree/tcl/board/mbed-lpc1768.cfg mbed-lpc1768.cfg]) |
| 7 | |
| 8 | We use next configuration for our own FTDI based [http://pikron.com/pages/products/accessories.html Edgewall Software] JT_USB5/6] |
| 9 | JTAG pod for our LPC4088 based boards ([http://pikron.com/pages/products/cpu_boards/lx_cpu.html LX_CPU]). |
| 10 | |
| 11 | The presented configuration variant starts the target first to allow setup SDRAM by boot |
| 12 | loader code and then application is loaded over GDB/DDD to SDRAM |
| 13 | |
| 14 | File "lx_cpu-lpc4088.cfg": |
| 15 | {{{ |
| 16 | # This is configuration for PiKRON's LX_CPU1 based on NXP LPC4088 chip. |
| 17 | # http://pikron.com/pages/products/cpu_boards/lx_cpu.html |
| 18 | |
| 19 | #daemon configuration |
| 20 | telnet_port 4444 |
| 21 | gdb_port 3333 |
| 22 | |
| 23 | adapter_khz 1000 |
| 24 | |
| 25 | source [find jt_usb5-jtag.cfg] |
| 26 | |
| 27 | source [find target/lpc40xx.cfg] |
| 28 | |
| 29 | init |
| 30 | |
| 31 | reset init |
| 32 | #wait_halt |
| 33 | resume |
| 34 | sleep 1000 |
| 35 | halt |
| 36 | wait_halt |
| 37 | |
| 38 | adapter_khz 1000 |
| 39 | }}} |
| 40 | |
| 41 | File jt_usb5-jtag.cfg: |
| 42 | {{{ |
| 43 | interface ftdi |
| 44 | #ftdi_device_desc "Dual RS232" |
| 45 | ftdi_vid_pid 0x0403 0x6010 |
| 46 | |
| 47 | ftdi_layout_init 0x0cf8 0x0cfb |
| 48 | |
| 49 | #ftdi_layout_signal nTRST -data 0x0010 -noe 0x0800 |
| 50 | #ftdi_layout_signal nSRST -ndata 0x0040 -noe 0x0400 |
| 51 | #ftdi_layout_signal SWD_EN -nalias nTRST |
| 52 | #ftdi_layout_signal SWDIO_OE -alias TMS |
| 53 | |
| 54 | ftdi_layout_signal nTRST -data 0x0010 |
| 55 | ftdi_layout_signal nSRST -ndata 0x0040 |
| 56 | |
| 57 | ftdi_layout_signal LED -data 0x0800 |
| 58 | |
| 59 | transport select jtag |
| 60 | |
| 61 | #transport select swd |
| 62 | #ftdi_layout_signal SWD_EN -ndata 0x0400 |
| 63 | #ftdi_layout_signal SWDIO_OE -alias TMS |
| 64 | }}} |
| 65 | |
| 66 | File gdb-openocd.init: |
| 67 | {{{ |
| 68 | #set endian big |
| 69 | target remote localhost:3333 |
| 70 | #load |
| 71 | }}} |
| 72 | |
| 73 | File "lx_cpu-jt_usb5-ddd" for combined start of GDB and DDD. |
| 74 | {{{ |
| 75 | #!/bin/sh |
| 76 | |
| 77 | SCRIP_DIR="$(dirname "$(readlink -f "$0")")" |
| 78 | |
| 79 | nc -w 3 -z localhost 4444 |
| 80 | if [ $? -ne 0 ] |
| 81 | then |
| 82 | echo "Starting OpenOCD" |
| 83 | openocd -f "$SCRIP_DIR/lx_cpu-lpc4088.cfg" & |
| 84 | OPENOCD_PID=$! |
| 85 | nc -w 10 -z localhost 4444 |
| 86 | if [ $? -ne 0 ] |
| 87 | then |
| 88 | echo "OpenOCD start failed" |
| 89 | fi |
| 90 | fi |
| 91 | |
| 92 | sleep 10 |
| 93 | |
| 94 | ddd --debugger arm-elf-gdb -x "$SCRIP_DIR/gdb-openocd.init" "$1" |
| 95 | |
| 96 | kill $OPENOCD_PID |
| 97 | }}} |