Open smrtos opened 2 years ago
Hi @smrtos! I also use both GDB Dashboard for command line debugging, and VSCode for GUI debugging.
The ValueError: max() arg is an empty sequence
exception you see is a bug in GDB Dashboard. It's not completely happy with the Cortex-M architecture.
I'm not sure where the "Exception has occurred" error comes from. I don't think that's a result of the GDB Dashboard error, since that's a Python exception (and you can see Dashboard continues to print the rest of the dashboard sections). This error is probably related to the Native Debug extension not being meant for embedded debugging.
So basically, the Native Debug extension should not be used with Cortex-M debugging. Please use the cortex-debug extension instead. It works well with pyocd.
Here's an example cortex-debug launch configuration I use for debugging DAPLink.
{
"name": "DAPLink lpc55s69_bl",
"executable": "${workspaceRoot}/projectfiles/make_gcc_arm/lpc55s69_bl/build/lpc55s69_bl.elf",
"cwd": "${workspaceRoot}",
"request": "launch",
"type": "cortex-debug",
"servertype": "pyocd",
"serverpath": "${workspaceRoot}/venv/mac39/bin/pyocd",
"targetId": "lpc55s69",
"serverArgs": [
"--uid=L02932983A",
"--core=0",
],
"svdFile": "/xxx/_cmsis_packs/NXP.LPC55S69_DFP.12.3.0/LPC55S69_cm33_core0.xml",
"showDevDebugOutput": false,
"gdbPath": "/opt/gcc-arm-none-eabi-10.3-2021.07/bin/arm-none-eabi-gdb-py",
},
Notes:
--core=N
in the serverArgs
or cortex-debug will try to use clashing server ports for the multiple cores.-u
/--uid
argument in serverArgs
to specify the probe's unique ID, if you have multiple boards connected.targetId
key is where you put pyocd's -t
/--target
argument, if needed.(I plan on adding a full guide to debugging with VSCode+cortex-debug to the pyocd docs soon.)
Thanks @flit I will try the Cortex Debug extension. I remember I also tried disabling the Native Debug extension but the "Exception has occurred" still showed up. I will double check on that and provide further details.
@flit Thanks for the recommendation. I just tried it. It seems impossible to configure the port for the gdb client to connect to. The maintainer doesn't consider that to be a proper way I guess. Check here: https://github.com/Marus/cortex-debug/issues/117
Hmmm, that's a bit frustrating indeed.
Host environment:
Steps:
Build zephyr blinky sample application cmake -B build -S samples/basic/blinky -GNinja -DBOARD=reel_board cd build ninja
Start gdbserver: pyocd gdbserver --target=nrf52840 --frequency=4000000 Output:
Start gdb client: zephyr-sdk-0.13.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb zephyr/build/zephyr/zephyr.elf
Connect to gdbserver:
gdb TUI shows below red python value error:
And btw it seems this very python exception will break the Native Debug extension for the Visual Studio Code. See below:
And if I attempt to input some gdb command in the Visual Studio Code DEBUG CONSOLE, it shows below error: