我尝试使用vscode进行debug,芯片型号为NRF52840,建立了一个空的工程,尝试编译烧录,这是成功的,但是debug失败
我尝试使用vscode进行debug,芯片型号为NRF52840,建立了一个空的工程,尝试编译烧录,这是成功的,但是debug失败
Hello,
You need to write in English on this forum. To get familiar with developing and debugging with the nRF52, nRF53, and nRF54 family, do check out:
https://academy.nordicsemi.com/
Kenneth
gdp translat:
Solution Found!
I have resolved the debugging issue in VS Code for nRF52840.
The key solution is to manually start J-Link GDB Server before launching the debugger.
JLinkGDBServer -device NRF52840_XXAA -if SWD -speed 4000 -port 2331
launch.json
—VS Code will automatically connect to the running GDB Server.46191
), causing connection errors.JLinkGDBServer
ensures the debugger connects correctly to port 2331.Thanks to everyone who contributed! Hope this helps others facing the same issue.
gdp translat:
Solution Found!
I have resolved the debugging issue in VS Code for nRF52840.
The key solution is to manually start J-Link GDB Server before launching the debugger.
JLinkGDBServer -device NRF52840_XXAA -if SWD -speed 4000 -port 2331
launch.json
—VS Code will automatically connect to the running GDB Server.46191
), causing connection errors.JLinkGDBServer
ensures the debugger connects correctly to port 2331.Thanks to everyone who contributed! Hope this helps others facing the same issue.
Final Update: Root Cause Identified!
The real issue was not related to VS Code or J-Link GDB Server itself.
I have an isolation module on the SWD interface because I frequently debug motor drivers. This setup works well in STM32 development environments, but it caused issues with the nRF52840 debugging process.
Earlier, I mistakenly assumed that manually starting the GDB Server fixed the issue. In reality, it just happened that I removed the isolation module at the same time I manually started the server. This led to a false correlation, making it seem like the external GDB Server was required.
Lesson learned! Hopefully, this helps others who might run into similar hardware-related issues.