Skip to main content
Associate
October 21, 2023
Solved

STM32 Controlling Resources via JTAG/SWD

  • October 21, 2023
  • 3 replies
  • 3167 views

I there a way (device or API) to control STM32 resources via JTAG or SWD without the need to downloading a custom program?  For example, setup GPIO pin with pull-up and direction and then write value.  In addition, be able to perform more advance scenarios like reading/writing data via the I2C, SPI, or UART ports.  This would mainly be used for testing out new boards or manufacturing environments.

I've seen projects like Firmata do similar, but was curious if there was something else provided directly by ST (or community) as more of a long-term standard.  Would be nice if something like ST7Programmer tooling/API could offer this ability.

Thanks in advance for any help/references.

This topic has been closed for replies.
Best answer by Tesla DeLorean

Segger used to have SWD / JTAG libraries.

Perhaps look at OpenOCD, DAP, Black Magic, etc.

https://piolabs.com/blog/engineering/diving-into-arm-debug-access-port.html

3 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
October 21, 2023

Segger used to have SWD / JTAG libraries.

Perhaps look at OpenOCD, DAP, Black Magic, etc.

https://piolabs.com/blog/engineering/diving-into-arm-debug-access-port.html

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
NotSureAuthor
Associate
October 21, 2023

Thank you Tesla for the info/links.  Looks like something I was looking for and appears to be much content to research.  I may have more questions, but I really appreciate your help. :)

Uwe Bonnes
Chief
October 22, 2023

STM32 with Mx > M0+ have two JTAG targets. One to query the CPU/Ram/peripherals and teh other is the traditional boundary scan to control/query the IP Pins. bondary scan howerver ony sets-reads IO, for changing other properities like drive strength you have to go the JTAG/SWD way to manipulate the peripherals.

NotSureAuthor
Associate
October 22, 2023

Thanks Uwe.  Do you know of any links that show examples of changing the peripherals like I/Os?  That would be a great start, but ultimately would like to perform advanced things like reading/writing from SPI or I2C ports, as well.  Thx again.

Uwe Bonnes
Chief
October 22, 2023

To access the peripherals with SWD/JTAG is the same as when done bare-metal. Make sure the peripheral is clocked and than set the registers as  needed.

Roger SHIVELY
ST Employee
October 24, 2023

Hello @NotSure ,

There has been a case created to resolve this question and we will be reaching out to you directly.

Regards,
Roger

NotSureAuthor
Associate
October 24, 2023

Thanks Roger.  And if needed, I have no problem having an off-line discussion to chat/explain in more detail.  Thanks again.