I finally succeeded in using VSCode to build an application to run on an MAX32620FTHR target – with substantial help from contributors (such as @JohnnyK JohnnyK and @MultipleMonomials MultipleMonomials) to this forum topic. However, I’m still stumped regarding running GDB to do remote debugging on the target. I was able to run a remote debugger from the MBed Studio, but I have not been able to do that with VSCode. I’m hoping that I’m just missing some basic VSCode settings or environment variables.
I have been told by other contributors to this forum that it is possible to run remote debugging from VSCode, but I saw from the posts that the examples were using Windows as the development platform.
I am using
MacOS Monterey 12.6
GCC 10.3.1 arm-none-eabi
MacBook USB–>MAX32625PICO–>MAX32620FTHR for load of firmware
In my top-level CMakeLists.txt, I have these references to PYOCD:
#enable firmware upload and remote debugging
set(PYOCD_UPLOAD_ENABLED TRUE)
set(PYOCD_TARGET_NAME max32620)
My launch.json (I checked all of the paths; they are all valid):
{
"configurations": [
{
"type": "cortex-debug",
"name": "Connect to GDB Example MAX32620FTHR Debug",
"executable": "/Users/howardharkness/arm-workspace/build/Example.elf",
"cwd": "${workspaceRoot}",
"gdbPath": "/opt/homebrew/bin/arm-none-eabi-gdb",
"objdumpPath": "/opt/homebrew/bin/arm-none-eabi-objdump",
"servertype": "external",
"gdbTarget": "localhost:23331",
"request": "attach"
},
]
}
My c_cpp_properties.json:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}",
"${workspaceFolder}/mbed-os/**"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/opt/homebrew/bin/arm-none-eabi-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "${default}",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
When I try to run the debugger, I get an error telling me that GDB can’t be found, citing a directory (/opt/homebrew/bin/libd) that is not in my system, and I can’t find any reference to “libd” anywhere in my project. So, I conclude that I’m missing some setup or configuration issue. Alternatively, I’m using an incorrect way to try to run it.
I have also been unable to figure out how to use printf() as a poor-man’s debugger.