diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-03 03:32:48 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-05-03 03:32:48 +0000 |
commit | 2e25934ad05dbfc7d1bdd3448dc8e898e8144f8a (patch) | |
tree | 0b7a58dfd15481ad7da90496e795f01c1a77bc34 /nuttx/configs/olimex-strp711 | |
parent | f98d12c0f266b9059683a08959f6c3c005bbded2 (diff) | |
download | px4-nuttx-2e25934ad05dbfc7d1bdd3448dc8e898e8144f8a.tar.gz px4-nuttx-2e25934ad05dbfc7d1bdd3448dc8e898e8144f8a.tar.bz2 px4-nuttx-2e25934ad05dbfc7d1bdd3448dc8e898e8144f8a.zip |
Initial debugging fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2648 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/olimex-strp711')
-rw-r--r-- | nuttx/configs/olimex-strp711/README.txt | 37 | ||||
-rwxr-xr-x | nuttx/configs/olimex-strp711/scripts/oocd.sh | 36 | ||||
-rwxr-xr-x | nuttx/configs/olimex-strp711/scripts/oocd_ft2xx.cfg | 37 | ||||
-rw-r--r-- | nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg | 47 |
4 files changed, 99 insertions, 58 deletions
diff --git a/nuttx/configs/olimex-strp711/README.txt b/nuttx/configs/olimex-strp711/README.txt index 8eaf3224e..12cdaaef5 100644 --- a/nuttx/configs/olimex-strp711/README.txt +++ b/nuttx/configs/olimex-strp711/README.txt @@ -287,6 +287,43 @@ ENC28J60 Module UART3, I2C cannot be used with SPI0. The GPIOs selected for the ENC28J60 interrupt conflict with TIM1. +Using OpenOCD and GDB +^^^^^^^^^^^^^^^^^^^^^ + + I have been using the Olimex ARM-USB-OCD JTAG debugger with the STR-P711 + (http://www.olimex.com). The OpenOCD configuration file is here: + scripts/oocd_ft2xx.cfg. There is also a script on the scripts/ 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 + + The setenv.sh file includes some environment varialble settings + that are needed by oocd.sh. If you have $PATH and other environment + variables set up, then you should be able to start the OpenOCD daemon like: + + oocd.sh + + Where it is assumed that you are executing oocd.sh from the top level + directory where NuttX is installed. + + Once the OpenOCD daemon has been started, you can connect to it via + GDB using the following GDB command: + + arm-elf-gdb + (gdb) target remote localhost:3333 + + And you can load the NuttX ELF file: + + (gdb) load nuttx + + (There are also some files in the scripts/ directory that I used to + get OpenOCD working with a Wriggler clone... I never got that stuff + working). + Configurations: --------------- diff --git a/nuttx/configs/olimex-strp711/scripts/oocd.sh b/nuttx/configs/olimex-strp711/scripts/oocd.sh index 44ff4fa6f..556d97798 100755 --- a/nuttx/configs/olimex-strp711/scripts/oocd.sh +++ b/nuttx/configs/olimex-strp711/scripts/oocd.sh @@ -2,8 +2,17 @@ # Set up pathes to binaries, scripts, configuration files -installdir=/usr/local/bin -openocd=$installdir/openocd +hostos=`uname -o` +if [ "X${hostos}" = "XCygwin" ]; then + installdir=/cygdrive/c/gccfd/openocd/bin + ft2exe=$installdir/openocd-ftd2xx.exe + ppexe=$installdir/openocd-ppdev.exe +else + installdir=/usr/local/bin + ft2exe=$installdir/openocd + ppexe=$installdir/openocd + SUDO=sudo +fi # The root to the top-level NuttX directory should be in an environment variable @@ -15,7 +24,7 @@ if [ -z $STR41XSCRIPTS ]; then fi # Check that at least one configuration file exists at that point -if [ ! -f $STR41XSCRIPTS/oocd_wiggler.cfg ]; then +if [ ! -f $STR41XSCRIPTS/oocd_ft2xx.cfg ]; then echo "No configuration files found at $STR41XSCRIPTS" echo "Path to configuration files unknown" exit 1 @@ -23,11 +32,11 @@ fi # Parse command line inputs -usage="USAGE: $0 [-h] [-d] [-pp] [-ftdi]" +usage="USAGE: $0 [-h] [-d] [-pp] [-ft2xx]" debug=no -interface=pp -oocdcfg=$STR41XSCRIPTS/oocd_wiggler.cfg +oocdcfg=$STR41XSCRIPTS/oocd_ft2xx.cfg +openocd=$ft2exe while [ ! -z "$1" ]; do case $1 in -d ) @@ -35,12 +44,12 @@ while [ ! -z "$1" ]; do set -x ;; -pp ) - interface=pp oocdcfg=$STR41XSCRIPTS/oocd_wiggler.cfg + openocd=$ppexe ;; - -ftdi ) - interface=ftdi - oocdcfg=$STR41XSCRIPTS/oocd_ftdi.cfg + -ft2xx ) + oocdcfg=$STR41XSCRIPTS/oocd_ft2xx.cfg + openocd=$ft2exe ;; -h ) echo $usage @@ -62,4 +71,9 @@ export options="-d 1" # Run OpenOCD -- here it is assumed (1) that you must have root priveleges to # execute OpenOCD and (2) that your user is listed in the /etc/sudoers file. -sudo $openocd $options -f $oocdcfg +$SUDO $openocd $options -f $oocdcfg +if [ "X${hostos}" = "XCygwin" ]; then + $openocd $options -f `cygpath -w $oocdcfg` +else + sudo $openocd $options -f $oocdcfg +fi diff --git a/nuttx/configs/olimex-strp711/scripts/oocd_ft2xx.cfg b/nuttx/configs/olimex-strp711/scripts/oocd_ft2xx.cfg new file mode 100755 index 000000000..a5c027bff --- /dev/null +++ b/nuttx/configs/olimex-strp711/scripts/oocd_ft2xx.cfg @@ -0,0 +1,37 @@ +#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 0
+
+#use combined on interfaces or targets that can't set TRST/SRST separately
+reset_config trst_and_srst srst_pulls_trst
+
+#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 arm7tdmi <reset mode> <chainpos> <endianness> <variant>
+target arm7tdmi little run_and_halt 0 arm7tdmi
+run_and_halt_time 0 30
+
+working_area 0 0x2000C000 0x4000 nobackup
+
+#flash bank <driver> <base> <size> <chip_width> <bus_width>
+flash bank str7x 0x40000000 0x00040000 0 0 0 STR71x
+#flash bank cfi 0x60000000 0x00400000 2 2 0
+
+#Script used for FLASH programming
+#target_script 0 reset str71x_flashprogram.ocd
+
+# For more information about the configuration files, take a look at:
+# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg b/nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg deleted file mode 100644 index edfccaf57..000000000 --- a/nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg +++ /dev/null @@ -1,47 +0,0 @@ -# Daemon configuration -telnet_port 4444 -gdb_port 3333 - -# Interface - FTDI JTAG-device (see /usr/local/lib/openocd/interface/jtagkey.cfg) -interface ft2232 -ft2232_device_desc "Amontec JTAGkey A" -ft2232_layout jtagkey -ft2232_vid_pid 0x0403 0xcff8 -jtag_speed 0 -jtag_nsrst_delay 200 -jtag_ntrst_delay 200 - -# Start the OpenOCD daemon and reset the processor -init -reset halt - -# (See /usr/local/lib/openocd/target/str710.cfg) -# Start slow, speed up after reset -jtag_khz 10 - -# Use combined on interfaces or targets that can't set TRST/SRST separately -reset_config trst_and_srst srst_pulls_trst - -# Jtag scan chain -# format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) -jtag_device 4 0x1 0xf 0xe - -# target <type> <startup mode> -# target arm7tdmi <reset mode> <chainpos> <endianness> <variant> -target arm7tdmi little 0 arm7tdmi -[new_target_name] configure -event reset-start { jtag_khz 10 } -[new_target_name] configure -event reset-init { jtag_khz 6000 } -[new_target_name] configure -event old-gdb_program_config { script event/str710_program.script } - -target_script 0 reset oocd_flash.script - -# Flash-configuration STR710FZ2/STR711FR2: -# internal flash at address 0x40000000 size 256kB (0x40000) -# internal ram at address 0x20000000 size 64kB (0x10000) -# a 16kB working area inside RAM: -working_area 0 0x2000C000 0x4000 nobackup - -# Flash bank str7x <base> <size> 0 0 <target#> <variant> -flash bank str7x 0x40000000 0x00040000 0 0 0 STR71x -flash bank str7x 0x400C0000 0x00004000 0 0 0 STR71x - |