HI !
Please tell me, is it possible to debug for N6 using Visual Studio Code using J-Link or ST-Link? Which extension for VS Code should I install?
HI !
Please tell me, is it possible to debug for N6 using Visual Studio Code using J-Link or ST-Link? Which extension for VS Code should I install?
You want to install the cortex debug extension in vscode. Then you need to install segger jlink tools on linux under /etc and add them to your path, restart everything after they are in your .bashrc or etc. You also need to install the same tools on windows.
You can then connect to the board using the remote jlink server app on windows. When you launch it, it will connect to the JLink and allow other applications via IP to talk to it.
Finally, your launch.json script will look like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/build/OPENMV_N6/bin/firmware.elf",
//"executable": "${workspaceFolder}/build/bin/bootloader.elf",
//"executable": "${workspaceFolder}/build/bin/firmware_M55_HP.elf",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"servertype": "jlink",
"serverpath": "/opt/JLink_Linux_V880_x86_64/JLinkGDBServer",
"ipAddress": "192.168.4.177",
//"device": "STM32F427VG",
"device": "STM32F765VI",
//"device": "STM32H743VI",
//"device": "MIMXRT1062xxx6B",
//"device": "AE302F80F55D5_HP",
//"device": "STM32N657L0",
"interface": "swd",
}
]
}
You’ll have to change the IP address to whatever the remote debug server on windows shows and the file path for the exe to where the firmware.elf file ends up.
Also, compile your code with DEBUG=1 so debugging symbols are available.
kwagyeman, thank you so much for your detailed response! I will try to do this.
Hi !
It’s still difficult for me to set up the initial configuration, and I’m doing it very slowly. I’ve completed all the steps, but I don’t know how to find or where to view the IP address that I need to enter.
"ipAddress": "????",
wsl hostname -I ? Is this the right way to find out an IP address ?
Or I need to specify the IP address that I see in Windows ( ipconfig /all ): vEthernet Ethernet Adapter (WSL (Hyper-V firewall)) ?
I checked both options, and when I run the Debugger in VS Code, I get the following error:
Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: GitHub - Marus/cortex-debug: Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers · GitHub
GDB executable “arm-none-eabi-gdb” was not found.
Please configure “cortex-debug.armToolchainPath” or “cortex-debug.gdbPath” correctly.
When you launch the remote jtag server on the host machine it will display an IP address. You need to enter that as the IP address for the launch file for vscode.
As for the error, you need to add the tools to your path. Since this is outside of the OpenMV sdk it’s not automatically added for you. Look inside the sdk for the arm/bin folder and that folder needs to be added to you bash script with the tools.
A local AI with Claude code in vscode will help you a lot here.
Unfortunately I don’t have the option to install Claude yet. My SDK is located at “\Ubuntu\home\user\openmv-sdk-1.6.0\gcc\bin”. Do I need to add this path?
arm/bin - I don’t have such a folder.
The following files are in this folder:
arm-none-eabi-addr2line 1.0 MB 24.06.2025, 14:51:17
arm-none-eabi-ar 1.1 MB 24.06.2025, 14:51:17
arm-none-eabi-as 1.8 MB 24.06.2025, 14:51:18
arm-none-eabi-c++ 2.3 MB 24.06.2025, 16:26:25
arm-none-eabi-c++filt 1.0 MB 24.06.2025, 14:51:17
arm-none-eabi-cpp 2.3 MB 24.06.2025, 16:26:25
arm-none-eabi-elfedit 51.4 kB 24.06.2025, 14:51:17
arm-none-eabi-g++ 2.3 MB 24.06.2025, 16:26:25
arm-none-eabi-gcc 2.3 MB 24.06.2025, 16:26:26
arm-none-eabi-gcc-14.3.1 2.3 MB 24.06.2025, 16:26:26
arm-none-eabi-gcc-ar 59.5 kB 24.06.2025, 16:26:26
arm-none-eabi-gcc-nm 59.5 kB 24.06.2025, 16:26:26
arm-none-eabi-gcc-ranlib 59.5 kB 24.06.2025, 16:26:26
arm-none-eabi-gcov 1.5 MB 24.06.2025, 16:26:25
arm-none-eabi-gcov-dump 1.3 MB 24.06.2025, 16:26:25
arm-none-eabi-gcov-tool 1.3 MB 24.06.2025, 16:26:25
arm-none-eabi-gdb 10.0 MB 24.06.2025, 14:53:33
arm-none-eabi-gdb-add-index 4.5 kB 24.06.2025, 14:53:33
arm-none-eabi-gdb-add-index-py 4.5 kB 24.06.2025, 14:55:34
arm-none-eabi-gdb-py 10.7 MB 24.06.2025, 14:55:34
arm-none-eabi-gfortran 2.3 MB 24.06.2025, 16:26:25
arm-none-eabi-gprof 1.1 MB 24.06.2025, 14:51:19
arm-none-eabi-ld 1.8 MB 24.06.2025, 14:51:18
arm-none-eabi-ld.bfd 1.8 MB 24.06.2025, 14:51:18
arm-none-eabi-lto-dump 35.0 MB 24.06.2025, 16:26:25
arm-none-eabi-nm 1.0 MB 24.06.2025, 14:51:17
arm-none-eabi-objcopy 1.2 MB 24.06.2025, 14:51:17
arm-none-eabi-objdump 1.8 MB 24.06.2025, 14:51:17
arm-none-eabi-ranlib 1.1 MB 24.06.2025, 14:51:17
arm-none-eabi-readelf 1.0 MB 24.06.2025, 14:51:17
arm-none-eabi-size 1.0 MB 24.06.2025, 14:51:17
arm-none-eabi-strings 1.0 MB 24.06.2025, 14:51:17
arm-none-eabi-strip 1.2 MB 24.06.2025, 14:51:17
Yes, add that to your path. If everything is working when you printenv you should see it in the PATH variable. Then the vscode tools can find gdb.