Author Topic: STM32: Best practices for adding an STDC14 (STLink) debug connector  (Read 11936 times)

0 Members and 1 Guest are viewing this topic.

Offline dkonigsTopic starter

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
As I work through the design for my current project (likely using an STM32F4), it seems obvious that I'm going to want some way to actually do in-circuit programming and debugging of the target. To that end, the "standard" way of connecting a recent ST-Link (v3) device seems to be via an STDC14 connector.

While the pin-out and physical part for this connector is quite easy to come by, what I have not yet found are actual guidelines for how to most appropriately integrate this into your actual target device.

Thus far, my strategy has been to find one of STM's development boards that actually has an STDC14 connector (many don't, but some do), and see how they've managed to wire it in.  Looking at the schematics for the Nucleo64 STM32G4, for example, its mostly just wired to the obvious pins. (Along with ESD protection on most of the lines, an in-line resistor on JTDI, and some notes about SWDIO/SWCLK routing.)

In any case, does anyone know of good documents and/or schematics that contain the "best practices" guidance for how to integrate an STDC14 connector?
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4436
  • Country: dk
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #1 on: October 22, 2020, 09:58:51 pm »
I just put SWDIO,SWCLK,Reset,Vcc and ground on a connector, usually just a SIL pinheader
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #2 on: October 23, 2020, 09:16:28 pm »
I just put SWDIO,SWCLK,Reset,Vcc and ground on a connector, usually just a SIL pinheader

I'm still adding SWO. And I make a separate RX/TX/GND connector for USART0, which I use as a console.
And sorry for my English.
 

Offline LootMaster

  • Regular Contributor
  • *
  • Posts: 175
  • Country: ca
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #3 on: October 23, 2020, 09:24:16 pm »
I also put on the SWO everytime if possible. But its not mandatory (if you really need that pin).

It should always be the mini cortex 10 pin header, for a single ARM uC.

If you intend to have a chain of uC, then you need the JTAG. This can also be had in 10 mini cortex header.

Be aware that ST-LINK ( all versions) dont support JTAG chains. Only J-ink does.

If no intention of chain, dont use JTAG over SWD.

No need for ESD, just dont hotplug it...Pullup on SWO and NRST, pull down on Boot0. direct connection SWDIO and SWDCLK. That's it...

ESD is for really big boards with long traces, they recommend putting it for legal/liability reasons in case you are a moron who does not know basics.

In reality, not many people in the real world put ESD on their debugging/flashing lines.

Good luck!
« Last Edit: October 23, 2020, 09:35:36 pm by LootMaster »
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #4 on: October 24, 2020, 01:13:44 am »
I also put on the SWO everytime if possible. But its not mandatory (if you really need that pin).

I output SWO so that I can remotely see the output to the console. I use the CodeGrip programmer-it allows you to perform wireless debugging and monitoring SWO via WiFi. This is very convenient, there is no need to be in an inconvenient and aggressive environment of an industrial enterprise, you can connect the programmer and stay in the operator's room.

It should always be the mini cortex 10 pin header, for a single ARM uC.

It takes up a lot of space on the board. Simple pins are much more compact.  :)

And sorry for my English.
 

Offline LootMaster

  • Regular Contributor
  • *
  • Posts: 175
  • Country: ca
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #5 on: October 24, 2020, 01:36:37 am »
Whatever fits with st-link v3 out of the box.

I aint THAT space constrained.

 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #6 on: October 24, 2020, 02:07:30 am »
Whatever fits with st-link v3 out of the box.

I aint THAT space constrained.

You probably haven't squatted with a notbook and ST-Link v3 near a hot, stinking, and rumbling machine - for you, remote debugging doesn't matter.  :)
And sorry for my English.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #7 on: October 24, 2020, 02:09:00 am »
It takes up a lot of space on the board. Simple pins are much more compact.  :)
Standard Cortex-M debug connector (5x2 0.05" spacing) is the same area as 3 pins of 0.1" connector. Just don't use shrouded connector. Shroud takes most of the space.
Alex
 

Offline LootMaster

  • Regular Contributor
  • *
  • Posts: 175
  • Country: ca
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #8 on: October 24, 2020, 02:13:25 am »
Whatever fits with st-link v3 out of the box.

I aint THAT space constrained.

You probably haven't squatted with a notbook and ST-Link v3 near a hot, stinking, and rumbling machine - for you, remote debugging doesn't matter.  :)

I have not.

But I like that method, sounds interrestint for future projects.

What IDE/ what debugger/ what processor?

Right now I have all free software or inexpensive debuggers... ST-LINK V3 mini is 20$ :)
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #9 on: October 24, 2020, 02:41:15 am »

You probably haven't squatted with a notbook and ST-Link v3 near a hot, stinking, and rumbling machine - for you, remote debugging doesn't matter.  :)

I have not.

You're lucky. And I have to invent systems for managing industrial equipment and often perform on-site debugging.

What IDE/ what debugger/ what processor?

I use mikroPascal compiler and debugger, CodeGrip programmer, STM32F107VE processor.
And sorry for my English.
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #10 on: October 24, 2020, 02:50:55 am »
Right now I have all free software or inexpensive debuggers... ST-LINK V3 mini is 20$ :)

My kit is more expensive... Compiler $299, programmer $99 + WiFi license $100. Total: $498.  |O

And sorry for my English.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #11 on: October 24, 2020, 07:10:26 am »
Standard Cortex-M debug connector (5x2 0.05" spacing) is the same area as 3 pins of 0.1" connector. Just don't use shrouded connector. Shroud takes most of the space.
Are these connectors still that expensive?
Last time I bought them four years ago they were over $1 a piece.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #12 on: October 24, 2020, 07:19:25 am »
Are these connectors still that expensive?
Last time I bought them four years ago they were over $1 a piece.

Depends on whether you are ok buying direct from China. Here is the first result when searching for "2x5 1.27mm 100pcs" - https://www.aliexpress.com/item/32795241952.html ($3.10 + $4.72 shipping to US). 8 cents/piece is pretty cheap.

"Reputable" distributors always charge outrageous amounts of money for trivial connectors. So I'm not even considering them anymore.
« Last Edit: October 24, 2020, 07:22:39 am by ataradov »
Alex
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #13 on: October 24, 2020, 07:28:43 am »
Yes that was for the company I worked for back then.
In the end we kept the pcb footprint but left the connector out due to price.
Also if you place/remove the connector a lot of times they damage quite quickly.
Company bought (custom order) a few fast debug/program adapters. Those are milled from POM/Delrin, contain those gold probe contacts and a few fastclamps to clamp the board to the probe contacts.
If you ever make something for yourself over 50 pieces I can recommend that.

PS those are TH connectors , we had SMD types, those are way more expensive.
« Last Edit: October 24, 2020, 07:30:29 am by Kjelt »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #14 on: October 24, 2020, 07:32:31 am »
I use that connector on all my boards, I have not had one damaged yet. I'm not sure how much you need to be disconnecting/reconnecting the debugger for it to be damaged.

Plus you really don't need that connector on the mass production boards. Having just the footprint for the bed of nails is a much better idea.

SMD connectors take up more room. And having a though hole connector is much easier for routing in most cases anyway.

Also, they are not all that more expensive. Here is SMT listing for 10 pcs (I can't easily fine one for 100 pcs) https://www.aliexpress.com/item/32972376101.html ($0.90 + $1.03) - 20 cents/piece. And you can combine shipping, so buying in bulk will be much cheaper.
« Last Edit: October 24, 2020, 07:37:23 am by ataradov »
Alex
 
The following users thanked this post: Kjelt

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #15 on: October 24, 2020, 08:00:33 am »
Oh the same troubles you have with the micro usb connectors, they sometimes snap off the board but that is rare.
TH will be much sturdier than smd. Always keep a stock of the cables they sometimes just make bad contact after hundreds use.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #16 on: October 24, 2020, 08:05:04 am »
Always keep a stock of the cables they sometimes just make bad contact after hundreds use.
From the same source, I've got corresponding connectors and wire, so I can make my own cables any time I like with any connector polarity and cable length. Again, you get 10x price reduction compared to pre-made cables from typical suppliers. I also sell debuggers that come with those cables, so I need to have that anyway.

Sometimes the pricing of the readily accessible cables makes no sense at all. There are cases when it is cheaper to buy a dev. kit that includes the cable than to buy the cable alone.

That being said, I have not really worn any of the cables I have. And I do quite a bit of switching between the boards.
Alex
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #17 on: October 24, 2020, 02:13:16 pm »
Having just the footprint for the bed of nails is a much better idea.

I was trying to find a needle-like spring-loaded plug that could somehow be securely attached to the board when plugged in.
In production, this is easy when the board is fixed in bed  -just put your fingers down.
But I haven't managed to implement this connection in the fields yet. Something like a magnetic USB I want to use.
And sorry for my English.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #18 on: October 24, 2020, 05:10:25 pm »
I was trying to find a needle-like spring-loaded plug that could somehow be securely attached to the board when plugged in.
You are describing Tag-Connect system.

But I personally see no use for the Tag-Connect  It blows up your board space requirements and does not really add anything.

For development, I just rather plug in a real connector. For production you will use a bed of nails. Or if you are doing manual programming, just hold  the through hole connector on the holes.
Alex
 

Offline cgroen

  • Supporter
  • ****
  • Posts: 631
  • Country: dk
    • Carstens personal web
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #19 on: October 24, 2020, 05:23:38 pm »
I use Tag-connect for everything I make. I use the "no legs" version, using SWD and SWO also.
Compared to (in this case a 2x6 pin 0.05" header, the space saving is significant)
For prototyping, there is a small "lock" you push on the pins on the back of the PCB, this will keep the TAG connect probe for weeks. I also use it for programming finished boards (if low(er) quantities).


 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #20 on: October 24, 2020, 05:31:07 pm »
But if you compare it to the though hole 2x5 standard connector, then it is the same area as you 6 pin Tag-Connect. You still have to drill holes for the Tag-Connect, so the advantage of the SMT connector is not really there anyway.

And the connector thing from the Tag-Connect is huge and always gets in a way and applies leverage to the board.

The only times I had to use them is when customer's boards used them, and every time it was a pan in the rear.

I really don't get them.
Alex
 

Offline cgroen

  • Supporter
  • ****
  • Posts: 631
  • Country: dk
    • Carstens personal web
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #21 on: October 24, 2020, 05:37:50 pm »
But if you compare it to the though hole 2x5 standard connector, then it is the same area as you 6 pin Tag-Connect. You still have to drill holes for the Tag-Connect, so the advantage of the SMT connector is not really there anyway.

And the connector thing from the Tag-Connect is huge and always gets in a way and applies leverage to the board.

The only times I had to use them is when customer's boards used them, and every time it was a pan in the rear.

I really don't get them.

We use only SMD whenever possible. The "lock" for "permanently" attaching the probe is super small, 4.5 x 11 mm. No problem for us and we avoid a through hole footprint

 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #22 on: October 24, 2020, 07:04:28 pm »
But if you compare it to the though hole 2x5 standard connector, then it is the same area as you 6 pin Tag-Connect.
The only advantage is that it is assymmetrical, you can not connect it the wrong way around as you can with the 2x5 idc connector.
But I also prefer the 5x2 idc because there are multiple (cheap) suppliers.
 

Offline blueduck577

  • Newbie
  • Posts: 7
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #23 on: October 24, 2020, 07:08:30 pm »
If you don't need the virtual COM port on the STDC14 connector, I would recommend just using the standard ARM 10-pin connector.  Fitting the 14-pin connector prevents you from using 10-pin cables.  If you use the 10-pin Samtec header FTSH-105-01-L-DV-K-A-TR, you can still plug in the 14-pin cable from the ST Link and use it no problem but also remain compatible with debuggers using the 10-pin standard.
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: STM32: Best practices for adding an STDC14 (STLink) debug connector
« Reply #24 on: October 24, 2020, 09:13:20 pm »
We use only SMD whenever possible. The "lock" for "permanently" attaching the probe is super small, 4.5 x 11 mm. No problem for us and we avoid a through hole footprint

Can you provide more details about what we are looking at?

I see two pins protruding up. Are those the two signal pins? Aren't they too close and will short?

I see a hole with a pin pushed (from the bottom). What is that about. Looks interesting how it is holding the board.

Thanks!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf