blob: 7d79615772ba66a29175f93d5d320b9d51343b4c [file] [log] [blame]
Harald Welte3f5e3dd2017-02-27 13:53:17 +01001#*******************************************************
2#
3# Connect to J-Link and debug application in flash.
4#
5
6# define 'reset' command
7define reset
8
9# Connect to the J-Link gdb server
10target remote localhost:2331
11# Reset the chip to get to a known state
12monitor reset
13
14# Select flash device
15monitor flash device = AT91SAM3S4C
16# Enable flash download and flash breakpoints
17monitor flash download = 1
18# Load the program
19load
20
21# Reset peripheral (RSTC_CR)
22set *0x400e1400 = 0xA5000004
23
24# Initializing PC and stack pointer
25mon reg sp=(0x400000)
26set *0x400004 = *0x400004 & 0xFFFFFFFE
27mon reg pc=(0x400004)
28info reg
29
30# end of 'reset' command
31end