1
\$\begingroup\$

I have been reverse engineering my electric longboard remote for the past couple days and have been attempting to get a ST Link V2 connecting to it via some test pads on the PCB I found. I know the test pads are for SWD because tracing the pads on the PCB with a connectivity detector tells me that they each connect to the following:

  1. Pad 0: GND
  2. Pad 1: PA 14 / SWDCLK
  3. Pad 2: 3.3v VSS
  4. Pad 3: PA 13 / SWDIO
  5. Pad 4 NRST Back side of board with the pads Front side of board with the STM32

The Processor is a STM32F103C8T6 I soldered some wires to each pad then tested continuity between them (to make sure I didn't solder two together) and then tested the continuity of each wire to the corresponding pin on the cpu guaranteeing that each wire was properly connected. I then connected the pins to corresponding pins on the ST-Link Clone (Multiple sources online said not to connect the VCC to StLink Clones when powered external which I tried, I also tried connecting it with a 10K resistor also suggested neither changed anything) and then loaded up StLink Utility on my Windows Box. The ST Link showed up fine and I upgraded its firmware successfully. When I went to connect to the STM32 tho it wouldn't. I tried swapping clock and data and tried every setting on the page for connection (Connect on Reset, Hardware Reset, Software Reset, Frequency, JTAG ...). Nothing would work I then tried on my M2 MacBook using STM32 Programmer (I believe it's the newer STLink Utility compatible with Mac OS) and the results were the same. I then checked each wire again and also resoldered the pads, neither changed anything. I then tried OpenOCD and it connected to the STLINK but failed to connect to the STM32 also. At the moment I am at a lost of what to do next, I've been to every forum on the internet that mention STM32 and SWD and none have helped. During my research I figured out that if the loaded firmware uses the pins for something else they will not work for SWD, I don't believe this is the case since the traces don't connect to anything else. I also learned of Debug Authentication but am confused at what it is and determined that my cpu probably doesn't support it (not entirely sure tho!). Is there anything I'm missing. I don't have access to the firmware on the chip. Is there anyway I can test if SWD is even enabled on the chip? Is it worth buying a proper ST-Link to try it? Am I missing something very basic? I am a freshman CE student and am doing this just for fun. Edit. I see the processor is a GD32 not STM32 but it should still work with stlink according online

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You said: STM32F103C8T6. I see GD32F130C8T6. \$\endgroup\$
    – Rodo
    Sep 29, 2023 at 17:39
  • \$\begingroup\$ Did you connect VDD from the board to the ST Link V2? \$\endgroup\$
    – Rodo
    Sep 29, 2023 at 18:15
  • \$\begingroup\$ Its on pad 2 and I tried it and it made the light on stink turn off and then I saw online to put a 10k resistor on it and it still didn't work but it didn't turn off the light. \$\endgroup\$ Sep 29, 2023 at 19:26
  • \$\begingroup\$ See my answer below. \$\endgroup\$
    – Rodo
    Sep 30, 2023 at 1:52

2 Answers 2

1
\$\begingroup\$

You don't seem to have a connection to VDD. Pad 2 is VSS or ground not VDD. The picture below shows your board and an overlay from "Figure 2-3. GD32F130Cx LQFP48 pinouts" of the datasheet. The green arrow show where you could get VDD. BUT ... if you connected VDD to VSS you may have damaged the chip. Good luck.

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Oh so do I need to connect VDD to the STLINK to get SWD to work? \$\endgroup\$ Oct 1, 2023 at 15:25
  • \$\begingroup\$ Yes, you need to connect VDD to stlink. Without the proper connections you have no chance to do anything... BUT you may not be able to read the chip for the reasons given by @Justme. I don't know if a GD32 can be read with an stlink. \$\endgroup\$
    – Rodo
    Oct 1, 2023 at 17:00
  • \$\begingroup\$ I got to successfully read the chip thank you \$\endgroup\$ Oct 2, 2023 at 1:40
  • \$\begingroup\$ Please mark as answered. You're welcome. \$\endgroup\$
    – Rodo
    Oct 2, 2023 at 17:41
0
\$\begingroup\$

Many reasons why it might not work regardless of what you try:

  1. In the photo it clearly says it is not an STM32 but a GD32. So wrong MCU.

  2. Code protection flags are enabled and JTAG and SWD are disabled to make it harder or impossible to read the firmware or program a modified or custom firmware.

\$\endgroup\$
1
  • \$\begingroup\$ I am very dumb thank you \$\endgroup\$ Sep 29, 2023 at 17:32

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.