I'm using STM32L152 MCU on my own project. The project was started on a STM32 Discrovery board. Now I would like to have my own board by designing a PCB with the MCU. An external ST-Linkv2 will be used as the debugger/programmer. (Tested works fine with another discorvery board) A 6-pin SWD connector was designed on board. The pin mapping between ST-Link and MCU is following the user manual.

  • SWD pin1 VDD_TARGET VDD from application;
  • SWD pin2 SWCLK SWD clock;
  • SWD pin3 GND Ground;
  • SWD pin4 SWDIO SWD data input/output;
  • SWD pin5 NRST RESET of target MCU;
  • SWD pin6 SWO Reserved;

After I got my board, I connect the board with the ST-Link. The board is powered up by an external voltage source of 3.3V. However, the ST-Link is not able to find the MCU. My current objective is to let ST-Link program my MCU PCB via SWD. It should not be a complex design then. Attached is my schematic design: enter image description here

I think the exteral crystal may not necessary now for the design. If there is nothing missing in the schematic, it maybe something wrong with the input voltage. I wired all the Vdd to Vcc. I also read from online, so BOOT0 is wired to ground, and BOOT1 is left no connect. Is there anything I do missed?

My PCB layout is as following: enter image description here

  • \$\begingroup\$ Personally, I NEVER trust the ~RST from a programer. I always make that a discrete switch. That could be your problem. It could also be that you chip needs to have those pins tied a certain way to use SWD instead of full JTAG. Check the data sheet again. \$\endgroup\$
    – Dave
    Feb 1, 2016 at 1:33
  • \$\begingroup\$ Can you post your pcb layout? \$\endgroup\$
    – MathieuL
    Feb 1, 2016 at 2:24
  • \$\begingroup\$ I posted my layout, and I have a question that is it allowed to have routes on top layer that under the chip area? \$\endgroup\$
    – Terry Lee
    Feb 1, 2016 at 3:12
  • \$\begingroup\$ Have a look at ST's Hardware development appnote for the STM32L1. The appnote uses JTAG, your SWD configuration is also fine. If you don't plan on using the RTC you can skip the 32 kHz Oscillator. \$\endgroup\$
    – manuel
    Feb 2, 2016 at 19:34

1 Answer 1


Your layout is entirely lacking in decoupling capacitors. The MCU won't run with that layout and the clock probably won't even oscillate.


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.