aboutsummaryrefslogtreecommitdiffstats
path: root/boards/base/Olimex-SAM7EX256-GE8/example/openocd.cfg
blob: 8c58e6f09cd770d1047d9118e15d44c10e3029ae (plain)
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
# This is a script file for OpenOCD 0.7.0
#
# It is set up for the Olimex SAM7EX256 board using the Olimex Tiny-H JTAG adaptor.
#
# Assuming the current directory is your project directory containing this openocd.cfg file...
#
# To program your device:
#
#	openocd -f openocd.cfg -c "Burn yourfile.bin" -c shutdown
#
# To debug your device:
#
#	openocd
#	(This will run openocd in gdb server debug mode. Leave it running in the background)
#
#	gdb yourfile.elf
#	(To start gdb. Then run the following commands in gdb...)
#
#	target remote 127.0.0.1:3333
#	monitor Debug
#	stepi
#	(This last stepi resynchronizes gdb).
#
# If you want to reprogram from within gdb:
#
#	monitor Burn yourfile.bin
#

echo ""
echo "##### Loading debugger..."
source [find interface/olimex-arm-usb-tiny-h.cfg]
#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]

echo ""
echo "##### Loading CPU..."
source [find target/at91sam7x256.cfg]

echo ""
echo "##### Configuring..."
jtag_rclk 3000
arm7_9 dcc_downloads enable
arm7_9 fast_memory_access enable
# flash protect 0 0 1 off
#gdb_breakpoint_override hard
arm7_9 dbgrq enable

proc Debug { } {
	echo ""
	echo "##### Debug Session Connected..."
	soft_reset_halt
	reg pc 0x00100000
	echo "Ready..."
}

proc Burn {file} {
	echo ""
	echo "##### Burning $file to device..."
	halt
	flash write_image erase unlock $file 0x00100000
	reset
	echo "Burning Complete!"
}

echo ""
echo "##### Leaving Configuration Mode..."
init
soft_reset_halt
$_TARGETNAME invoke-event reset-init
flash probe 0
flash banks

echo ""
echo "##### Waiting for debug connections..."