2023-10-21 7:19 AM
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.
Solved! Go to Solution.
2023-10-21 9:24 AM
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
2023-10-21 9:24 AM
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
2023-10-21 9:45 AM
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. :)
2023-10-22 3:04 AM
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.
2023-10-22 3:32 AM
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.
2023-10-22 11:52 AM
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.
2023-10-22 12:44 PM
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.
2023-10-24 1:04 PM
Hello @NotSure ,
There has been a case created to resolve this question and we will be reaching out to you directly.
Regards,
Roger
2023-10-24 1:35 PM
Thanks Roger. And if needed, I have no problem having an off-line discussion to chat/explain in more detail. Thanks again.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.