Rename openocd_at91sam7s_* to openocd_at91sam7_*.
[bertos.git] / cpu / arm / scripts / openocd_at91sam7_flash.script
diff --git a/cpu/arm/scripts/openocd_at91sam7_flash.script b/cpu/arm/scripts/openocd_at91sam7_flash.script
new file mode 100644 (file)
index 0000000..ccafad0
--- /dev/null
@@ -0,0 +1,38 @@
+# \r
+# The following command wills be executed on\r
+# reset (because of run_and_init in the config-file)\r
+# - halt target\r
+# - init ecr\r
+# - flash content of file main.bin into target-memory\r
+# - shutdown openocd\r
+#\r
+# created by Martin Thomas \r
+# http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects\r
+# based on information from Dominic Rath \r
+#\r
+\r
+halt\r
+sleep 10\r
+\r
+# Init - taken form the script openocd_at91sam7_ecr.script \r
+mww 0xfffffd44 0x00008000      # disable watchdog\r
+mww 0xfffffd08 0xa5000001      # enable user reset\r
+mww 0xfffffc20 0x00000601      # CKGR_MOR : enable the main oscillator\r
+sleep 10\r
+mww 0xfffffc2c 0x00481c0e      # CKGR_PLLR: 96.1097 MHz\r
+sleep 10\r
+mww 0xfffffc30 0x00000007      # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz\r
+sleep 10\r
+mww 0xffffff60 0x003c0100      # MC_FMR: flash mode (FWS=1,FMCN=60)\r
+# arm7_9 force_hw_bkpts enable # program resides in flash\r
+\r
+# AT91SAM7 flash command-"batch"\r
+# adapted by Martin Thomas based on information from Dominic Rath - Thanks\r
+arm7_9 dcc_downloads enable\r
+sleep 10\r
+poll\r
+flash probe 0\r
+flash write 0 ../../../images/at91sam7s.bin 0x0\r
+reset run\r
+sleep 10\r
+#shutdown\r