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