]> git.sur5r.net Git - openocd/blob - src/target/target/at91eb40a.tcl
tcl config script example
[openocd] / src / target / target / at91eb40a.tcl
1 #Script for AT91EB40a\r
2 \r
3 #Atmel ties SRST & TRST together, at which point it makes\r
4 #no sense to use TRST, but use TMS instead.\r
5 #\r
6 #The annoying thing with tying SRST & TRST together is that\r
7 #there is no way to halt the CPU *before and during* the\r
8 #SRST reset, which means that the CPU will run a number\r
9 #of cycles before it can be halted(as much as milliseconds).\r
10 openocd {reset_config srst_only srst_pulls_trst}\r
11  \r
12 #jtag scan chain\r
13 #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)\r
14 openocd {jtag_device 4 0x1 0xf 0xe}\r
15 \r
16 #target configuration\r
17 openocd {target arm7tdmi little 0 arm7tdmi-s_r4}\r
18 \r
19 # speed up memory downloads\r
20 openocd {arm7 fast_memory_access enable}\r
21 openocd {arm7_9 dcc_downloads enable}\r
22 \r
23 # OpenOCD does not have a flash driver for for AT91FR40162S \r
24 openocd {target_script 0 reset event/at91eb40a_reset.script}\r
25 \r
26 #flash driver\r
27 openocd {flash bank ecosflash 0x01000000 0x200000 2 2 0 ecos/at91eb40a.elf}\r
28 \r
29 # required for usable performance. Used for lots of\r
30 # other things than flash programming.\r
31 openocd {working_area 0 0x00000000 0x20000 nobackup}\r
32 \r
33 #force hardware values - we're running out of flash more\r
34 #often than not. The user can disable this in his\r
35 #subsequent config script.\r
36 openocd {arm7_9 force_hw_bkpts enable}\r
37 \r
38 set reset_count 0\r
39 \r
40 proc target_reset_0 {} {\r
41         global reset_count\r
42         # Reset script for AT91EB40a\r
43         openocd {reg cpsr 0x000000D3}           \r
44         openocd {mww 0xFFE00020 0x1}\r
45         openocd {mww 0xFFE00024 0x00000000}  \r
46         openocd {mww 0xFFE00000 0x01002539} \r
47         openocd {mww 0xFFFFF124 0xFFFFFFFF}  \r
48         openocd {mww 0xffff0010 0x100}\r
49         openocd {mww 0xffff0034 0x100}\r
50         set reset_count [expr $reset_count+1]\r
51         puts "Testing reset $reset_count !"\r
52 }\r