From 8760253ef58f5ee8ef32861c19fdaf8d9163ffd4 Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 3 Dec 2008 13:58:36 +0000 Subject: [PATCH] Add script for the latest version of openocd. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1966 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/arm/scripts/at91sam7_new.gdb | 35 +++++++++++++ .../scripts/openocd_new_at91sam7_ftdi_ram.cfg | 49 ++++++++++++++++++ .../scripts/openocd_new_at91sam7_ftdi_rom.cfg | 50 +++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 bertos/cpu/arm/scripts/at91sam7_new.gdb create mode 100644 bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_ram.cfg create mode 100644 bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_rom.cfg diff --git a/bertos/cpu/arm/scripts/at91sam7_new.gdb b/bertos/cpu/arm/scripts/at91sam7_new.gdb new file mode 100644 index 00000000..0c4258f8 --- /dev/null +++ b/bertos/cpu/arm/scripts/at91sam7_new.gdb @@ -0,0 +1,35 @@ +target remote localhost:3333 +monitor reset +monitor sleep 500 +monitor poll +monitor soft_reset_halt + +# WDT_MR, disable watchdog +monitor mww 0xFFFFFD44 0x00008000 + +# RSTC_MR, enable user reset +monitor mww 0xfffffd08 0xa5000001 + +# CKGR_MOR +monitor mww 0xFFFFFC20 0x00000601 +monitor sleep 10 + +# CKGR_PLLR +monitor mww 0xFFFFFC2C 0x00481c0e +monitor sleep 10 + +# PMC_MCKR +monitor mww 0xFFFFFC30 0x00000007 +monitor sleep 10 + +# PMC_IER +monitor mww 0xFFFFFF60 0x00480100 +monitor sleep 100 + +#Remap RAM to address 0 +monitor mww 0xFFFFFF00 0x00000001 +monitor sleep 100 + +break main +load +continue diff --git a/bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_ram.cfg b/bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_ram.cfg new file mode 100644 index 00000000..ff1d23ea --- /dev/null +++ b/bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_ram.cfg @@ -0,0 +1,49 @@ + +# Change the default telnet port... +telnet_port 4444 + +# Port for TCL connection. +tcl_port 6666 + +# GDB connects here +gdb_port 3333 +# GDB can also flash my flash! +gdb_memory_map enable +gdb_flash_program disable +gdb_breakpoint_override soft + +interface ft2232 +#ft2232_device_desc "Amontec JTAGkey" +ft2232_layout jtagkey +ft2232_vid_pid 0x0403 0xcff8 + +#use combined on interfaces or targets that can't set TRST/SRST separately +reset_config srst_only srst_pulls_trst + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME sam7 +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x3f0f0f0f +} + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi + +$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0 + +#flash bank +flash bank at91sam7 0 0 0 0 0 diff --git a/bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_rom.cfg b/bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_rom.cfg new file mode 100644 index 00000000..387b26a5 --- /dev/null +++ b/bertos/cpu/arm/scripts/openocd_new_at91sam7_ftdi_rom.cfg @@ -0,0 +1,50 @@ + +# Change the default telnet port... +telnet_port 4444 + +# Port for TCL connection. +tcl_port 6666 + +# GDB connects here +gdb_port 3333 +# GDB can also flash my flash! +gdb_memory_map enable +gdb_flash_program enable +gdb_breakpoint_override hard + +interface ft2232 +#ft2232_device_desc "Amontec JTAGkey" +ft2232_layout jtagkey +ft2232_vid_pid 0x0403 0xcff8 + + +#use combined on interfaces or targets that can't set TRST/SRST separately +reset_config srst_only srst_pulls_trst + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME sam7 +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x3f0f0f0f +} + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi + +$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0 + +#flash bank +flash bank at91sam7 0 0 0 0 0 -- 2.25.1