diff --git a/scripts/jlink-bootloader.gdb b/scripts/jlink-bootloader.gdb index a7629aaf46..514c3e4193 100644 --- a/scripts/jlink-bootloader.gdb +++ b/scripts/jlink-bootloader.gdb @@ -1,12 +1,16 @@ # Connect to jlink gdb server target extended-remote :2331 -# load the firmware into ROM -load +# It seems more reliable to reset the chip before loading the new firmware. It +# is also how they do it in the example in the wiki: +# https://kb.segger.com/J-Link_GDB_Server#Console # Reset the CPU monitor reset +# load the firmware into ROM +load + #break Reset_Handler #break HardFault_Handler #break NMI_Handler diff --git a/scripts/jlink.gdb b/scripts/jlink.gdb index 4a9cf9fd0b..899c13530f 100644 --- a/scripts/jlink.gdb +++ b/scripts/jlink.gdb @@ -1,12 +1,16 @@ # Connect to jlink gdb server target extended-remote :2331 -# load the firmware into ROM -load +# It seems more reliable to reset the chip before loading the new firmware. It +# is also how they do it in the example in the wiki: +# https://kb.segger.com/J-Link_GDB_Server#Console # Reset the CPU monitor reset +# load the firmware into ROM +load + # Set VTOR (Vector Table Offset Register) to where the firmware is located set *(uint32_t*)0xE000ED08=0x10000 # Set stack pointer to initial stack pointer according to exception table.