cancel
Showing results for 
Search instead for 
Did you mean: 

JTAG vs Serial Wire

christopher
Associate II
Posted on May 13, 2013 at 19:46

I'm using the STM32F407 in a new design and due to a conflict of peripheral pin assignments (Why isnt there more clk pin assignment flexibility?) I cannot use the JTDO pin of the device for JTAG. I think my only option is to use SWJ, which I have never done. I'd like to know what the tradeoffs are and if I need different programming hardware (Other than ST-Link/V2) and anything else I may need to know. I have to go straight to production hardware manufacture with this.

Thanks
13 REPLIES 13
jj2
Associate II
Posted on May 13, 2013 at 20:05

Our group converted from JTAG to SWD ~3 years past - never looked back.  We use M0s, M3s, and M4s from multiple vendors - all mate nicely w/SWD.

Believe SWD to be newer - faster in many cases - and the pin gain is an added plus.

We have a paid, pro-IDE - and use ''normal/customary'' JTAG probe - so cannot comment upon any such ''link'' built into Dev board.  And - would never/ever use such for anything remotely approaching ''production.''

We always employ 2 physical (non MCU) pull-up Rs on these SWD pins.  Suspect a proper JTAG/SWD probe should be on your early radar...

christopher
Associate II
Posted on May 13, 2013 at 22:20

Thanks for the input. That does help my confidence level. I'm using the Keil IDE for Cortex-M, and ST Micro's ST-LINK/V2 JTAG debugger probe. I'm confused about your other comments on built in debugger on a dev board and never using for production... I have a custom dev board that ive been working with but it simply has a header for STM's debugger to plug onto. I'm going to continue to be developing firmware with the first articles of my ''production'' boards, so I need some kind of SWD hardware to plug onto two pins of my production boards and interface with the Keil IDE.. when I get the firmware completed we the factory will be loading the STM32F from an SD card on the product.

Thanks

Posted on May 13, 2013 at 22:59

The stand-alone ST-LINK should be configurable between SWD and JTAG, should see a dialog in Keil. Assuming you have the stand alone pod, not the one on the Discovery boards, which JJ might be assuming.

Would generally recommend exposing USART1 or USART3 along with BOOT0 and RESET as an option to program a blank device. Depends if you have automated JTAG/SWD programming tools.

Most recently we've been favouring the 10-pin 2mm ARM SWD/JTAG header over the older 20-pin 0.1'' JTAG, mainly for space savings. We also do boundary scan testing, so really need access to the JTAG pins.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jj2
Associate II
Posted on May 14, 2013 at 00:00

Once again Clive makes excellent (saving) points.

Believe U-Link is Keil's ''normal'' JTAG/SWD probe/pod - and almost always these far surpass those ''grafted onto/appended'' to development boards.  (our findings - but 3+ years dated, perhaps - once you use a ''real'' tool - you'll never go back...)

''Exposing'' USARTx, BOOT0 & RESET will save you (at some point) - great of Clive to highlight.

Only point of difference is our firm's choice of 10 pin ARM SWD/JTAG header - we chose 0.050'' pin pitch - reducing footprint even more. (Samtec has header, mating receptacle & ribbon cable!)

Posted on May 14, 2013 at 00:36

On reflection it probably is the 0.05'' header, had 2mm rattling around for some reason.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
christopher
Associate II
Posted on May 17, 2013 at 07:38

Thanks guys!

Yes I do beleive Ive seen a JTAG vs SW option in the target settings in Keil somewhere I just havnt had time to mess with it yet.

I was already planning on bringing out the NRST pin to the same header, as well as GND, VDD.

Is there a specific reason you recomend bringing out the UART port for programming backup? Does one of the UARTs have the ability to load a blank device? What is the typical process for volume programming of blank devices like this. Ive had vendors program parts ''out-of-circuit'' before.. but this is a BGA device so now that I think of it, I have no idea how these get bulk programmed.

I certainly don't want to chance being backed into a corner, but I would hope that this serial wire programming interface is as reliable as regular JTAG??

Also, as far as the header is concerned, I was planning on using a .05 header like you mentioned. Looking at Digikey, they have a company that makes ribon cables for that pitch but the min size is 5 pin double row. if I'm trying to conserve as much space as I possibly can, do I need to create some kind of custom turn-around to get to the big bulky .1'' header on the ST-Link/V2? Or are there off the shelf options of some kind?

You mentioned that you always include external pullup resistors for the two pins on your designs. Can I ask why? and what values do you recomend?

Thanks

Chris

Posted on May 17, 2013 at 13:47

https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-20-10/

Blank devices can be programmed using the internal system loader, in ROM, exposing one of the serial ports provides a means of programming and providing system telemetry from a running system. It can do this in a way less invasive than JTAG/SWD. Consider it a CYA strategy.

You can make custom connectors, pin schemes, whatever, use test-points or edge castellations, makes little difference, although it might make your life more complicated.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jj2
Associate II
Posted on May 17, 2013 at 16:03

''You mentioned that you always include external pullup resistors...for SWD/JTAG...''

Many ARM MCUs offer ''internal'' pull ups - however should these not be the ''pre-programming'' default - or should they in any way/means ''glitch'' - your SWD/JTAG debug/programming efforts may be compromised.  Cost/size savings does not meet our standard for, ''risk/reward.''  (you will not regret!)

And - fully second/support Clive's suggestion - ''expose a UART port.''  In time - this will save you - and/or provide a most helpful capability.  Along similar lines - 1 or 2 ''exposed'' GPIO - have so often proved useful...

BTW - 10 pin, 0.050'' pitch, JTAG/SWD header is not intrusive - and 20 pin (0.100'') to 10 pin (0.050'') adapter boards are available & useful.  Extra pins may carry ground - aiding robustness...
christopher
Associate II
Posted on May 17, 2013 at 19:53

I'm not sure if this is helpfull or not. I appreciate you responding but I need my questions answered specifically. I'm aware that the device includes internal pullups on the programming pins. Thats why I asked why you need them externally. Either the internal ones work or they dont. I have no problem including external ones but WHAT VALUE? xxxK Ohms.. 10K? 100K? Who has done this and has experience?

Have you done production programming with thee devices before? What method did you use?

Thanks