Jump to content
IGNORED

Firmware Debugging


ZackAttack

Recommended Posts

I want to attach my st-link to the plus cart so I can debug the firmware directly from cubeide and not have to bother with jumpers every time I load a new build. I was able to find the corresponding pins for swdio and swclk but nrst doesn't appear to be brought out to the i/o headers. I assume it's going to one of the buttons on the breakout board.

 

Has anyone had success with flashing/debugging via st-link?

 

Which button is tied to nrst?

Link to comment
Share on other sites

Ok, I'll answer my own question in case anyone else wants to go this path. st-link works fine with only the swdio, swclk, and ground connected. I suspect you'd only need the nrst pin connected in the case where PA13 and PA14 are being mapped to alternate functions and are no longer functioning as the SWD port. Since this should never apply to the plus cart the nrst pin can be ignored. Though based on the usb flash instructions the nrst button is the one closer to the usb connector. Perhaps if st-link is ever having connection issues, it's worth a try to reset it.

 

I'm including some pictures with annotations on how I connected the st-link. Excuse the terrible soldering job, it was done in a rush, outside, in the dark, with a flashlight. Once you add the two yellow wires, simply connect them to st-link and a third for ground. I jammed a female hookup wire on there, but an alligator clip or soldered wire would be just as good. Then you can click run/debug from within stm32cubeide, set breakpoints, inspect memory, etc. Don't forget to keep the console powered on when using st-link since it will have no usb cable to power it. I think that's convenient because you don't have to worry about collisions with the console and USB power supplies. Not sure if that matters or not, but I can't imagine it would be a good idea to power the board from both at the same time.

 

401497927_SWDwires.png.8358c25cde2e64d9a085c5bc67339641.png761304309_SWDgnd.png.ae8021f75e54d4d315213e3e6768dd19.png

  • Like 1
Link to comment
Share on other sites

On 10/12/2020 at 12:01 AM, Andrew Davie said:

Thanks for that. I'm interested in having a play with this.

Would this be a correct product to purchase...?

 

https://au.mouser.com/ProductDetail/STMicroelectronics/ST-LINK-V2?qs=H4BOwPtf9MC1sDQ8j3cy4w%3D%3D

 

That might be a good choice if you have a need for the JTAG functionality in other projects. STM and ESP can use JTAG too, but I have yet to encounter a scenario where it was actually needed or helpful.

 

I just use one of the cheap usb stick type ones from amazon. Just search amazon for st-link v2 and you'll find a bunch of choices like this:

https://www.amazon.com/HiLetgo-Emulator-Downloader-Programmer-STM32F103C8T6/dp/B07SQV6VLZ/

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...