‎2020-08-25 04:34 AM
Hey, iam working with a STM32 L432KC with an ST-Link onboard.
Iam am planning to create a PCB with the same chip and iam wondering how i could programm/debug it.
I read through the Instructions and i think SWD is the right thing for me.
I have a STM L452RE-P laying around. This is Board with a "ST-Link-Section" witch you can break off the PCB. (so you break the PCB in two parts and have the ST-Link part and the microcontroller part )
How can i programm/debug my L432KC with that ST-Link part off the L52RE-P?
ive found the SWD clock and data pins on the ST-Link part but i dont know where to connect them to the L432. Pin PA14/13 (SWCLK/SWDIO) are not routed to any pins of the PCB
Thank you!
Solved! Go to Solution.
‎2020-08-26 05:27 AM
>I connected SWDIO, SWCLK, GND and VDD from the ST-Link(broken off) to the SWD Connector of the Nucleo Board.
Connector CN2? No. As clive1 and I said: this is the SWD interface of the ST-LINK chip on the Nucleo-32 board. Only STM might use that during board production.
Try the following:
Now, the Nucleo-32 board should be found by STM2CubeIDE debugger or STM32Programmer.
You cannot use an external ST-LINK on a Nucleo-32 without hacking the board.
Later, when you have your board, connect the broken-off ST-LINK to it as show in the link I gave you in the beginning or as shown in the Nucleo-32 board schematics.
hth
KnarfB
‎2020-08-26 06:48 AM
okay, thats working.. i thought i cant use the onboard debugger anymore.. Thank you very much!
to make that clear:
On my own PCB design ...
I just need a 4 pin connector to GND, 3.3V, SWCLK(PA13), SWDIO(PA14) to connect to the ST-Link?
What about a reset ? i thought, the debugger has to tell the MCU ro reset ? (after flashing)
should i use a 5 pin header with a reset? would it be correct to route that reset pin to NRST?
what about UART? my USART2_TX pin is PA2.. can i connect that to VCP_RX of the ST-Link?
that would be a 6 pin connector ? am i thinking right?
‎2020-08-26 08:03 AM
3.3V supply and GND are needed for your board to work.
For a ST-LINK debug connection
> What about a reset ? i thought, the debugger has to tell the MCU ro reset ? (after flashing)
A MCU reset can also be triggered by some magic SWDIO+SWDCK commands. But this is "soft" and works only when the SWD interface is available, i.e. SWD pins are not reconfigured and MCU not in certain low-power modes. The NRST can give it a "hard" reset anytime, which is more powerful.
Take a look at the broken-off of your Nucleo-64-p board (User manual UM2206). It has GND, SWCLK, SWDIO, NRST, SWO on pin 2-6 of CN3 and VCP_RX and VCP_TX on the connector nearby. You cannot fail if you make those signals available on your board.
CN3 Pin 1 marked VDD_TARGET is a special case. It is an input to SWD for detecting the target (debuggee) VDD voltage which can be evaluated by the debugger. High-end debug probes can use that pin for IO level conversion, galvanic decoupling etc.. Think of it as a 1-channel digital voltmeter input. Maybe useful to connect too, especially to detect low battery... scenarios.
Beware: some low-cost ST-LINK debug clones have a 3.3V pin which acts as an output to power the target, this is not the standard, do not connect.
STM AN4989 Application note "STM32 microcontroller debug toolbox has valuable info on debugging, SWO etc..
‎2020-08-27 01:13 AM
thank you man! this information is so useful! I dont want to end up witch a MCU on a selfmade PCB wich i cannot programm/debug :face_with_tears_of_joy: