cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Controlling Resources via JTAG/SWD

NotSure
Associate II

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 discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

8 REPLIES 8

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
Up vote any posts that you find helpful, it shows what's working..

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

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.

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.

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.

Peripherals are memory mapped, modify AHB/APB based registers are you would access them from the MCU.

See Debug Scripts, and how they initialize / configure hardware

Or move code into RAM and execute it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Roger SHIVELY
ST Employee

Hello @NotSure ,

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

Regards,
Roger

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