nrf52840 dongle debugging issue - debugging

I'm facing an issue to debug nrf52840 dongle rev 3.0 using a USB CDC application on top of BLE client application.
The same result was when using Fanstel based on nrf52840 connected via USB to the host as well.
In most cases unplugging and plunging the dongle force a target recovery after flashing the application.
When running the debugger it returns with the exception,
Cortex registers:
Disassembly viewer:
Using Cortex-Debug extension for VS Code. launch.jason as follows:
{
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/_build/nrf52840_xxaa.out",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
"device": "nrf52",
"interface": "swd",
"serialNumber": "",
"armToolchainPath": "/usr/local/gcc-arm-none-eabi-6-2017-q2-update/bin",
"svdFile": "${workspaceRoot}/modules/nrfx/mdk/nrf52840.svd",
}
]
}
When I use BLE client application or USB CDC application, the debugger runs without any problems.

Related

vscode unable to find executable for

I suddenly am unable to run and compile any code in Vscide, When I try I get the following error message.
unable to find executable for '</home/dennis/Programs/cpp/'
The launch.json reads
{
// 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": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
I am running linux mint 21.
It was working fine and then it suddenly stopped working. Something changed and I'm not sure what changed.
vscode about data.
Version: 1.73.0
Commit: 8fa188b2b301d36553cbc9ce1b0a146ccb93351f
Date: 2022-11-01T15:44:09.336Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-52-generic
Sandboxed: No
Can some one help me.
I tried running previouslly ran code that worked in vscode and they suddenly do not work

Debug a MPI code with Cmakefile in visual studio code

I am trying to debug an open-source C code with MPI. This open-source has it own Cmakefile. I enable the mpi and debug model with the instructions of the open-source in the terminal. After the executable file named gmx_mpi is created, I import the project to visual studio code. I can run the executable file in terminal with below command
mpirun -np 4 gmx_mpi mdrun -s diff.tpr -c diff.gro -ntomp 1
So I made below configurations to debug the code with MPI in the visual studio code.
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/usr/bin/mpirun",
"args": [
"-np",
"4",
"/home/fanli/workspace/gromacs_fh_debug/build/bin/gmx_mpi",
"mdrun",
"-s",
"diff.tpr",
"-deffnm",
"diff",
"-ntomp",
"1"
],
"stopAtEntry": false,
"cwd": "/home/fanli/workspace/protein_water/double/40ms",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
However, the code did not stop at the breakpoint I set, instead it run directly as if the it is in the release mode.
I googled a lot but did not find the solution.
Could anyone tell me how to debug the MPI code in visual studio code.
Currently, you cannot debug MPI code in vs code automatically and there is no extension to do so. See the issue below on GitHub for any change or update
GitHub
However, I found a workaround to duplicate the vs code window and attach the debugger manually:
YouTube

Problem setting up debug configuration to attach to a gdbserver in Vis.Code

I was trying to setup debug configuration to attach to already running gdbserver.
(ref used: https://code.visualstudio.com/docs/cpp/launch-json-reference)
[Note. I can attach and debug with an arch specific gdb instance fine to the gdbserver]
That's the template that has logic check deadlock.
{
"name": "(gdb) Attach to gdbserver in QEMU",
"type": "cppdbg",
"request": "attach",
"MIMode": "gdb",
"miDebuggerPath": "/path/to/gdb/../../bin/mips-mti-linux-gnu-gdb",
"miDebuggerServerAddress": "localhost: 1234",
"program": "${workspaceFolder}/__out--MIPS64r6_MTI/vmlinux",
// "processId": "${command:none}",
// "processId": "${command:pickProcess}",
// "processId": "23739",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
When no "processId" given, it complains:
unable to parse process id
When some valid "processId" given (and then some process also selected from the list, if demanded by UI), it complains:
'processId' cannot be used with miDebuggerServerAddress
Does anyone know how to resolve this deadlock in VC debug config parsing logic or this is a bug?
Thank you.
Ok. After several tries it worked ;)
Using the "request": "launch" (despite sounds a bit illogical, as we're attaching to already running process, just supplied with gdbserver i-face) without "processId" as advised in #577 bug discussion, the DB session was braking up initially with complain:
remote replied unexpectedly to 'vMustReplyEmpty': timeout, but eventually worked after repeated tries ;)
Note. For "lanuch" case, VC demanded also adding: "cwd": "${workspaceRoot}"
The VC+CPP-plugin support needs updating the instructions then (https://code.visualstudio.com/docs/cpp/launch-json-reference).
It sounds really illogical to use "request": "launch" to actually do the attach action :).

How to fix Electron App not rendering on some Windows Server Machines?

I installed my Electron Windows App on a fresh Windows 10, Windows Server 2016 Standard and Windows Server 2012 R2 Build 9600 and it is working fine. The connection to my websocket is also working.
On some machines with Windows Server 2016 Standard the app is not working as expected. I am just getting the windows border of the app but no content nor a menu. But the websocket connection of my app is working. ( i checked it with wireshark). so i guess it is a rendering problem?
Sadly i don't have access to the machines where the problem exists.
I assume same packages are missing?
screenshot with rendering problem:
Electron 5.0.2
Electron Store 3.2.0
Electron Prompt 1.3.1
I had the same issue as you mentioned, I solved it by generating a 32bit version of my Electron app for that Windows Server it did not work on.
Here is my build snippet from my package.json to generate both a 64 and a 32 bit version.
"build": {
"appId": "com.example.app",
"productName": "app",
"copyright": "Copyright © 2019",
"files": [
"build/**/*",
"node_modules/**/*"
],
"directories": {
"buildResources": "assets"
},
"win": {
"target": [
{
"target": "portable",
"arch": [
"x64",
"ia32"
]
}
],
"icon": "assets/app.ico"
}
},

Remote GDB session "Command Aborted"

I am using VSCode, writing code for a RPi. I have almost gotten it set up to use the integrated debugger, however, I am running into an issue where GDB says Command Aborted
Here is the ouput from the debug window in VSCode
<License and whatnot from GDB>
=cmd-param-changed,param="pagination",value="off"
Reading /lib/ld-linux.so.3 from remote target...
Reading /lib/ld-linux.so.3 from remote target...
Reading /lib/f72fb00897d4f06093d6f0451c9ca7d1f6e14c.debug from remote target...
Reading /lib/.debug/f72fb00897d4f06093d6f0451c9ca7d1f6e14c.debug from remote target...
0x76fce9e0 in ?? () from target:/lib/ld-linux.so.3
Loaded 'target:/lib/ld-linux.so.3'. Symbols loaded.
ERROR: Command aborted.
Here is the script I am using to setup gdbserver on the RPi (with the variable names excluded to protect my privacy).
ssh \
-L$port:localhost:$port $user#$remote \
"zsh -l -c './kill-gdbserver.sh && cd msat-pi* && ./waf && gdbserver :$port ./build/examples/onewire/onewire'"
And the relevant configuration from my launch.json
{
"name": "1w-Remote",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/examples/onewire/onewire",
"miDebuggerServerAddress": "localhost:8081",
"targetArchitecture": "arm",
"args": [],
"miDebuggerPath": "/usr/bin/gdb-arm",
"preLaunchTask": "waf-build",
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "gdb"
},
"windows": {
"MIMode": "gdb"
}
}
If I manually setup GDB locally, I get the same output, except, no Command Aborted message. I can then continue, which acts as I would expect (my program crashes on an unhandled exception).
Is there some way I can avoid this Command Aborted issue, or should I open an issue on the VSCode git?
Thank you
You have compiled your program without debugging information. Compile it with -g compiler and linker option.

Resources