arm scripts: Add new openocd gdb and flash scripts
[bertos.git] / bertos / cpu / arm / scripts / at91sam7_write_to_flash.script
1 #\r
2 # The following command wills be executed on\r
3 # reset (because of run_and_init in the config-file)\r
4 # - halt target\r
5 # - init ecr\r
6 # - flash content of file main.bin into target-memory\r
7 # - shutdown openocd\r
8 #\r
9 # created by Martin Thomas\r
10 # http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects\r
11 # based on information from Dominic Rath\r
12 # modified for latest oocd - 4/29/09  -jkl\r
13 #\r
14 \r
15 halt\r
16 sleep 10\r
17 \r
18 # moved from below\r
19 # AT91SAM7 flash command-"batch"\r
20 # adapted by Martin Thomas based on information from Dominic Rath - Thanks\r
21 arm7_9 dcc_downloads enable\r
22 \r
23 # added from internet script\r
24 armv4_5 core_state arm\r
25 arm7_9 fast_memory_access enable\r
26 # end added from script\r
27 # end moved section\r
28 \r
29 # Init - taken from the script openocd_at91sam7_ecr.script\r
30 mww 0xfffffd44 0x00008000  # disable watchdog\r
31 mww 0xfffffd08 0xa5000001  # enable user reset\r
32 mww 0xfffffc20 0x00000601  # CKGR_MOR : enable the main oscillator\r
33 sleep 10\r
34 mww 0xfffffc2c 0x00481c0e   # CKGR_PLLR: 96.1097 MHz\r
35 sleep 10\r
36 mww 0xfffffc30 0x00000007  # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz\r
37 sleep 10\r
38 mww 0xffffff60 0x003c0100  # MC_FMR: flash mode (FWS=1,FMCN=60)\r
39 # arm7_9 force_hw_bkpts enable  # program resides in flash\r
40 sleep 10\r
41 \r
42 # section was here\r
43 \r
44 poll\r
45 flash probe 0\r
46 # added from script on internet\r
47 #flash protect 0 0 31 off\r
48 #flash erase_sector 0 0 31\r
49 #flash erase_sector 0 0 31\r
50 # end add from script\r
51 #flash write_bank 0 blink1ROM_rom.bin 0x0\r
52 flash write_image ../../../../images/at91sam7s.bin 0x0100000 bin\r
53 \r