diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-16 01:57:34 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-16 01:57:34 +0000 |
commit | d980ce2cdc1816e4d5df9a1c2ff9e647c6cb7540 (patch) | |
tree | d2595e1c0eb40bec974a2046329cfba711e8f4a8 /nuttx/configs/lm4f120-launchpad/tools | |
parent | a4739f8ced6593ca401989dfaa20b2762468488b (diff) | |
download | px4-nuttx-d980ce2cdc1816e4d5df9a1c2ff9e647c6cb7540.tar.gz px4-nuttx-d980ce2cdc1816e4d5df9a1c2ff9e647c6cb7540.tar.bz2 px4-nuttx-d980ce2cdc1816e4d5df9a1c2ff9e647c6cb7540.zip |
Add OpenOCD support for LM4F120 LaunchPad. From JP Carballo
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5747 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/lm4f120-launchpad/tools')
-rw-r--r-- | nuttx/configs/lm4f120-launchpad/tools/lm4f120-launchpad.cfg | 71 | ||||
-rw-r--r-- | nuttx/configs/lm4f120-launchpad/tools/oocd.sh | 58 |
2 files changed, 129 insertions, 0 deletions
diff --git a/nuttx/configs/lm4f120-launchpad/tools/lm4f120-launchpad.cfg b/nuttx/configs/lm4f120-launchpad/tools/lm4f120-launchpad.cfg new file mode 100644 index 000000000..a4fa62f0a --- /dev/null +++ b/nuttx/configs/lm4f120-launchpad/tools/lm4f120-launchpad.cfg @@ -0,0 +1,71 @@ +# +# TI Stellaris Launchpad ek-lm4f120xl Evaluation Kits +# +# http://www.ti.com/tool/ek-lm4f120xl +# + +# +# NOTE: using the bundled ICDI interface is optional! +# This interface is not ftdi based as previous boards were +# + +# Interface configuration + +# +# TI Stellaris In-Circuit Debug Interface (ICDI) Board +# +# This is the propriety ICDI interface used on newer boards such as +# LM4F232 Evaluation Kit - http://www.ti.com/tool/ek-lm4f232 +# Stellaris Launchpad - http://www.ti.com/stellaris-launchpad +# http://www.ti.com/tool/ek-lm4f232 +# + +interface hla +hla_layout ti-icdi +hla_vid_pid 0x1cbe 0x00fd + +# Board configuration + +# unused but set to disable warnings +adapter_khz 1000 + +set WORKAREASIZE 0x8000 +set CHIPNAME lm4f120h5qr + +# Target configuration + +# +# lm3s icdi pseudo target +# + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME lm3s +} + +# Work-area is a space in RAM used for flash programming +# By default use 16kB +if { [info exists WORKAREASIZE] } { + set _WORKAREASIZE $WORKAREASIZE +} else { + set _WORKAREASIZE 0x4000 +} + +# +# possible value are hla_jtag +# currently swd is not supported +# +transport select hla_jtag + +# do not check id as icdi currently does not support it +hla newtap $_CHIPNAME cpu -expected-id 0 + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME hla_target -chain-position $_TARGETNAME + +$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 + +# flash configuration ... autodetects sizes, autoprobed +flash bank $_CHIPNAME.flash stellaris 0 0 0 0 $_TARGETNAME + diff --git a/nuttx/configs/lm4f120-launchpad/tools/oocd.sh b/nuttx/configs/lm4f120-launchpad/tools/oocd.sh new file mode 100644 index 000000000..981845225 --- /dev/null +++ b/nuttx/configs/lm4f120-launchpad/tools/oocd.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +# See configs/lm4f120-launchpad/README.txt for information about +# this file. + +TOPDIR=$1 +USAGE="$0 <TOPDIR> [-d]" +if [ -z "${TOPDIR}" ]; then + echo "Missing argument" + echo $USAGE + exit 1 +fi + +# Assume that OpenOCD was installed and at /usr/local/bin. Uncomment +# the following to run directly from the build directory + +# OPENOCD_PATH="/home/OpenOCD/openocd/src" +# OPENOCD_PATH="/usr/bin" +OPENOCD_PATH="/usr/local/bin" + +# TARGET_PATH="/home/OpenOCD/openocd/tcl" +# TARGET_PATH="/usr/share/openocd/scripts" +TARGET_PATH="/usr/local/share/openocd/scripts" + +# Assume a Unix development environment. Uncomment to use a Windows +# like environment + +# OPENOCD_EXE=openocd.exe +OPENOCD_EXE=openocd + +OPENOCD_CFG="${TOPDIR}/configs/lm4f120-launchpad/tools/lm4f120-launchpad.cfg" +OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" + +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" +cd ${OPENOCD_PATH} || { echo "Failed to CD to ${OPENOCD_PATH}"; exit 1; } +${OPENOCD_EXE} ${OPENOCD_ARGS} & +echo "OpenOCD daemon started" +ps -ef | grep openocd +echo "In GDB: target remote localhost:3333" + |