mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Add configuration of Olimex-STR-P711
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1103 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -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
|
||||
Executable
+65
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user