Skip to content

Commit c5c09e1

Browse files
committed
Runs OK on nrf52
1 parent 1934579 commit c5c09e1

File tree

13 files changed

+3254
-3095
lines changed

13 files changed

+3254
-3095
lines changed

.vscode/launch-nrf52.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
// VSCode Debugger Config for Cortex Debug Extension. We use Cortex Debug because it shows more details, e.g. the STM32 Peripherals.
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
// Cortex Debug Configuration: https://marcelball.ca/projects/cortex-debug/cortex-debug-launch-configurations/
7+
"name": "nRF52832",
8+
"type": "cortex-debug",
9+
"request": "launch",
10+
// OpenOCD path is defined in workspace.code-workspace.
11+
"servertype": "openocd",
12+
"cwd": "${workspaceRoot}",
13+
// Application Executable to be flashed to Blue Pill before debugging. Note that the Application ELF image does not contain a valid Image Header. So we must bypass the Bootloader, shown below.
14+
"executable": "bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf",
15+
// For Bootloader: "executable": "bin/targets/stm32l4_boot/app/apps/boot/boot.elf",
16+
"device": "nRF52832",
17+
// Arm System View Description, downloaded from https://www.st.com/en/microcontrollers-microprocessors/stm32l476rc.html#
18+
"svdFile": "scripts/STM32L4x6.svd",
19+
"configFiles": [
20+
// Tell OpenOCD to open the ST Link connection to STM32 MCU.
21+
"interface/stlink-v2.cfg",
22+
"target/nrf52.cfg",
23+
// Tell OpenOCD to run our custom debug commands.
24+
"scripts/nrf52/debug.ocd"
25+
],
26+
"preLaunchCommands": [
27+
// Before loading the Application, run these gdb commands.
28+
// Set timeout for executing openocd commands.
29+
"set remotetimeout 60",
30+
31+
// This indicates that an unrecognized breakpoint location should automatically result in a pending breakpoint being created.
32+
"set breakpoint pending on"
33+
34+
// Display the Arm instruction when hitting breakpoint.
35+
// "display/i $pc",
36+
37+
// Load Bootloader symbols in case we jump to the Bootloader.
38+
// "symbol-file bin/targets/bluepill_boot/app/apps/boot/boot.elf",
39+
40+
// Restore Application symbols.
41+
// "symbol-file bin/targets/bluepill_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf",
42+
],
43+
"postLaunchCommands": [
44+
// After loading the Application, run these gdb commands. The Application ELF image does not contain a valid Image Header.
45+
// If not using the Stub Bootloader boot_stub, we need to bypass the Bootloader and jump to the Application directly:
46+
// "stepi", // Must step before setting PC
47+
// "set $pc = Reset_Handler", // Prepare to jump to the Application's Reset Handler
48+
// "stepi", // Execute the Reset Handler
49+
"break main", // Break at main()
50+
"break __assert_func", // Break for any assert failures
51+
"break os_default_irq" // Break for any unhandled interrupts
52+
],
53+
"preRestartCommands": [
54+
],
55+
"postRestartCommands": [
56+
]
57+
}
58+
]
59+
}

.vscode/launch.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,24 @@
44
"configurations": [
55
{
66
// Cortex Debug Configuration: https://marcelball.ca/projects/cortex-debug/cortex-debug-launch-configurations/
7-
"name": "STM32L476RCT6",
7+
"name": "nRF52832",
88
"type": "cortex-debug",
99
"request": "launch",
1010
// OpenOCD path is defined in workspace.code-workspace.
1111
"servertype": "openocd",
1212
"cwd": "${workspaceRoot}",
1313
// Application Executable to be flashed to Blue Pill before debugging. Note that the Application ELF image does not contain a valid Image Header. So we must bypass the Bootloader, shown below.
14-
"executable": "bin/targets/stm32l4_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf",
14+
"executable": "bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.elf",
1515
// For Bootloader: "executable": "bin/targets/stm32l4_boot/app/apps/boot/boot.elf",
16-
"device": "STM32L476RCT6",
16+
"device": "nRF52832",
1717
// Arm System View Description, downloaded from https://www.st.com/en/microcontrollers-microprocessors/stm32l476rc.html#
1818
"svdFile": "scripts/STM32L4x6.svd",
1919
"configFiles": [
2020
// Tell OpenOCD to open the ST Link connection to STM32 MCU.
2121
"interface/stlink-v2.cfg",
22-
// Previously: "target/stm32f1x.cfg",
23-
"target/stm32l4x.cfg",
22+
"target/nrf52.cfg",
2423
// Tell OpenOCD to run our custom debug commands.
25-
// Previously: "scripts/debug.ocd"
26-
"scripts/stm32l4/debug.ocd"
24+
"scripts/nrf52/debug.ocd"
2725
],
2826
"preLaunchCommands": [
2927
// Before loading the Application, run these gdb commands.

0 commit comments

Comments
 (0)