I saw you already got it working by installing the proprietary SEGGER software and adjusting the debugger configuration via a debug_custom.json file added to the sketch. In case you find that inconvenient, you might be glad to hear that, since Arduino IDE 2.3.0, it is now possible to use a J-Link debug probe without installing the SEGGER software or adding a debug_custom.json file to the sketch. The platform has been configured to configure the free open source OpenOCD tool that is installed along with the "Arduino Mbed OS Giga Boards" platform appropriately for use with a J-Link debug probe.
- Select Tools > Programmer > JLink from the Arduino IDE menus.
- Click the "Start Debugging" button on the Arduino IDE toolbar.
If you are using Windows, the debugger initialization might fail with the following error message shown in the "gdb-server" panel at the bottom of the Arduino IDE window:
Warn : Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
Error: No J-Link device found.
The reason is that the drivers provided by SEGGER are incompatible with OpenOCD it is necessary to replace them with the WinUSB drivers.
I'll provide instructions you can follow to install the WinUSB driver:
- Download the "Zadig" driver installation tool from this website:
http://zadig.akeo.ie/
ⓘ Note that the use of Zadig is officially recommended by the OpenOCD developers. - Plug your USBasp into your computer.
- Start "Zadig".
- From the dropdown menu in the "Zadig" window, select "J-Link".
If it doesn't show up on the menu, then select Options > List all devices from the Zadig menus and check again. - Click the up or down arrows next to the Driver selection box on the right side until you see "WinUSB".
- Click the "Replace Driver" button.
- Wait for the driver replacement process to finish.
- Close the "Zadig" window.
Now click the "Start Debugging" button on the Arduino IDE toolbar again. Hopefully this time it will start up and work as expected.
In case you wish to continue using the debug_custom.json approach, you should be aware of this: