cancel
Showing results for 
Search instead for 
Did you mean: 

USB port for debug and programming

DRote.2297
Associate II

Hello,

I've been using the NUCLEO-L476RG board for development. Now I want to design my own PCB with the same component. My question is about the JTAG port - in the NUCLEO board it is implemented as a USB connector but they used an additional uC for that. I would like to use only the stm32l476RG. I see in its datasheet that it has USB connectivity but I can't find the USB pins in the pinout section.

Would appreciate some kind of reference or application notes for USB connector for this coponent, so that I'll be able to connect it to a PC in order to program it, debug and read data over serial.

Thank you,

David

1 ACCEPTED SOLUTION

Accepted Solutions

You can choose your own connector. Needs only 3 pins at minimum: SWDIO, SWDCLK, GND.

Some additional pins may be helpful: NRST, SWO, Vdd

For testing, you may even reconfigure the SWD interface on the NUCLEO-L476RG board to connect to your PCB.

View solution in original post

10 REPLIES 10
Pavel A.
Evangelist III

You'll need an external ST-LINK debugger dongle. Its interface to the MCU is described here (both JTAG and SWD modes)

These dongles come with their own USB connector.

-- pa

Thanks for the prompt answer. In the link you provided I see a standard 20-pin JTAG connector. Does it mean that I need to place that connector on my board and purchase a debugger?

I'm trying to make my board as small as possible, would it be possible to route the JTAG and SWD signals to a USB (or any other small) connector?

Can I use SWD mode for data transmission and not only debug?

Thanks,

David

KnarfB
Principal III

I would use a STLINKV3-MINI or similar for flashing and debugging your PCB.

PA11/PA12 are the D-/D+ pins, OTG_FS_DM, OTG_FS_DP https://www.st.com/resource/en/datasheet/stm32l476je.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

>  Does it mean that I need to place that connector on my board and purchase a debugger?

Basically yes, For the connector you have options.

SWD interface needs only 4 pins: SWDIO, SWCLK, VCC, ground. Two more are optional (nRST, SWO).

For the cheepest ST-LINK dongles you need only these 4 pins.

Some designers prefer 6-hole connector for this cable. It is cool... but quite expensive.

-- pa

Thanks. If I connect those pins directly to a PC (with VBUS and GND), can I use this connection for programming, debug and data transmission? If so, do I need a special tool, or a simple USB cable will do?

Thanks

KnarfB
Principal III

programming: yes (USB DFU bootloader)

data transmission: yes, must be implemented in SW

debug: no

There are many app notes... on st.com, pls. check.

That looks like a good solution, my only concern is that the connector is quite big, while I'm trying to make my board as compact as possible. Is there anything similar with a smaller connector?

You can choose your own connector. Needs only 3 pins at minimum: SWDIO, SWDCLK, GND.

Some additional pins may be helpful: NRST, SWO, Vdd

For testing, you may even reconfigure the SWD interface on the NUCLEO-L476RG board to connect to your PCB.