openocd-pttu.cfg
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
######
# parts taken from Martin Thomas
# http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html
#
set CPUTAPID 0x4f1f0f0f
jtag_speed 100
source [find cpu/lpc2387/tools/openocd-lpc2387.cfg]
fast disable
#
# scipts/macros/user commands - this is TCL (variant JIM):
#
proc mt_internal_rc {} {
jtag_khz 100
reset run
sleep 100
reset
halt
wait_halt 2
# PLL disconnect PLLCON
mww 0xE01FC080 0x01
mww 0xE01FC08C 0xAA
mww 0xE01FC08C 0x55
# PLL disable PLLCON
mww 0xE01FC080 0x00
mww 0xE01FC08C 0xAA
mww 0xE01FC08C 0x55
# no prescaler CCLKCFG
mww 0xE01FC104 0x00
# internal RC CLKSRCSEL
mww 0xE01FC10C 0x00
#### main oscil. CLKSRCSEL
#### mww 0xE01FC10C 0x01
# remap to internal flash
mww 0xE01FC040 0x01
sleep 100
jtag_khz 500
flash probe 0
}
proc mt_flash_bin {IMGFILE OFFSET} {
mt_internal_rc
flash write_image erase $IMGFILE $OFFSET
sleep 100
verify_image $IMGFILE $OFFSET
sleep 100
}
proc mt_flash_v {IMGFILE} {
mt_internal_rc
flash write_image erase $IMGFILE
sleep 100
verify_image $IMGFILE
sleep 100
}
proc mt_flash {IMGFILE} {
mt_internal_rc
flash write_image erase $IMGFILE
}
flash bank lpc2000 0x0 0x7d000 0 0 0 lpc2000_v2 4000 calc_checksum
arm7_9 dcc_downloads enable
gdb_flash_program enable
init
fast enable
jtag_khz 500
debug_level 1