2
\$\begingroup\$

I have been trying to program my STM32L476RG micro-controller based breakout board using ST-LINK v2 as the programmer. I have hooked every VDD of breakout board to 3.3 V pin of programmer and connected VSS of breakout board to ground.

Also, I've connected SWCLK and SWDIO respectively. But every time I try to connect it in ST-LINK Utility it is initially giving me "Can not connect to target ST-LINK. After I reset it is giving "USB Communication Error" and same error thereafter.

I have tried using solutions presented in Patrick Hood-Daniel tutorial and also pulling up the BOOT0 pin but neither seem to work.

Any suggestions on this problem will be of much help.

\$\endgroup\$

closed as unclear what you're asking by mkeith, Scott Seidman, laptop2d, Elliot Alderson, Finbarr Jan 1 at 11:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ Is it a custom board? If so, I'd guess that you've simply made something wrong with the wiring, but that's just a guess until you give us more details \$\endgroup\$ – elasticman Sep 17 '18 at 7:20
  • \$\begingroup\$ Here is the micro-controller stmcu.org/module/forum/data/attachment/forum/201511/03/… and connections were made as I mentioned earlier. \$\endgroup\$ – user198635 Sep 17 '18 at 9:28
  • \$\begingroup\$ You mentioned the microcontroller already. Could you also provide the name / schematics of the used breakout bourd? \$\endgroup\$ – elasticman Sep 17 '18 at 9:40
  • \$\begingroup\$ image.ibb.co/jvxVWe/stm32breakout.png here is the link to the schematic of breakout board and in this numbering is starting exactly from the pin marked JP2 and follows the counter clockwise format hence the pin just above JP2 is 64. \$\endgroup\$ – user198635 Sep 17 '18 at 14:11
  • \$\begingroup\$ And how exactly have you wired VDD / VSS? Normally, you connect all the power supply pins together with decoupling capacitors and don't connect each single pin to your power supply. The breakout does not provide any external component, such as capacitors, oscillators or a USB header, does it? So there is room for plenty of errors here. \$\endgroup\$ – elasticman Sep 17 '18 at 14:19
2
\$\begingroup\$

I have hooked every vdd of breakout board to 3.3V pin of programmer and connected vss of breakout board to ground.

The ST-Link does not provide power to its target. The VREF pin on the programmer is used to sense the target's operating voltage, not to supply it. You will need to supply power to the microcontroller separately.

Additionally, the breakout board you're using does not contain any decoupling capacitors close to the supply pins. This will prevent the microcontroller from working properly -- adding capacitors at the pin headers will not be sufficient, as the inductance of the traces, pins, and capacitor leads will prevent the capacitor from responding at the high frequencies required for decoupling capacitors. You will need to redesign this board with one (SMD) ceramic capacitor located within ~1cm of each VDD pin.

Please refer to some of ST's development boards as an example of how to implement this part -- schematics are available on ST's web site. You may be particularly interested in the Nucleo-64 series, which includes some boards with this exact part.

\$\endgroup\$
  • \$\begingroup\$ About the micro-controller breakout board here is the schematic, please follow the link stmcu.org/module/forum/data/attachment/forum/201511/03/… \$\endgroup\$ – user198635 Sep 17 '18 at 9:26
  • \$\begingroup\$ As you can see there are multiple VDDs. \$\endgroup\$ – user198635 Sep 17 '18 at 9:27
  • \$\begingroup\$ Also I used 0.1uF capacitors as bypass capacitor and yes VSS pins are internally shorted. but using bypass capacitors didn't rectify the issue mentioned. \$\endgroup\$ – user198635 Sep 17 '18 at 12:18
  • \$\begingroup\$ That's not a schematic. That's just a pinout of the microcontroller. \$\endgroup\$ – duskwuff Sep 17 '18 at 16:22
  • \$\begingroup\$ image.ibb.co/jvxVWe/stm32breakout.png here is the link to the schematic of breakout board and in this numbering is starting exactly from the pin marked JP2 and follows the counter clockwise format hence the pin just above JP2 is 64. \$\endgroup\$ – user198635 Sep 17 '18 at 16:40

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