0
\$\begingroup\$

I'm designing an STM32F103 circuit and I plan to program and debug it with a Black Magic probe.

I have connected SWDIO, SWCLK and SWO to a standard ARM 10-pin Cortex M Debug Connector. My understanding is that the probe will control the voltages on these lines and I should leave them floating, i.e., no pull-ups or pull-downs on these lines.

However, the Nucleo evaluation board I am basing my design on has a JTAG connector and one of the things they do is weakly pull up the lines for TMS/SWDIO and TDO/SWO with a 10k resistor to 3.3V:

eval board with pullup resistors on SWDIO and SWO

Should I also add a 10k pull up on those lines?

The arguments against adding 10k pull ups are:

  • The Nucleo board was not designed to work with the Black Magic probe; it was designed in an older era to work with a JTAG device (probably ST-Link).

  • If the Black Magic is not expecting to see voltages on these lines and doesn't have reverse biased protection diodes, current will flow from the target board back into the Black Magic, which may confuse it or cause it to malfunction.

  • I have looked at schematics for hobby boards that the Black Magic people say are known compatible with their probe, and none of them are pulling up SWDIO or SWO. They just leave them floating.

The only argument for I can see for adding 10k pull ups is that the manufacturer evaluation board is usually the most reliable source of truth, and maybe there is some reason, unknown to me, why leaving these lines floating is a bad idea.

If anyone else has designed a circuit that you use with the Black Magic, or even a different SWD programmer like ST-Link, can you tell me whether you pulled up SWDIO and SWO?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The STM32 already has internal pull resistors on SWD pins. STM32 data sheets and examples include mention of external puii resistors for noisy environments. If some debug adapter can't handle say 10k extra resistance to VCC (and/or GND) then forget that toy and buy a real debug adapter you can trust.

After checking a few STM32 docs, they mention that IEEE JTAG standard mandates that the signals must have pull resistors so they don't float. But also the docs say STM32 MCUs have internal pull resistors so external ones are not necessary.

It does not hurt to add them externally, as the internal resistances are quite weak, say aroubf 40k. Adding external resistors of 10k is fine and causes no problems.

You can always draw them and then choose to not mount them, so if you ever need them just solder them in.

I think I have always used external pull resistors and there has never been problems associated with them.

Just make sure you add the pull resistor up or down depending on what is the internal pull resistor direction, so don't pull up a pin externally that is internally pulled down.

\$\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.