STM32L MCU - SWD pin on board not matching processor pinout

Use a multimeter. You will probably find that those pins are connected to the SWD pins. Note that PA14 clearly goes to a via, which will then run along the bottom side of the PCB.

PA13 most likely runs underneath the micro, and into a via, and runs to the SWD header through the bottom layer too.

Just because you look at something from the top and cannot see a connection, does not mean that it is not there. Look at PA14. Can you see a logical way of running a track to the SWD header pins on the top layer? No, you would have to cross a lot of traces which you just can not do. This is why vias are used, so the track can continue on the other side of the PCB.

You should never look at a PCB and assume because you can't see a trace all the way along the top side of a board, that it is not connected. Get a multimeter and check for continuity. I suspect you will find there is a connection there.

There are actually 6 SWD pins used for programming (if you program via SWD) which are V+, GND, RST, SWIO, SWCLK and SWO. If this board was programmed via SWD, there are lots of pre-made flat cables used for programming, such as this one:

enter image description here

And the programmer will have a pre-made pinout that the designer needs to follow. That is the likely explanation for the extra pins on the header. It usually depends on the programmer being used as to which header is used in the design.


You research is correct. SWD cannot be remapped, but the pins can be used otherwise.

The connector is non-standard. Typically people use the 10 pin SWD connector (often with 1.27mm pitch) for ARM JTAG/SWD.

To communicate with the chip you need 4 pins.
Target gnd and vcc, and SWDIO, SWDCLK. The programmers use target Vcc for their level shifters. Since many ARM targets can run voltage from 1.8 to 5 Volt.

The reset pin is not required, unless the pins are used otherwise in user code. As in internally disconnected from the debug peripheral.

Popular programmers are the ST Link for STM32 and STM8 chips. Or Segger for various brands.