Portenta H7 - How to Debug?

Hi forum!

After a fair amount of research online (tutorials, forums, DIY guides, ...) and of trial&error development, I still have no solution about how to debug with the Portenta H7. I don't necessarily need the extensive capabilities of debugging with the STM32CubeIDE, stepping a code line-by-line and setting breakpoints would be enough for a major speedup in the development.

I am aware of the Trace32 SW but: 1) I am running into a lot of issues on my Ubuntu laptop, 2) I want to debug in the same IDE I am developing (i.e. Visual Studio Code or similar).

I have an STLink V2, the Portenta Breakout board and HW capabilities to debug via SWD (as indicated by the Breakoutboard schematics) if that's the way to go.

It seems impossible to me that such a "PRO" board doesn't have the capabilities of offering such a debug feature!

Long story short: I need to debug the Portenta H7 (e.g. place breakpoints), and I want to be able to do it from Visual Studio Code (or Arduino IDE 2.0). I would appreciate any suggestion on how to do it (either via USBC or STLink & SWD pins from the Breakoutboard), since I have not managed to get a running setup yet.

Thanks in advance for your help and patience!

Hi @graldij
What do you want to know? How to use a debugger with an stm32 or how to connect the debugger?

About the connection, I recall this thread which claims that the pinout is mirrored:

I have not yet tried to debug my Portenta so I help you in details right now, but the stm32H7 dual core is supported by openocd so it should works and even in VSCode with a bit of configuration.

About the PRO claim, I agree with you that apart the price, the Portenta series is far from being a PRO product! (almost no support on the forum, several hardware issues, software not efficient, no precise changelog across revisions..)

1 Like

I have used Visual Micro to debug with breakpoints, and variable watch. Only limitation is no Serial.prints may be used. If you have Visual Studio, you can try a trial license for free, and see if it works for you. Needs no extra hardware, so that is a definite plus, and I found it easier to use than the Lauterbach free license that comes with Portenta.

Hi! Thanks for you answer! Unfortunately Visual Studio is not supported by Ubuntu (laptop I am using)

I finally made it to debug .ino code within VSCode on the Portenta H7 via openocd and with some customization! I mainly followed this guide. Thanks @rreignier for your answer, but the pinout of the SWD of the current schematics seems correct now.
My problem was the STLinkV2 usbstick I was using, which does not have a NRST pin (only RST) :nauseated_face:.

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