Changes between Initial Version and Version 1 of Debugging/OpenOCD/LPC17xx


Ignore:
Timestamp:
09/17/15 16:38:59 (7 years ago)
Author:
Pavel Pisa
Comment:

Document some options for use of OpenOCD on LPC17xx/LPC40xx based boards.

Legend:

Unmodified
Added
Removed
Modified
  • Debugging/OpenOCD/LPC17xx

    v1 v1  
     1= OpenOCD Configuration for LPC17xx =
     2
     3[[TOC(Debugging/OpenOCD/LPC17xx , depth=2)]]
     4
     5The 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
     8We use next configuration for our own FTDI based [http://pikron.com/pages/products/accessories.html Edgewall Software] JT_USB5/6]
     9JTAG pod for our LPC4088 based boards ([http://pikron.com/pages/products/cpu_boards/lx_cpu.html  LX_CPU]).
     10
     11The presented configuration variant starts the target first to allow setup SDRAM by boot
     12loader code and then application is loaded over GDB/DDD to SDRAM
     13
     14File "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
     20telnet_port 4444
     21gdb_port 3333
     22
     23adapter_khz 1000
     24
     25source [find jt_usb5-jtag.cfg]
     26
     27source [find target/lpc40xx.cfg]
     28
     29init
     30
     31reset init
     32#wait_halt
     33resume
     34sleep 1000
     35halt
     36wait_halt
     37
     38adapter_khz 1000
     39}}}
     40
     41File jt_usb5-jtag.cfg:
     42{{{
     43interface ftdi
     44#ftdi_device_desc "Dual RS232"
     45ftdi_vid_pid 0x0403 0x6010
     46
     47ftdi_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
     54ftdi_layout_signal nTRST -data 0x0010
     55ftdi_layout_signal nSRST -ndata 0x0040
     56
     57ftdi_layout_signal LED -data 0x0800
     58
     59transport 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
     66File gdb-openocd.init:
     67{{{
     68#set endian big
     69target remote localhost:3333
     70#load
     71}}}
     72
     73File "lx_cpu-jt_usb5-ddd" for combined start of GDB and DDD.
     74{{{
     75#!/bin/sh
     76
     77SCRIP_DIR="$(dirname "$(readlink -f "$0")")"
     78
     79nc -w 3 -z localhost 4444
     80if [ $? -ne 0 ]
     81then
     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
     90fi
     91
     92sleep 10
     93
     94ddd --debugger arm-elf-gdb -x "$SCRIP_DIR/gdb-openocd.init" "$1"
     95
     96kill $OPENOCD_PID
     97}}}