Debugging Mbed application for CY8CKIT-062-WIFI-BT in VSCode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
CoreyW_81
Employee
Employee
50 sign-ins 50 replies posted 25 replies posted

I have imported the mbed-os-example-blinky via mbed cli, compiled it, flashed it, and confirmed it is working.

I then export to the vscode ide and open the folder in VSCode

I follow the directions on the MBed Website at Visual Studio Code - Tutorials | Mbed OS 5 Documentation to set up the debugger.

In VSCode, I can get the program to compile but cannot get the debugger to start, nor program the board.  There's always some drastic error which I cannot decode!

Is there any workflow document to show the proper settings required in the json files under the .vscode directory to get the debugging to work in VSCode?

I'm presently trying to try the workflow for debugging via the Eclipse IDE in MTB 2.0 as a workaround.

I think this would make for a good workflow document for the community.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Please add the flags in the field highlighted below:

    "configurations": [

        {

            "name": "C++ Launch",

            "type": "cppdbg",

            "request": "launch",

            "program": "${workspaceRoot}/BUILD/CY8CPROTO_062_4343W/GCC_ARM/${workspaceRootFolderName}.elf",

            "args": [],

            "stopAtEntry": true,

            "cwd": "${workspaceRoot}",

            "environment": [],

            "externalConsole": false,

            "debugServerArgs": "-p 3333 -t cy8c6xx7",

Let me know if it works. I'm attaching my file for reference.

Regards,

Dheeraj

View solution in original post

8 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Please make sure that in the "launch.json" file you have set the "debugServerPath" and "MIDebuggerPath" correctly. Please clarify the following:

  • Are you using "mbed" or "make" in the preLaunchTask?
  • Are you using openocd or pyocd as the server?

Please attach the "launch.json"  and the "tasks.json" file along with the screenshot of the error so that we can get more insight on the error.

Regards,

Dheeraj

lock attach
Attachments are accessible only for community members.

In tasks.json, I'm using mbed

In launch.json, the prelaunchTask is mbed.exe

debug server is pyocd-gdbserver.exe

Here is the error:

pastedImage_0.png

Files attached.

Logs from output and debug windows attached.

0 Likes

Looks like I'm able to reproduce your issue.

pastedImage_0.png

I'm debugging it to see what exactly is causing this. Will post any new developments.

Regards,

Dheeraj

0 Likes

Dheeraj - any progress with the debugging?  My guess is whatever is messing this up in VScode is likely the same thing messing up in MTB 2 when importing from Mbed.  See my community post: Re: g++: Command not found and maybe you can work with Raktim to solve both issues.

Thanks.

0 Likes

Any progress?

0 Likes

I hope your issue is resolved in the other thread: Re: g++: Command not found

Regards,

Dheeraj

Yes, but I don't know where to put the equivalent flag in the VSCode implementation if that is the same issue here.

0 Likes
lock attach
Attachments are accessible only for community members.

Please add the flags in the field highlighted below:

    "configurations": [

        {

            "name": "C++ Launch",

            "type": "cppdbg",

            "request": "launch",

            "program": "${workspaceRoot}/BUILD/CY8CPROTO_062_4343W/GCC_ARM/${workspaceRootFolderName}.elf",

            "args": [],

            "stopAtEntry": true,

            "cwd": "${workspaceRoot}",

            "environment": [],

            "externalConsole": false,

            "debugServerArgs": "-p 3333 -t cy8c6xx7",

Let me know if it works. I'm attaching my file for reference.

Regards,

Dheeraj