8
\$\begingroup\$

I've designed a simple STM32 board. Below are the schematic and pcb layout pictures:

Schematic:
enter image description here

PCB layout: enter image description here

PCB layout with VDD hightlighted: enter image description here

PCB layout with GND highlighted: enter image description here

Only the parts of this design which are relevant to my question are shown in the above pictures.

My problem is: I tried to use the built-in ST-Link of a STM32 Discovery Board to program this custom board, but I couldn't succeed yet. The ST-Link Utility application on PC can recognize the programmer, but it cannot detect the target MCU. The errors messages I got were: "Target not connected" and "ST-Link USB Communication Error".

Here are some related facts about my problem:

  • The STM32 Discovery Board works fine: I can use it's built-in ST-Link to program it's on-board STM32 MCU. This is ok.
  • The STM32 MCU has been soldered with correct orientation on the custom board. I checked this twice.
  • I have checked VDD and SWD traces. They are connected well (no soldering problem). Pin Boot0 is at 0V. Pin NRST is at 3.3V.
  • The SWD cable is short, only 7-8 cm in length.
  • The STM32 on my custom board is of the same type as the one on the Discovery Board.
  • I have followed instructions in the STM32 Discovery Board's manual on how to use the Discovery Board to program an external STM32 MCU. To be more specific, I removed the 2 CN3 jumpers, and then I connected the boards as in this table: enter image description here

  • I also removed the solder bridge SB11 on the Discovery Board (so that pin NRST can work properly).

  • I have tried both the ST-Link Utility app and Keil. The error messages I got are the same.
  • At first I didn't connect pin 6 on the above table (SWO) because to my knowledge it's not necessary. However after that I connected it as well, but things still didn't work out.
  • I also added a 100nF cap from pin NRST to GND, and then a 100k pull-up resistor from this pin to VDD. The problem still remains.
  • I've also tried to use the "connect under reset" mode of the ST-Link Utility program. No luck either.

I suspect that there might be something wrong with the design, but I'm not sure. Please help me to solve the problem.

Thank you very much :)

\$\endgroup\$
  • \$\begingroup\$ As far as I remember, you have to power both the st-link and your custom board. The 3.3V in the SWD connector of your custom board has to provide the 3.3V for the st-link to detect. \$\endgroup\$ – davidrojas Dec 29 '16 at 12:05
  • \$\begingroup\$ @davidrojas: Thank you for your answer. Well, currently I power the ST-Link by the USB port from my PC. The custom STM32 board is powered by an external, separate 3.3V. However the ground of these 2 boards are already connected (as in the above table). Also, the 3.3V from my custom board is connected to VDD_TARGET on the ST-Link too. Do you think this is enough? \$\endgroup\$ – user3286500 Dec 29 '16 at 12:11
  • \$\begingroup\$ It should be enough, yes. Another issue could be the length and layout of the lines SWDIO and SWCLK, I have had problems of intermittent connection in the past because of this. They have to be as short as possible. Try lowering the speed of the SWD also. \$\endgroup\$ – davidrojas Dec 29 '16 at 12:18
  • \$\begingroup\$ I have lowered the SWD speed, from the default 1.8 MHz to under 400 kHz, but still not successful. As to the cable length, in my setup the total length of the SWD connection (from ST-Link to the target STM32) is about 12-13 cm. Is this still within limit? \$\endgroup\$ – user3286500 Dec 29 '16 at 12:27
  • 1
    \$\begingroup\$ Did you notice that the ground pour under the chip is physically isolated, and not actually connected to any of the ground pins? The actual connections among the ground pins follow tortuous paths outside the chip, and some of them might actually be isolated. You need to adjust your clearances so that the ground pour does not have isolated islands, and this will help make sure that all of the ground pins of the chip are much closer to the same potential. \$\endgroup\$ – Dave Tweed Dec 29 '16 at 14:05
5
\$\begingroup\$

Thank you for your great comments. Because of them, I have been confident that my design is error-free. That's why I focused my attention to search for errors in the hardware. And I found the error! This is a soldering error.

I found this error after following this instruction: "Use a multimeter and test all of the connections for shorts or lack of connection. Remember to touch the pins/pads/whatever really gently, because if you press the probe hard, you may "fix" the connection temporarily (for example you push the pin of IC to the trace on PCB and the test is OK, but as soon as you let go the pin bends up again)." The original post is here.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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