Live Debugger

Based on the information from Arduino IDE and ubidefeo's Github mentioned:

Arduino IDE:
"Maintainers of Arduino cores for third-party boards can add support for debugging by adding the relevant configuration parameters; a technical guide for this is coming. You’ll need to connect a debugging probe such as the Segger J-link to the JTAG pins on the board and you’ll be ready to go."
ubidefeo:
"not every board is supported, in fact only ARM Cortex based boards can work"

Based on photos attached, personally I have tested the current Arduino IDE 2.0 beta using Seeeduino Xiao Expansion Board with SAMD21G18 chip but the live debug is not supported.

I understand there is no USB programmer port ( EDBG ) such as the Arduino Zero, but it is still the SAMD21G18 Cortex M0+ chip with SWD interface, I can burn bootloader using Segger J-Link programmer on it under Microchip Studio but under Arduino IDE 2.0 beta, the live debugging is not working.

In fact, I also tested using ST-LINK V2 with SWD interface to STM32F103C8T6 clone board and the result is the same as mentioned above, not sure what is missing here, anyone has any idea ?

Please advise.

SAMD21G18 with Segger J-Link V8.jpg

SAMD21G18 with Segger J-Link V8.jpg

Hi @rickygai. For the Xiao, you should only need to make the equivalent changes to what was done in the Arduino SAMD Boards platform of the Zero, MKR, etc:

This is a little confusing because Add debug recipe configurable interpreter flag by rsora · Pull Request #506 · arduino/ArduinoCore-samd · GitHub is setting up debugging using Arduino's first experimental debug system, then Update definition for debugger support on arduino-cli by cmaglie · Pull Request #572 · arduino/ArduinoCore-samd · GitHub is removing part of what was added by Add debug recipe configurable interpreter flag by rsora · Pull Request #506 · arduino/ArduinoCore-samd · GitHub to make Arduino SAMD Boards compatible with the new system that is in place in Arduino IDE 2.0.0.

As for the STM32F103C8T6, I think it will require the same, but maybe also a custom launch.json, as was described at [ INFO ] Debug functionality: an update · Issue #87 · arduino/arduino-ide · GitHub

One tidbit of information that might be useful to you is that the Arduino IDE 2.0.0 debugger is this VS Code extension:

So any of the documentation you find about that extension will apply to the Arduino IDE 2.0.0 debugger.

Thanks pert,

After reading the info you shared, it seems there is still much work to be done under Arduino IDE 2.0 beta to make the live debugger user friendly, still new.

I cannot find a site with proper documentation on how to configure live debugger for custom boards like Seeeduino Xiao, Raspberry Pi Pico or STM32F103C8T6 under Arduino IDE 2.0 beta.

For example the Raspberry Pi Pico Arduino supports, the result still the same as mentioned in previous post.

I am stuck at how to configure the profile "launch.json", I am not an expert on this, for example the launch.json contents below:

{
"servertype": "jlink",
"device": "ATSAMD21G18",
"interface": "swd",
"serverpath": "C:/Program Files (x86)/SEGGER/JLinkGDBServer.exe"
}

I applied the above configuration to Seeeduino XIAO but the result still the same, nothing to select under the Configurations combo box, if you clicks the debug button, it cleared the content of launch.json.

Any idea ?

Yeah, it is an unfortunate situation that the debugger configuration system is currently undocumented. The truth is that, even though I'm in the team developing the Arduino CLI and Arduino IDE 2.x projects, I don't even know how it works (I was not involved in the work on the debugger). I figured out the first version of the system and wrote what I thought was some fairly decent documentation targeted at Arduino boards platform developers:

But quite a bit (though not all) of that information is now obsolete due to a reworking of the system and I haven't taken the time to decipher how it works now. Everything is open source, so the information is definitely all there for the learning, but of course it's essential to have proper documentation to make it easier for the 3rd party boards platform authors to take advantage of this new capability.

Thanks again pert, I just received some info from Seeedstudio forum where live debugging can be done via PlatformIO at HERE. This also means Arduino IDE 2.0 beta surely possible, just need to wait.

REFERENCES:
Innovation Coffee - Arduino IDE 2.0
Arduino Zero ( now available back! )

REFERENCES:

[[RESOLVED] Arduino Zero - Error: unable to open CMSIS-DAP device

Debugging Seeeduino Xiao expansion board on Arduino IDE 2.0 beta 5
( Please refer to the thread "Arduino Forum - Information about debugging?" on how to setup, the current path for Seeeduino Xiao is at "C:\Users<USERNAME>\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.1\platform.txt )"

Segger J-Link Software and Hardware matrix table
( NOTE: Seggar J-Link EDU hardware version 10, 11 will support RP2040 M0+ due to SWD MULTI-DROP )

Arduino Forum - Information about debugging?

Arduino Zero ( now available back! )

Innovation Coffee - Arduino IDE 2.0

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.