blob: 019bd0a94b9fc64d5abb53f017e5a84753f071cc [file] [log] [blame]
Harald Welte3f5e3dd2017-02-27 13:53:17 +01001#*************************************************
2#
3# Connect to J-Link and debug application in sram on SAM3S
4#
5# Note:
6# First, users should modify Step1 and Step2 according to their project,
7# then do Step3.
8
9# Step1: Connect to the J-Link gdb server
10define reset
11target remote localhost:2331
12monitor reset
13
14# Step2: Load file(eg. getting-started project)
15load
16
17# Step3: Reset peripheral (RSTC_CR)
18set *0x400e1400 = 0xA5000004
19
20# Step4: Initializing PC and stack pointer
21# Modify pc value to even before writing pc register
22mon reg sp=(0x20000000)
23set *0x20000004 = *0x20000004 & 0xFFFFFFFE
24mon reg pc=(0x20000004)
25info reg
26
27end