Hi! I am trying to configure openocd to run it fom my Makefile. Running it manually works:
===== begin openocd session ===== % nc localhost 4444 ��������Open On-Chip Debugger > halt halt target state: halted target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x20000053 pc: 0x00100544 > mww 0xfffffd44 0x00008000 # disable watchdog > mww 0xfffffd08 0xa5000001 # enable user reset > mww 0xfffffc20 0x00000601 # CKGR_MOR : enable the main oscillator > sleep 10 > mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz > sleep 10 > mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz > sleep 10 > mww 0xffffff60 0x003c0100 # MC_FMR: flash mode (FWS=1,FMCN=60) > sleep 100 > halt > sleep 10 > arm7_9 dcc_downloads enable dcc downloads are enabled > sleep 10 > poll background polling: on TAP: sam7se256.cpu (enabled) target state: halted target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x20000053 pc: 0x00100544 > flash probe 0 flash 'at91sam7' found at 0x00100000 > flash write_bank 0 glow_flash.bin 0x0 flash write_bank 0 glow_flash.bin 0x0 wrote 2636 byte from file glow_flash.bin to flash bank 0 at offset 0x00000000 in 0.328994s (7.824516 kb/s) > reset run reset run JTAG tap: sam7se256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3) > ====== end openocd session ====== I used the configs from: scripts/interface/olimex-arm-usb-ocd.cfg scripts/target/sam7se512.cfg (modified for se256) and a board-config that basically contains "reset_config srst_only srst_pulls_trst" Now I am trying to write a script to run from a Makefile. ===== begin openocd script ===== proc mt_flash_bin {IMGFILE} { # disable watchdog mww 0xfffffd44 0x00008000 # enable user reset mww 0xfffffd08 0xa5000001 # CKGR_MOR : enable the main oscillator mww 0xfffffc20 0x00000601 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 dcc_downloads enable sleep 10 flash write_image erase $IMGFILE reset run sleep 10 } ====== end openocd script ====== Running this with openocd -f openocd/openocd.cfg -f openocd/olimex-arm-usb-ocd.cfg -f openocd/openocd-sam7s256.cfg -c "mt_flash_bin glow_flash.bin" I get: ===== begin openocd output ===== Warn : use 'sam7se256.cpu' as target identifier, not '0' Unknown command: mww 0xfffffd44 0x00008000 ====== end openocd output ====== What am I missing there? Everything was tested with openocd-svn2790. Is there any documentation or any examples on this? http://openfacts.berlios.de/index-en.phtml?title=OpenOCD_scripts seems to be for the old config-format, and http://openocd.berlios.de/doc/pdf/openocd.pdf seems to contain only a tcl language tutorial, but no usable examples (same for the source). Timo _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development