This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

VSCode Cortex-Debug Exception on the nrf52840 DK

Hello,

I understand that SES has a built in debugger functionality, but would like to implement debugging on VSCode using Cortex-Debug for a better workflow. I am experimenting with the blinky peripheral example, and have tried both the SDK3.2 version (on a rev 1.1.0 board), and the SDK4.1 version (on a rev 2.0.1 board).

Taking from the segger wiki page and slightly modifying the code, I have implemented the below code for my .vscode/launch.json file: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceFolder}",
"executable": "pca10056/blank/armgcc/_build/nrf52840_xxaa.out",
"serverpath": "C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
"device": "nrf52",
"interface": "swd",
"armToolchainPath": "C:/Program Files (x86)/GNU Tools ARM Embedded/7 2018-q2-update/bin/"
}
]
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Having written the launch.json, I run the cortex-debug debugger, and there is an immediate exception that is thrown, as seen below. The line seems to relate to the copying of information from ROM to RAM based off the __etext LMA.

Below is the debugger console. Also find attached the output text.

1
2
3
4
5
6
7
SEGGER J-Link GDB Server V6.88a Command Line Version
JLinkARM.dll V6.88a (DLL compiled Nov 18 2020 15:09:23)
Command line: -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nrf52
-----GDB Server start settings-----
GDBInit file: none
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The interesting thing to note is that if I am to ignore the error and continue the normal debug process, there are no immediate issues I can find and the running of the debugger operates just fine. However , I am running a very simple blinky.c program, so I am not sure if there will be problems down the line upon using more complex code.

Could you please advise if this is normal behavior and nothing to worry about, or if there is some error in the way I am trying to implement debugging.

Thank you,
Angry Oatmeal.