Skip to content

Commit 119cdb8

Browse files
committed
jlink-scripts: reset before load
1 parent e74e3b8 commit 119cdb8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

scripts/jlink-bootloader.gdb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Connect to jlink gdb server
22
target extended-remote :2331
33

4-
# load the firmware into ROM
5-
load
4+
# It seems more reliable to reset the chip before loading the new firmware. It
5+
# is also how they do it in the example in the wiki:
6+
# https://kb.segger.com/J-Link_GDB_Server#Console
67

78
# Reset the CPU
89
monitor reset
910

11+
# load the firmware into ROM
12+
load
13+
1014
#break Reset_Handler
1115
#break HardFault_Handler
1216
#break NMI_Handler

scripts/jlink.gdb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Connect to jlink gdb server
22
target extended-remote :2331
33

4-
# load the firmware into ROM
5-
load
4+
# It seems more reliable to reset the chip before loading the new firmware. It
5+
# is also how they do it in the example in the wiki:
6+
# https://kb.segger.com/J-Link_GDB_Server#Console
67

78
# Reset the CPU
89
monitor reset
910

11+
# load the firmware into ROM
12+
load
13+
1014
# Set VTOR (Vector Table Offset Register) to where the firmware is located
1115
set *(uint32_t*)0xE000ED08=0x10000
1216
# Set stack pointer to initial stack pointer according to exception table.

0 commit comments

Comments
 (0)