summaryrefslogtreecommitdiff
path: root/nuttx/configs/olimex-strp711/scripts
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-10-30 00:23:38 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-10-30 00:23:38 +0000
commitc058a350b45a55781747bf66bd45c04440d87853 (patch)
tree9dac8e87c98ce58e6447516b52c6067c9b08e33b /nuttx/configs/olimex-strp711/scripts
parentd7af179dc5084d978ab182940514f5ac99c7c973 (diff)
downloadpx4-nuttx-c058a350b45a55781747bf66bd45c04440d87853.tar.gz
px4-nuttx-c058a350b45a55781747bf66bd45c04440d87853.tar.bz2
px4-nuttx-c058a350b45a55781747bf66bd45c04440d87853.zip
Add configuration of Olimex-STR-P711
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1103 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/olimex-strp711/scripts')
-rw-r--r--nuttx/configs/olimex-strp711/scripts/oocd-reset41
-rwxr-xr-xnuttx/configs/olimex-strp711/scripts/oocd.sh65
-rw-r--r--nuttx/configs/olimex-strp711/scripts/oocd_flash.script26
-rw-r--r--nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg47
-rw-r--r--nuttx/configs/olimex-strp711/scripts/oocd_wiggler.cfg46
5 files changed, 225 insertions, 0 deletions
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd-reset b/nuttx/configs/olimex-strp711/scripts/oocd-reset
new file mode 100644
index 000000000..11d7a3dd6
--- /dev/null
+++ b/nuttx/configs/olimex-strp711/scripts/oocd-reset
@@ -0,0 +1,41 @@
+#
+# The following command wills be executed on
+# reset (because of run_and_init in the config-file)
+# - wait for target halt
+# - erase memory
+# - flash content of file main.bin into target-memory
+# - shutdown openocd
+#
+# created by Martin Thomas 8/2007
+# http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects
+# based on information from Dominic Rath
+#
+
+arm7_9 dcc_downloads enable
+wait_halt
+sleep 10
+poll
+flash probe 0
+
+# STR710FZ2 erase all banks:
+#flash erase 0 0 9
+# STR710FZ2 erase first 5 banks (0-4)
+flash erase 0 0 4
+# if flash earse is not available in your OpenOCD-version use
+# flash erase_sector but also read the documentation on
+# flash auto_erase which can be used together with flash write_image
+
+flash write 0 main.bin 0x0
+# flash write may not be available in your OpenOCD-version
+# alternative: flash write_binary (flash write_binary <bank-num> <file> <offset>)
+# flash write_binary 0 main.bin 0x0
+# flash write_binary may not be available in your OpenOCD-version
+# alternatives: flash write_bank or flash write_image
+# syntax: flash write_image <file> [offset] [type] where type can
+# be ihex, bin, elf or s19
+# flash write_bank flash-bank bin-filename offset
+# i.e. flash write_bank 0 main.bin 0x0
+
+reset run
+sleep 10
+shutdown
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd.sh b/nuttx/configs/olimex-strp711/scripts/oocd.sh
new file mode 100755
index 000000000..9dbd16796
--- /dev/null
+++ b/nuttx/configs/olimex-strp711/scripts/oocd.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# Set up pathes to binaries, scripts, configuration files
+
+installdir=/usr/local/bin
+openocd=$installdir/openocd
+
+# The root to the top-level NuttX directory should be in an environment variable
+
+if [ -z $STR41XCFGS ]; then
+ echo "Environment variable $STR41XCFGS is not defined"
+ echo "Has NuttX been configured?"
+ echo "If so, try sourcing the setenv.sh script in the top-level directory"
+ exit 1
+fi
+
+# Check that at least one configuration file exists at that point
+if [ ! -f $STR41XCFGS/oocd_wiggler.cfg ]; then
+ echo "No configuration files found at $STR41XCFGS"
+ echo "Path to configuration files unknown"
+ exit 1
+fi
+
+# Parse command line inputs
+
+usage="USAGE: $0 [-h] [-d] [-pp] [-ftdi]"
+
+debug=no
+interface=pp
+oocdcfg=$STR41XCFGS/oocd_wiggler.cfg
+while [ ! -z "$1" ]; do
+ case $1 in
+ -d )
+ debug=yes
+ set -x
+ ;;
+ -pp )
+ interface=pp
+ oocdcfg=$STR41XCFGS/oocd_wiggler.cfg
+ ;;
+ -ftdi )
+ interface=ftdi
+ oocdcfg=$STR41XCFGS/oocd_ftdi.cfg
+ ;;
+ -h )
+ echo $usage
+ exit 0
+ ;;
+ * )
+ echo "Unrecognized option: $1"
+ echo $usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+# Setup debug options
+
+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
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd_flash.script b/nuttx/configs/olimex-strp711/scripts/oocd_flash.script
new file mode 100644
index 000000000..d07067544
--- /dev/null
+++ b/nuttx/configs/olimex-strp711/scripts/oocd_flash.script
@@ -0,0 +1,26 @@
+#
+# The following command will be executed on reset
+# - wait for target halt
+# - erase memory
+# - flash content of file nuttx.bin into target-memory
+# - shutdown openocd
+#
+# Based on file originally created by Martin Thomas
+#
+
+arm7_9 dcc_downloads enable
+wait_halt
+sleep 10
+poll
+flash probe 0
+
+# STR710 erase all banks:
+#flash erase 0 0 9
+# STR710 erase first 4 banks (32kB)
+flash erase 0 0 4
+
+flash write 0 nuttx.bin 0x0
+reset run
+sleep 10
+shutdown
+
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg b/nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg
new file mode 100644
index 000000000..f8c5d386e
--- /dev/null
+++ b/nuttx/configs/olimex-strp711/scripts/oocd_ftdi.cfg
@@ -0,0 +1,47 @@
+# 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
+
+# (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
+
+# Start the OpenOCD daemon and reset the processor
+init
+reset halt
+
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd_wiggler.cfg b/nuttx/configs/olimex-strp711/scripts/oocd_wiggler.cfg
new file mode 100644
index 000000000..c9f8d44bc
--- /dev/null
+++ b/nuttx/configs/olimex-strp711/scripts/oocd_wiggler.cfg
@@ -0,0 +1,46 @@
+# Daemon configuration
+telnet_port 4444
+gdb_port 3333
+
+# Interface - Wiggler-Type JTAG-device (see /usr/local/lib/openocd/interface/parport.cfg)
+interface parport
+parport_port 0x378
+parport_cable wiggler
+jtag_speed 0
+jtag_nsrst_delay 20
+jtag_ntrst_delay 20
+
+# (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
+
+# Start the OpenOCD daemon and reset the processor
+init
+reset halt
+