Development with debugger and breakpoints

I have invested a lot of time trying to get my setup to debug, but failed.
I have a Pi400, VSCode with Platformio and Arduino UNO R3.
It seemed to be possible with Buster which had Python2.

Is debugging possible and if it is which arduino board and setup, should I even use platformio?

what type of debugging are you looking for?

the most common is to simply use prints to trace the sequence of the code. The Arduino IDE has a serial monitor allowing prints from the processor. no doubt, too many prints can be overwhelming and boolean flags can be used to dis/enable them.

i've done lower level more real-time debugging where i capture events in a circular "trace" buffer which encodes events and possibly values as hex values to maximize the length (in time) of the buffer. An event is triggered, the buffer dumped, decoded and evaluated.

Thanks for responding, I spend my work development time in VS c#, developing services or exes. In that environment, I can use F9 to set a break point, and then interogate the values by hovering or adding a watch.

I did try the lib jdolinay/avr-debugger@^1.5
It promises that, but only on early versions of raspberry pi.

I am debugging presently with serial print, but setting breakpoints or conditional breakpoints, step into / over is quicker for me at least to develop.

Does that kind of experience exist?

The Uno R3 essentially does not support “real” debugging.
You could get a Microchip “Xplained Mini 328p”, which is almost the same, and includes debug support via Microchip Studio, MPLABX, and perhaps other IDEs.

Arduino IDE 2.x has an integrated sketch debugger you might be interested in:

https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-debugger

That tutorial was written at a time when only the developers of the "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" platform had added the necessary configuration to allow the platform's boards to be used with the debugger. Since that time, debugger support has been added to quite a few more platforms, including:

There is even a platform that adds debugger support for the UNO R3/ATmega328P:

if you're just trying to debug logic, have you considered developing in a simulated environment on a laptop?

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