Harald Welte | 3f5e3dd | 2017-02-27 13:53:17 +0100 | [diff] [blame] | 1 | #************************************************* |
| 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 |
| 10 | define reset |
| 11 | target remote localhost:2331 |
| 12 | monitor reset |
| 13 | |
| 14 | # Step2: Load file(eg. getting-started project) |
| 15 | load |
| 16 | |
| 17 | # Step3: Reset peripheral (RSTC_CR) |
| 18 | set *0x400e1400 = 0xA5000004 |
| 19 | |
| 20 | # Step4: Initializing PC and stack pointer |
| 21 | # Modify pc value to even before writing pc register |
| 22 | mon reg sp=(0x20000000) |
| 23 | set *0x20000004 = *0x20000004 & 0xFFFFFFFE |
| 24 | mon reg pc=(0x20000004) |
| 25 | info reg |
| 26 | |
| 27 | end |