0
\$\begingroup\$

I try to debug my PCB, which has STM32G030, with SWD in a 3kHz noisy environment. SWCLK and SWDIO traces have both 22 Ohms series and 10k Ohms pull-up resistors attached to them. As the noise source is activated, STLink-V2 debugger SWD communication freezes. After inspection I have found out that SWD pin header and ribbon cables pick up the radiated 3kHz noise over the air, which in turn hangs SWD communication.

Ribbon and pin header cables are each 10cm long. Thus, there is a 20cm length of unshielded cabling. I have also tried only with 10cm pin header cable with no luck. SWD bitrate is 1.8MHz. STM32G030 is powered from a 5V DC isolated PSU through Texas Instruments 3.3V LDO. SWD probe is powered from PC USB port. In order to establish the communication I connect both my PCB's and SWD probe's GNDs together and leave SWD probe VCC unconnected. 3KHz noise is generated by a commercial AC drive's IGBT triggering. I cannot capture waveforms, because SWD communication hangs as soon as AC drive activates.

How can I remedy this problem? Should I use UART or RS485 based communication for debugging?

\$\endgroup\$
9
  • \$\begingroup\$ Fix the noise.. \$\endgroup\$ Commented Apr 19, 2024 at 1:24
  • \$\begingroup\$ SWD simply isn't designed to be used in noisy environments. Step 1 before anything else is to slow down the SWD speed as much as possible. \$\endgroup\$ Commented Apr 19, 2024 at 10:08
  • \$\begingroup\$ How long is your ribbon cable? What is the SWD bitrate used? Also, how do you power the target STM32G030? From a different or from the same power source as the SWD probe? What is generating the 3kHz noise? Can you post the oscilloscope waveform of the signals and noise? \$\endgroup\$ Commented Apr 19, 2024 at 12:37
  • \$\begingroup\$ Why do you have 10k pull-up on SWCLK ? There is internal pull-down. How is your reset pin connected ? \$\endgroup\$ Commented Apr 22, 2024 at 19:35
  • \$\begingroup\$ @kaosad Ribbon and pin header cables are each 10cm long. Thus, there is a 20cm length of unshielded cabling. SWD bitrate is 1.8Mhz. STM32G030 is powered from a 5V DC isolated PSU through TLV1117LV33 3.3V LDO. SWD probe is powered from PC USB port. In order to establish the communication I connect both my PCB's and SWD probe's GNDs together and leave SWD probe VCC unconnected. 3KHz noise is generated by a commercial AC drive's IGBT triggering. I cannot capture waveforms, because SWD communication hangs as soon as AC drive activates. \$\endgroup\$ Commented Apr 24, 2024 at 15:35

1 Answer 1

1
\$\begingroup\$

As suggested in the comments, I have corrected SWCLK connection by tying it to 10kOhm external pull-down resistor and the problem is solved. There is no interference when I activate the noise source any more.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.