Skip to main content
Patrick Morwald
Associate III
March 29, 2018
Question

What peripherals can we control with SWD?

  • March 29, 2018
  • 6 replies
  • 4375 views
Posted on March 29, 2018 at 16:02

Hello,

for debugging our systems in production where the firmware is not yet flashed on the chip, we want to control attached peripheral devices only with SWD. 

So far we can switch GPIOs successfully with SWD. This gives us the ability to control ON/OFF type peripheral devices via SWD. 

Now we want to control PWM (STM32 timer) and I2C devices directly via SWD. Is that even possible and if so, how is it done?

We also need a scripting system to automate such peripheral tests via SWD. What solution is there?

Best regards,

Patrick

#debug #stm32f4 #swd
This topic has been closed for replies.

6 replies

Uwe Bonnes
Chief
March 29, 2018
Posted on March 29, 2018 at 16:26

You can write to any register via SWD, so as long  as you don't cut of the SWD connection by reusing the SWD pins, you can do anything.

Patrick Morwald
Associate III
March 29, 2018
Posted on March 29, 2018 at 17:25

I think handling a protocol like I2C via the SWD register write will pose quite some manual effort though. Are there any host computer programs or scripts which already offer this functionality via SWD?

Andrew Neil
Super User
March 29, 2018
Posted on March 29, 2018 at 17:52

I'm not sure I see the point in doing this? Do you think it likely that your suppliers will be shipping you large numbers of defective chips?

:(

Rather than have huge amounts of SWD traffic trying to manually run these tests, wouldn't it be easier to just download some test firmware?

Or include the tests in the standard firmware?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Patrick Morwald
Associate III
March 29, 2018
Posted on March 29, 2018 at 18:12

Hi,

yes we thought that too. We could flash a test firmware for testing the peripherals and in the end of production flash the customer firmware.

Regards,

Patrick

Andrew Neil
Super User
March 29, 2018
Posted on March 29, 2018 at 18:18

I still don't see why you feel the need to test the peripherals?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
March 29, 2018
Posted on March 29, 2018 at 18:32

There's also boundary scan if you want to check external connectivity.

From the debugger connection injecting small test applets into RAM is another means of testing/probing functionality.

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