Skip to content

Commit 6f5e9ab

Browse files
committed
Manually set the PC after reset
Manually set the Program Counter to the Reset_Handler after reset. This enables smooth debugging on parts with a secure bootloader. If a secure part is reset, it enters into the secure bootloader verification in ROM, which will prevent unsigned applications we've flashed from running after reset. However, the SWD port is always held open, so we can move the program counter into the Reset_Handler manually to work around this. This enables debugging the flashed application on secure parts for development. Additionally, this should be a transparent change for the non-secure parts, which don't have any ROM. A traditional reset will place the program counter into the Reset_Handler anyways.
1 parent 414d24d commit 6f5e9ab

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

MaximSDK/Inject/.vscode/c_cpp_properties.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"intelliSenseMode": "gcc-arm",
1212
"compilerPath": "${config:ARM_GCC_path}/bin/arm-none-eabi-gcc.exe",
1313
"browse": {
14-
"path": [
14+
"path": [
1515
"${default}"
1616
]
1717
}

MaximSDK/Inject/.vscode/launch.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
{ "text":"symbol-file build/${config:symbol_file}" },
4747
{ "text":"target remote localhost:3333" },
4848
{ "text":"monitor reset halt" },
49+
{ "text":"set $pc=Reset_Handler"},
4950
{ "text":"b main" }
5051
]
5152
},

MaximSDK/New_Project/.vscode/launch.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
{ "text":"symbol-file build/${config:symbol_file}" },
4747
{ "text":"target remote localhost:3333" },
4848
{ "text":"monitor reset halt" },
49+
{ "text":"set $pc=Reset_Handler"},
4950
{ "text":"b main" }
5051
]
5152
},

MaximSDK/Template/.vscode/launch.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
{ "text":"symbol-file build/${config:symbol_file}" },
4747
{ "text":"target remote localhost:3333" },
4848
{ "text":"monitor reset halt" },
49+
{ "text":"set $pc=Reset_Handler"},
4950
{ "text":"b main" }
5051
]
5152
},

0 commit comments

Comments
 (0)