MCUXpresso for VSCode cannot run hello on MCXN947

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCUXpresso for VSCode cannot run hello on MCXN947

Jump to solution
4,378 Views
marcocavallini
Contributor V

I am experimenting with MCXN947 using MCUXpresso for VSCode.

  • Build machine Ubuntu 22.04.
  • VSCode version 1.88.1

Installed the components using MCUXpresso Installer v.1.2

  • MCUXpresso SDK (2.14.0)
  • LinkServer
  • ARM GNU toolchain
  • Standalone toolchain addons
  • CMSIS toolbox

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

1 Solution
3,790 Views
nicu_manescu
NXP Employee
NXP Employee

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

View solution in original post

10 Replies
4,184 Views
jwolinski
Contributor II

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
      }
    }
  ]
}

 

jwolinski_0-1713958589547.png

 

0 Kudos
Reply
4,120 Views
cristiantepus
NXP Employee
NXP Employee

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

4,116 Views
jwolinski
Contributor II
Hi @cristiantepus, yes I think this was a problem.
0 Kudos
Reply
4,130 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
4,117 Views
jwolinski
Contributor II

Hello, no problem. For me the issue was solved right after I specifed Flash Programmer to Link Server in this window:

jwolinski_1-1714026113557.png

 

jwolinski_0-1714025888403.png

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!

0 Kudos
Reply
4,238 Views
cristiantepus
NXP Employee
NXP Employee

Hi,

Can you please make enableLogging as true in your launch config, debug once again and attach here the log?

Regards,

Cristian

3,868 Views
marcocavallini
Contributor V

Hi @cristiantepus 
Sorry for the late reply.
Please find the attached build-log.txt file

Thanks

0 Kudos
Reply
3,791 Views
nicu_manescu
NXP Employee
NXP Employee

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

3,784 Views
marcocavallini
Contributor V

@nicu_manescu 

erasing flash prior to start debugging solved the issue. Now it works!

Thank you

4,333 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, let me get more information testing this.

Best regards,
Pavel

0 Kudos
Reply