1
\$\begingroup\$

I am working at test jig for low-volume production. The purpose is both flashing firmware and testing PCBA with STM32 MCU. I am considering few options for testing PCBA functionality:

  1. Testing on "production" firmware emulating "real-life" inputs (pressing buttons, emulating signals from analog sensors and digital interfaces etc.)
  2. Uploading "testing" firmware to control & readback data from MCU via external serial interface
  3. Controlling MCU GPIOs via SWD interface

I am strongly interesed in 3rd option. I have found guidance from Nordic semiconductor Controlling GPIO pins with SWD, but have not found anything like this from STMicro. So my question is: is it possible to do the same with STM32? Are there any appnotes or guidance from STMicro? Could you share your experience or thoughts, please.

\$\endgroup\$
2
  • \$\begingroup\$ I'm fairly confident that STMicro has an SWD interface with their STLink tool. Setup information can be found here. \$\endgroup\$
    – Colin
    Commented Feb 26 at 16:08
  • \$\begingroup\$ Do you want to stick with swd? Jtag offers a more direct manipulation. \$\endgroup\$ Commented Feb 27 at 1:26

1 Answer 1

3
\$\begingroup\$

SWD is a standard defined by ARM, which means that it works identically on all ARM microcontrollers that conform to this standard. This means that you can do the exact same thing in the exact same way with STM's ARM MCUs.

Read the reference manual of your microcontroller, figure out what values you have to write to which addresses to get the desired outputs on the GPIOs, and then write those values via SWD. It'll work just fine.

Here's an article that describes how to write data to arbitrary locations within the MCU's address space via SWD.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.