Add OpenOCD notes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2538 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
f791179e4d
commit
f4eee7663d
@ -194,6 +194,31 @@ Image Format
|
|||||||
If you don't use setenv.sh, then just set your PATH variable appropriately or
|
If you don't use setenv.sh, then just set your PATH variable appropriately or
|
||||||
use the full path to mklpc.sh in the final step.
|
use the full path to mklpc.sh in the final step.
|
||||||
|
|
||||||
|
OpenOCD
|
||||||
|
^^^^^^^
|
||||||
|
|
||||||
|
I have been using the Olimex ARM-USB-OCD JTAG debugger with the EA3131
|
||||||
|
(http://www.olimex.com). The OpenOCD configuration file is here:
|
||||||
|
tools/armusbocb.cfg. There is also a script on the tools directory that
|
||||||
|
I used to start the OpenOCD daemon on my system called oocd.sh. That
|
||||||
|
script would probably require some modifications to work in another
|
||||||
|
environment:
|
||||||
|
|
||||||
|
- possibly the value of OPENOCD_PATH
|
||||||
|
- If you are working under Linux you will need to change any
|
||||||
|
occurances of `cygpath -w blablabla` to just blablabla
|
||||||
|
|
||||||
|
Then you should be able to start the OpenOCD daemon like:
|
||||||
|
|
||||||
|
tools/oocd.sh <topdir>
|
||||||
|
|
||||||
|
Where <topdir> is the directory where NuttX is installed.
|
||||||
|
|
||||||
|
Once the OpenOCD daemon has been started, you can connect to it via
|
||||||
|
GDB using the following GDB command:
|
||||||
|
|
||||||
|
(gdb) target remote localhost:3333
|
||||||
|
|
||||||
ARM/EA3131-specific Configuration Options
|
ARM/EA3131-specific Configuration Options
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||||
|
34
configs/ea3131/tools/armusbocd.cfg
Executable file
34
configs/ea3131/tools/armusbocd.cfg
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#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 2
|
||||||
|
|
||||||
|
#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 <type> <startup mode>
|
||||||
|
#target arm9ejs <reset mode> <chainpos> <endianness> <variant>
|
||||||
|
target arm926ejs little run_and_halt 0 arm926ejs
|
||||||
|
run_and_halt_time 0 30
|
||||||
|
|
||||||
|
#target_script 0 reset oocd_flash2138.script
|
||||||
|
working_area 0 0x1102800 0x60000 nobackup
|
||||||
|
|
||||||
|
#flash configuration
|
||||||
|
#flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v2 12000 calc_checksum
|
||||||
|
|
||||||
|
# For more information about the configuration files, take a look at:
|
||||||
|
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger
|
43
configs/ea3131/tools/oocd.sh
Executable file
43
configs/ea3131/tools/oocd.sh
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
TOPDIR=$1
|
||||||
|
USAGE="$0 <TOPDIR> [-d]"
|
||||||
|
if [ -z "${TOPDIR}" ]; then
|
||||||
|
echo "Missing argument"
|
||||||
|
echo $USAGE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
OPENOCD_PATH="/cygdrive/c/gccfd/openocd/bin"
|
||||||
|
OPENOCD_EXE=openocd-ftd2xx.exe
|
||||||
|
OPENOCD_CFG="${TOPDIR}/configs/ea3131/tools/armusbocd.cfg"
|
||||||
|
OPENOCD_ARGS="-f `cygpath -w ${OPENOCD_CFG}`"
|
||||||
|
~/projects/nuttx/nuttx/configs/ea3131/tool
|
||||||
|
|
||||||
|
if [ "X$2" = "X-d" ]; then
|
||||||
|
OPENOCD_ARGS=$OPENOCD_ARGS" -d3"
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d ${OPENOCD_PATH} ]; then
|
||||||
|
echo "OpenOCD path does not exist: ${OPENOCD_PATH}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -x ${OPENOCD_PATH}/${OPENOCD_EXE} ]; then
|
||||||
|
echo "OpenOCD does not exist: ${OPENOCD_PATH}/${OPENOCD_EXE}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -f ${OPENOCD_CFG} ]; then
|
||||||
|
echo "OpenOCD config file does not exist: ${OPENOCD_CFG}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting OpenOCD"
|
||||||
|
${OPENOCD_PATH}/${OPENOCD_EXE} ${OPENOCD_ARGS} &
|
||||||
|
echo "OpenOCD daemon started"
|
||||||
|
ps -ef | grep openocd
|
||||||
|
echo "In GDB: target remote localhost:3333"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user