# $Id$ # The following commands will be executed on # reset (because of run_and_init in the config-file) # - halt target # - init ecr # - flash content of file main.bin into target-memory # - shutdown openocd # # created by Martin Thomas # http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects # based on information from Dominic Rath # halt sleep 10 # WDTC_WDMR : disable watchdog mww 0xfffffd44 0x00008000 # RSTC_RMR : enable user reset mww 0xfffffd08 0xa5000001 # CKGR_MOR : enable the off-chip oscillator (MPW 2009-7-3) mww 0xfffffc20 0x00000602 sleep 10 # CKGR_PLLR: 96.1097 MHz mww 0xfffffc2c 0x00481c0e sleep 10 # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz mww 0xfffffc30 0x00000007 sleep 10 # MC_FMR: flash mode (FWS=1,FMCN=60) mww 0xffffff60 0x003c0100 sleep 100 # arm7_9 force_hw_bkpts enable # program resides in flash # AT91SAM7 flash command-"batch" # adapted by Martin Thomas based on information from Dominic Rath - Thanks arm7_9 dcc_downloads enable sleep 10 poll flash probe 0 #~ flash write 0 main.bin 0x0 # flash write is deprecated and my not be available in your OpenOCD-version, update to: # flash write_binary 0 main.bin 0x0 # flash write_binary is deprecated and my not be available in your OpenOCD-version, update to: # flash write_bank 0 main.bin 0x00 # also check flash write_image which can be uses together with flash auto_erase on flash write_image erase APP-esd-1-at91sam7s256-flash.elf 0 elf reset run sleep 10 shutdown