Update on Arduino IDE 2 debugging?

Hi dear arduino R&D fellows,

Greetings!

Surprise to find out that Arduino 2 is available now and it has a online debugging function.
Online debugging is really important to me so just wondering when would it be able to support all arduino hardwares?
I am currently using a third party arduino called Seeed Xiao due to its small dimension.
Hope to hear from you soon

Best Regards

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the IDE 1.x category.

As the Seeed Xiao is not an Arduino board, I think that it's the responsibility of Seeed to add the debug functionality if it's not there; not sure if it's possible.

Hi @rfaas2022. Thanks for your interest in the Arduino IDE 2.0.0 release candidate.

sterretje is correct that it is the responsibility of each Arduino boards platform maintainer to add the debugger configuration. Arduino has provided the framework that makes that fairly simple to accomplish.

At least for the original ATSAMD21G18-based XIAO, that would be exceptionally easy for Seeed Studio to accomplish because they can directly use the configuration Arduino has used in the official "Arduino SAMD Boards" platform (which also uses the ATSAMD21G18).

You can see the necessary changes are very minor:

As for "all arduino hardwares", this is more difficult. The reason is that the "Cortex-Debug" VS Code extension used for the Arduino IDE debugger is described as:

Debugging support for ARM Cortex-M Microcontrollers

This is a popular architecture, but not used by all the huge number of microcontrollers in the Arduino ecosystem.

It may be possible to use it for other architectures, as mentioned by the author of the debugger extension here.

There was some interesting investigation into the possibility of using it with the AVR microcontrollers here:

thanks!

Thanks
I've read your posts in other topics and they do help me a lot!
BTW the online debugging is available for arduino uno is that correct?

Thanks again for your answer and amazing products

I'm very glad if they have been helpful.

The debugging framework is available for use by any Arduino boards platform.

The developers of the "Arduino AVR Boards" platform of the Uno have not used that available framework to configured it for use with the Arduino IDE 2.x debugger. Because of this, you will find that the debugger button on the Arduino IDE 2.x toolbar is disabled and shows the message "Debugging is not supported..." on hover when you have the Uno selected from the boards menu.

This configuration was done on the experimental 3rd party Arduino boards platform mentioned in the discussion at the link I shared in my last reply:

As for whether the "Cortex-Debug" VS Code extension used for the Arduino IDE debugger fully supports the AVR architecture, that is something I'm not well qualified to talk about. The author of the extension did not design it with this architecture in mind, but the underlying protocol (gdb) at least is well standardized.

From the referenced discussion, it sounds like there is a problem, but it is possible to work around in a fairly hacky way:

https://github.com/arduino/arduino-ide/issues/87#issuecomment-775660437

The real problem is cortex-debug plugin. As I mentioned on Dec 17, the armToolchainPrefix is fixed in package.json, and the parameters calling debug server is hardcoded in openocd.ts.

My solution is, make a copy of avr-gdb, and name it as arm-none-eabi-gdb to cheat the cortex-debug. And since I'm compiling my own debug server, I just check if the parameters matches the hardcoded one from cortex-debug. If so, just replace them with correct ones.

These problems for me will not be a problem for most of the ARM based board, as the ARM board is using arm-none-eabi-gdb and real openocd. I can not blame cortex-debug because I'm using it for an unrelated target device.

So my dirty fix did work for 0.1.3 and the nightly build. The fixes are dirty but the user won't notice it. The setup process for end-user are fairly easy.

thanks for the reply, this sounds a little bit to advanced for me.
Will try as much as possible~
Best wishes to IDE 2.X so I can focused on the project itself :slight_smile:

If you want to get started with the Arduino IDE 2.x integrated debugger in the easiest possible way, I recommend the Arduino Zero board:

The Zero has an on board debug probe, so the hardware setup is simply connecting it to your computer with a USB cable as usual.

There is a tutorial for it here:

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