Debugging Questions

Hi, I have been using Arduino for small projects for a couple of years. My "debugging" method has been serial.Print() :frowning:

I have just installed the new Beta IDE 2 and the live debug looked interesting, I have a MKR Zero board. Can debugging be used on this board as is, or is more hardware required e.g Black Magic Probe or similar. Are there any tutorials that explain the setup so that debugging can be used, I have searched (obviously not too well) and found nothing so far.

Thanks

Hello @ex-egll.

ex-egll:
I have just installed the new Beta IDE 2 and the live debug looked interesting

It really is a cool thing. I've been doing a lot of beta testing of the new IDE, including the debugger, and have had tons of fun playing around with the debugger.

ex-egll:
I have a MKR Zero board. Can debugging be used on this board

Yes. There is out of the box support for any of the active Arduino SAMD boards (the retired M0 is not supported).

ex-egll:
as is, or is more hardware required e.g Black Magic Probe or similar

A debug probe is required to use the hardware debugging capability. Only the Arduino Zero has a built-in debug probe on the board. When using any other board, including the MKR Zero, you will need to attach a debug probe.

The Black Magic is a nice option, but you can use any CMSIS-DAP compliant debugger you like. I use this little open source debugger:

You can also use the Segger J-Link line of debuggers, but these are not CMSIS-DAP compliant so it does require some special setup to make them work. Information about that here:

Except for the MKR WiFi 1000, the Arduino SAMD boards don't have the standard 0.05" pitch 2x5 SWD header, which makes connecting a debugger a little difficult. On the bottom of the other MKR boards there is a footprint for a 0.1" pitch 2x3 SMD header (e.g., https://www.digikey.com/short/z3dvdv):
MKRZero_labeled.jpg
So you'll need to find a way to make the correct connections between the debug probe and those pads.

When I only need to do a quick "Burn Bootloader", I use a 0.1" pitch 2x3 POGO adapter pressed down on the pads by hand. However, I think that would be very inconvenient for all but the quickest of debugging sessions.

So you'll probably either want to solder wires directly to the pads or else solder a header and then make the connections to the header. If doing the former, you might want to add a blob of hot glue over the finished solder connections for strain relief. If doing the latter, be warned that this will make the board less friendly to being plugged into a breadboard.

ex-egll:
Are there any tutorials that explain the setup so that debugging can be used, I have searched (obviously not too well) and found nothing so far.

Unfortunately, I don't think there is much information available on this yet. This reply from one of the other Arduino employees involved with the Arduino IDE 2.x project gives some information:

Many thanks for the detailed response pert. Knowing my luck with trying to get two boards (the Arduino and the the probe) to play nicely together I think I'll try ti track down the original Zero and play with that!

Barry

You're welcome. I'm glad if I was able to be of assistance. The on-board debugger of the Zero sure is convenient. It makes the Zero my first choice when I need to do a quick test of the debugger.

Enjoy!
Per

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