2 # The following command wills be executed on
\r
3 # reset (because of run_and_init in the config-file)
\r
6 # - flash content of file main.bin into target-memory
\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
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
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
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
34 mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz
\r
36 mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
\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
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