VSCode can't use GDB for remote debugging on MAX32620FTHR

the cmake configuration process will replace the launch.json I guess. Somthing that may be changed for manual configuration in the future.

1 Like

Won’t hurt to come back up to speed on gdb, but I am relieved that I might not have to… :slight_smile:

Ok, I did the “connect” and the “go button” (a little triangle in my case, and not green). That caused the following error dialog:
Screen Shot 2022-10-19 at 4.12.14 PM

Not sure why, but that actually feels like progress. Now I need to figure out why the launch failed. Initial guess is that the port setup localhost:23331 is wrong – or that I failed to properly specify that value somewhere.

that means that the process in build/nina gdbserver was not started. This step is always neccessary once.
but means it tried to connect with the correct settings now

1 Like

Took me a few seconds to figure that out…

howardharkness@FT-Macbook-Pro arm-workspace % cd build
howardharkness@FT-Macbook-Pro build % ninja gdbserver
[0/1] Starting pyOCD GDB server
0000400 D Project directory: /Users/howardharkness/arm-workspace/build/mbed-os [session]
0000401 D Project directory: /Users/howardharkness/arm-workspace/build/mbed-os [session]
0000411 D CMSIS-DAP v1 probe 04180000b0cf080000000000000000000000000097969904: protocol version 1.0.0 [dap_access_cmsis_dap]
(snip)

Lo, and behold, I can now step through, set breakpoints, etc.

Thank you for your help!

1 Like

you’re welcome, great that it works.

I needed to read the docs also many times, it’s a lot of stuff and lots of traps when you miss the right button or setting.

to clarify from what I’ve learned also in many lessons:

  • the c_cpp_properties.json is only for Intellisense, the code completition, finding the right definitions/declarations

  • it needs also cmake compiler_commands.json to do this right and efficient. Before, the Intellisense DB grew to several 10s of gigabytes.

  • the gdbserver is the link between the target and gdb

  • gdb is the low level debugger, VSC is controlling it and supplies the window views

cmake is knowing all at a very high level, and though it should create configs for all other components. A sophisticated system that takes a few minutes to understand :slight_smile:

1 Like

Guilty as charged – I started to, but haven’t gotten all the way through. There was so much stuff to cover that it wasn’t obvious what was important. :slight_smile:

Still have lots to read, but at least I have a fully functional IDE now. Progress!

You have a good point though, it absolutely shouldn’t be required to read the entire wiki to get set up. @JojoS @howard.harkness , could I ask you to edit the VS Code Setup wiki page to clarify the parts of the setup process you were unclear on? As VS Code is not my daily driver and I don’t have access to a mac, there may be parts I’m unclear on. Please add whatever you think is needed!

Also, am I hearing that there’s some sort of additional json file needed to make VS Code work other than launch.json? I checked back and I was able to get VS Code projects working with just .vscode/launch.json and cmake-variants.yaml present. But if that’s not the case for you guys, we should add this to the guide and/or the example projects as well.

1 Like

I’ll take a look tomorrow. @MultipleMonomials – what is your “daily driver”?

I’m a bit fuzzy on exactly where to put a lot of stuff, but I’ll run a few experiments and put my notes together. I’m the designated pioneer on this project, so I will need to get this down well enough to teach new hires starting in a couple of weeks. The process of updating and double-checking the Wiki is a good place to start.

Pretty much every place I’ve worked before already had the development environment set up – and an IDE guru already on staff. Now I’m in a small startup, and I’m tasked with becoming the IDE guru on staff. A bit scary, but challenging and fun.

Thanks! Much appreciated! As the IDE/build system person at my place, I can say it’s a pretty nice place to be.

As for me, I’m a die-hard CLion fan. I think that it’s pretty similar to VS Code in most ways, but it has some extra features that are really nice. Plus, it has much more seamless support for CMake projects and doesn’t require you to use any config files or plugins.

1 Like

Your setup is working, but the Intellisense is improved with the c_cpp_properties.json. I’ve set the configurationProvider default already to ms-vscode.cmake-tools, but I still see a difference. I will investigate this further.

And I will check also what can be improved in the docs. Yesterday, I started a new project and followed the starting guide closely, and it worked. But I know, testing for many OS and variants is difficult and time consuming.

1 Like

I looked over the CLion site, and asked my manager about the possibility of buying CLion. No joy. We are pinching pennies wherever we can, and since the free VSCode will provide the necessary functionality, we can use that. “Free” is of course relative… I could argue that the time spent figuring out how to configure VSCode cost the company more than a couple of years’ worth of licensing for CLion, but you probably understand how difficult it is to make that sort of case :slight_smile:

Another alternative would be Eclipse. I have used both VSCode and Eclipse. I have used, and like, both, but VSCode appears to be about an order of magnitude easier to set up and configure than Eclipse.

I have found a few areas in the Wiki that I think I might be able to clarify, so I will be working on that, probably starting next week. Most of the clarifications involve minor reorganization, and a few details that came up in the discussions on this forum.

1 Like

That’s a bummer. In my case I just bought CLion myself so I can use it for open source stuff and at work. I will say that if you cancel your subscription after the first year you can keep using the latest version released during that time forever, so it technically does not require a subscription to use. But yeah, it’s not for everyone, which is why I want to support both IDEs properly!

Yeah, last time I checked, CMake didn’t have terribly good support for Eclipse, especially in terms of handling per-file build flags so that the IDE knows what definitions are active on a given file. Maybe it’s changed in the last few years though.

1 Like

the old Java Eclipse is terrible to configure. In VSC it doesn’t look nice at first sight, but the json files are much simpler to understand and edit and copy to other machines. And even this is now automated by the synchronizing feature.

I’ve made some progress in understanding the debug settings and opened already an issue in mbed-ce repo. Its about an old problem that halt and reset is not working, please check.
It will be better to use the specific servertypes for the debuggers, the external servertype is not well supported.

And I just switched from gcc 10.3 to 11.3, looks also like debugging works better now.

I guess I can get back up to speed on using command-line gdb (last used by me about 15 years ago), and I probably should, but I’d rather do debugging in the IDE.

Per the above thread, I was able to get remote debugging to work from the VSCode IDE. Last step was starting the gdbserver from the IDE terminal window. See the post marked as the solution.

Ignore him, he copied and pasted your sentence from above

He will come again and place an ad later probably…

BR, Jan

I’ve made some progress in understanding the debug settings and opened already an issue in mbed-ce repo. Its about an old problem that halt and reset is not working, please check.. .