cancel
Showing results for 
Search instead for 
Did you mean: 

STM32/JTAG programming interface doubts

jeferson
Associate II
Posted on April 29, 2016 at 01:24

STM32 programming interface doubts

Hello all.

I'm new to ST microcontrollers (STM32 in this case) and JTAG interface. I'm doing the schematic of a project where one of these microcontrollers will be used:

- STM32F401RCT6, STM32F373CCT6 or STM32F091CCT6

-> For the 2 first part numbers, I noticed that:

TMS = pin PA13

TCK = pin PA14

TDO = pin PB3

TDI = pin PA15 

nRST = pin 7

-> For the 3rd part number, I noticed that:

TMS = pin PA13 (SWDIO)

TCK = pin PA14 (SWCLK)

TDO = ???

TDI = ??? 

nRST = pin 7

-> TRST signal is on PB4 for the 2 first part numbers. For the 3rd part number, I didn't found.

-> My doubts are:

(1) Is TMS always on pin PA13, TCK always on pin PA14, TDO always on pin PB3 and TDI always on pin PA15 for STM32 family?

(2) Can I obtain the minimum JTAG programming interface by using TMS, TCK, TDO, TDI and nRST? (5 pins), plus GND and VDD?

(3) Are TDO/TDI signals of programmer directly connected TDO/TDI signals (respectively) of STM32 MCU? Or do I need to cross the signals? For example, connecting TDO of programmer to TDI of STM32 MCU and TDI of programmer to TDO of STM32 MCU?

(4) Is the TRST signal required for programming? Or do I need just the nRST of programmer connected to nRST pin of STM32 MCU?

I'm planning to use the ST-LINK/V2 programmmer, together with a 20-to-10 pin adapter board/cable:

ST-LINK/V2 programmmer:

http://www2.st.com/content/ccc/resource/technical/document/user_manual/65/e0/44/72/9e/34/41/8d/DM00026748.pdf/files/DM00026748.pdf/jcr:content/translations/en.DM00026748.pdf

20-to-10 pin JTAG adapter:

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

As seen in the 10 pin connector, the TRST signal isn't used, only VDD, GND, TMS, TCK, TDO, TDI, nRST...

Regards in advance.

#jtag
8 REPLIES 8
Posted on April 29, 2016 at 04:19

The Cortex-M0 parts (F0, L0, etc) do not support JTAG, only SWD

These parts can all be programmed using SWDIO, SWCLK, NRST and GND, for the non-M0 parts PB3 (SWO) can be use for trace and debug channel (SWV Serial Wire Viewer).

Unless you have other JTAG parts in your design, or are doing board level boundary scan, wouldn't SWD suffice?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 29, 2016 at 04:28

For our F2/F4 designs (144-pin) we use the cited Olimex adapter, and a fully populated 10-pin connector. I don't have the schematics to hand, but I can debug via SWD or JTAG.

We recommend/supply ST-LINKs based on their cost, I personally prefer J-Link and U-Link pods, and the boundary scan stuff is done with proprietary tools.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Mackay.Susan
Associate II
Posted on April 29, 2016 at 05:01

(Perhaps a little of topic but...)

I have sometimes seen posts such as this one (at least the first part about the pins on various devices) and I must admit that I cannot understand why such questions arise.

In my experience every device has a different set of characteristics (peripherals, speed etc.) and these are used to select the device for the purpose. Given the device I then set about the design and ultimately the board layout which must conform to the specific pin layout of the MCU.

I would really like to know why the OP is wanting to ensure that certain functions occur on the same pins for differing MCUs? Surely this is starting the design process from the wrong point but I would appreciate hearing the counter argument so I can understand it.

Susan

Posted on April 29, 2016 at 06:25

Perhaps it is a NUCLEO type design, where one board must serve many devices.

Here we've used a 144-pin footprint that is common amongst a range of F2/F4 parts, including some that had not yet shipped (2MB), and this permitted a minor BOM change, where a significant price delta was occurring between 256KB flash versions, and 1MB ones, or where more memory and an FPU, or encryption was required by a customer. Not sure this worked with things like the 401C where some idiocy occurred in the power pins and such, but it worked across a sufficiently broad range of parts to do what we needed.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
jeferson
Associate II
Posted on April 29, 2016 at 19:55

clive1 and susan:

The PCB will contain just one of the 3 mentioned microcontrollers, most probably the STM32F401RCT6.

About the doubts:

(1) Is TMS always on pin PA13, TCK always on pin PA14, TDO always on pin PB3 and TDI always on pin PA15 for STM32 family?

 

In place of word ''always'' I wanted to say ''normally''. I had this doubt because by checking the datasheet of the 3 mentioned microcontrollers they sound to have the same JTAG pinout (on the same ports, PA13, PA14, PA13, PB3), and also by viewing some google images about the JTAG interface of STM32.

(3) Are TDO/TDI signals of programmer directly connected TDO/TDI signals (respectively) of STM32 MCU? Or do I need to cross the signals? For example, connecting TDO of programmer to TDI of STM32 MCU and TDI of programmer to TDO of STM32 MCU?

 

(4) Is the TRST signal required for programming? Or do I need just the nRST of programmer connected to nRST pin of STM32 MCU?

Following this image of the link bellow. TDO/TDI of programmer are directly connected do STM32 TDO/TDI (respectively), and TRST is optional (won't be used in my case).

https://en.wikipedia.org/wiki/JTAG

0690X00000604imQAA.png

jeferson
Associate II
Posted on April 29, 2016 at 20:09

If we use the STM32F401RCT6 or STM32F373CCT6:

This is exactly what I want (be able to debug via SWD or JTAG), so I will use the same adapter board and a ''SMD 10pin 1.27mm pitch connector'' like this on PCB:

http://www.digikey.com/product-search/en?keywords=3220-10-0300-00

If we use STM32F091CCT6:

I think I'll use the same 10-pin connector on PCB, however some signals won't be used, only SWDIO, SWCLK, NRST and GND, as you said, right?

Thanks for the help.

Posted on April 29, 2016 at 20:16

1) Yes

3) Correct, directly connected as named, or with multiple devices chained as diagramed

3) No, but it can also be programmed with a subset of pins, and we haven't really ascertained why JTAG is important here vs SWD.

Do you have multiple  JTAG devices in a chain, do you do boundary scan?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
jeferson
Associate II
Posted on April 29, 2016 at 20:45

Hi.

No, there will be just one JTAG device, the microcontroller.

I'm just starting to read about boundary scan, that's something new to me, I'm trying to figure out how this works in practice.

Regards.