I am experimenting with MCXN947 using MCUXpresso for VSCode.
Installed the components using MCUXpresso Installer v.1.2
Then I followed the excellent guide Getting Started with MCUXpresso for Visual Studio Code by @kyledando
I am able to build frdmmcxn947_hello_world
The board is connected via USB-C cable (J17 MCU-LINK) to the PC (USB Port)
And detected as MCU-LINK FRDM-MCXN947
$ lsusb
Bus 001 Device 087: ID 1fc9:0143 NXP Semiconductors MCU-LINK FRDM-MCXN947 (r0E7) CMSIS-DAP V3.128
Unfortunately when I try to debug it I get popup message showing "Unable to start debugging. Debug server process failed to initialize".
The message pretends to open launch.json
{
"configurations": [
{
"type": "cppdbg",
"name": "Debug project configuration",
"request": "launch",
"cwd": "${workspaceRoot}",
"MIMode": "gdb",
"setupCommands": [
{"text": "set remotetimeout 600"},
{"text": "set debug-file-directory"}
],
"program": "",
"miDebuggerServerAddress": "", // Remote GDB server address. If this is provided, "debugServerPath" will not be auto-completed.
"variables": {
"mcuxStopAtSymbol": "main", // Initial breakpoint
"mcuxSerialNumber": "HU4NSCTMxxxxx", // Probe serial number. If not specified, the one from the selected debug probe (in extension view) will be used.
"mcuxAttach": "false", // Start debug in attach mode
"mcuxRemoteProbeType": "", // Remote Probe Type ("LinkServer", "SEGGER", "PEmicro") used only when connecting to a remote server
"mcuxSkipBuildWhenDebug": "false" // Skip build when debug
},
"logging": {
"engineLogging": false
}
}
]
}
At this point I'm stuck and I can't figure out how to proceed.
Any help would be appreciated.
Thanks
Solved! Go to Solution.
Hi @marcocavallini,
The log does not contain relevant information. Additional info should be logged after:
...
[Warning] 1: (3221) STDERR: [2900]DEBUG:launcher.core.redlinkserv: [read] Loading "LS_preconnect_MCXN9XX.scp"
[Warning] 1: (3221) STDERR: [2900]DEBUG:launcher.core.redlinkserv: [write] run
Could you please try an erase first. This worked in a similar situation (see previous replies).
Thanks,
Nicu
Hi @cristiantepus @Pavel_Hernandez I'm trying to run debug session in VSCode. I have similar setup, except I'm using Windows OS.
I have similar issue, this is my launch.json file:
{
"configurations": [
{
"type": "cppdbg",
"name": "Debug project configuration",
"request": "launch",
"cwd": "${workspaceRoot}",
"MIMode": "gdb",
"setupCommands": [
{"text": "set remotetimeout 600"},
{"text": "set debug-file-directory"}
],
"program": "D:\\vscode\\projects\\embedded\\frdm-mcxn947\\frdmmcxn947_led_blinky\\armgcc\\debug\\led_blinky.elf",
"miDebuggerPath": "D:\\Program Files (x86)\\GNU Arm Embedded Toolchain\\10 2021.10\\bin\\arm-none-eabi-gdb.exe",
"miDebuggerArgs": "localhost:3333",
"variables": {
"mcuxStopAtSymbol": "main", // Initial breakpoint
"mcuxSerialNumber": "JUSOLFVVYXBVB", // Probe serial number. If not specified, the one from the selected debug probe (in extension view) will be used.
"mcuxAttach": "false", // Start debug in attach mode
"mcuxRemoteProbeType": "LinkServer", // Remote Probe Type ("LinkServer", "SEGGER", "PEmicro") used only when connecting to a remote server
"mcuxSkipBuildWhenDebug": "false" // Skip build when debug
},
"logging": {
"engineLogging": true
}
}
]
}
Hi @jwolinski ,
Can you please try an erase first (right click on project + erase, or, go to QuickStart Panel -> Flash Programmer -> Erase) then a debug again? Does this solve your connectivity issue?
Regards,
Cristian
Hello, sorry for the late response, I tried on mi Linux PC and at the first time have the same issue but then the VSCODE detect the board and I will start the Debug session.
{
"configurations": [
{
"type": "cppdbg",
"name": "Debug project configuration",
"request": "launch",
"cwd": "${workspaceRoot}",
"MIMode": "gdb",
"setupCommands": [
{
"text": "set remotetimeout 600"
},
{
"text": "set debug-file-directory"
}
],
"program": "",
"miDebuggerServerAddress": "",
"variables": {
"mcuxStopAtSymbol": "main",
"mcuxSerialNumber": "WLEDDEPSMN35Q",
"mcuxAttach": "false",
"mcuxRemoteProbeType": "",
"mcuxSkipBuildWhenDebug": "false"
},
"logging": {
"engineLogging": false
}
},
{
"name": "C/C++: gcc-11 build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc-11 build active file",
"miDebuggerPath": "/usr/bin/gdb","variables": {"mcuxSerialNumber":"WLEDDEPSMN35Q"}
}
],
"version": "2.0.0"
}
Look the differences from your JSON.
Let me know about the status of your issue.
Best regards,
Pavel
Hello, no problem. For me the issue was solved right after I specifed Flash Programmer to Link Server in this window:
After that i flashed the board and finally I could start debug session, however I'm wondering why it was working because some fileds in json file like program, was not specified.
{
"configurations": [
{
"type": "cppdbg",
"name": "Debug project configuration",
"request": "launch",
"cwd": "${workspaceRoot}",
"MIMode": "gdb",
"setupCommands": [
{"text": "set remotetimeout 600"},
{"text": "set debug-file-directory"}
],
"program": "",
"miDebuggerArgs": "",
"variables": {
"mcuxStopAtSymbol": "main", // Initial breakpoint
"mcuxSerialNumber": "JUSOLFVVYXBVB", // Probe serial number. If not specified, the one from the selected debug probe (in extension view) will be used.
"mcuxAttach": "false", // Start debug in attach mode
"mcuxRemoteProbeType": "LinkServer", // Remote Probe Type ("LinkServer", "SEGGER", "PEmicro") used only when connecting to a remote server
"mcuxSkipBuildWhenDebug": "false" // Skip build when debug
},
"logging": {
"engineLogging": true
}
}
]
}
Thanks for your anwser!
Hi,
Can you please make enableLogging as true in your launch config, debug once again and attach here the log?
Regards,
Cristian
Hi @cristiantepus
Sorry for the late reply.
Please find the attached build-log.txt file
Thanks
Hi @marcocavallini,
The log does not contain relevant information. Additional info should be logged after:
...
[Warning] 1: (3221) STDERR: [2900]DEBUG:launcher.core.redlinkserv: [read] Loading "LS_preconnect_MCXN9XX.scp"
[Warning] 1: (3221) STDERR: [2900]DEBUG:launcher.core.redlinkserv: [write] run
Could you please try an erase first. This worked in a similar situation (see previous replies).
Thanks,
Nicu
Hello, my name is Pavel, and I will be supporting your case, let me get more information testing this.
Best regards,
Pavel