cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 and UlinkPro D

Bjoernar Maelum
Associate II
Posted on March 15, 2017 at 17:45

Hello!

I want to program/debug an STM32F407 using the UlinkPro D. I have connected the Ulink to STM32 using datasheet for the micro controller and found what I think is the correct pinout for the Ulink.

Serial Wire Debug is being used as this seems the easiest, unless you have a better suggestion for this micro controller.

I am a beginner at this and wonder if there is a tutorial somewhere, and if not: Can I find a Setup Guide of some sort to connect the two devices?

Is there anything specific I have to do to the STM32 or in Keil other than checking if the Ulink is connected and then trying to flash?

The error 'SWD Communication Failure' is showing when I look at setting under 'Debug' in the 'Options for target...'.

Thanks,

Bjørnar
9 REPLIES 9
Posted on March 15, 2017 at 18:25

http://www2.keil.com/coresight/coresight-connectors/

 

Sounds like it is not wired up properly. External pods tend to depend on getting the VTref (Target Voltage) to power their buffers. Make sure you don't have the connection backward.

For wiring of the board headers, I suggest a review the STM3240G-EVAL or MCBSTM32F400 schematics. The later I've used with the U-LINK Pro (non D), you have to disconnect some high order address pins via jumpers for trace

http://www.keil.com/mcbstm32f400/

 
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 16, 2017 at 15:06

It seems I have connected the pins correctly.

The reason I am doing this is to learn how to program the STM32F407VGT6 chip. I am making my own PCB and want to know how to program the chip before I print the PCB. Is it better to use an ST-Link for this? As I mentioned earlier I am fairly new to this and does not know quite where to begin. 

Using SWD it seems I only need SWDIO, SWCLK, 3V/VDD and GND to program the chip, is this correct? 

Posted on March 16, 2017 at 15:53

I would add NRST to that list, I'd also recommend adding SWO (PB3) to permit the Serial Wire Viewer (SWV) to work.

The 3V (VTref) is needed for buffered pods, if you use a DISCO/NUCLEO board this isn't required as there are no buffers.

We use full JTAG on the 10-pin header as it permits boundary scan of the boards.

A cheap ST-LINK is perfectly adequate to program/debug boards.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 16, 2017 at 16:19

Okey, I have added a button for NRST to reset the board, does it need a connection to the ST-Link or is it just to reset the board before/after programming/debugging?

What benefits do I get from using the SWV as opposed to not implementing it? 

I was thinking of connecting the ST-Link to the STM32F407VGT6 using the SWDIO, SWCLK, 3V and GND. Add the NRST to reset the chip and the SWV since you recommend it. 

To sum up I have to route on the PCB layout: PA13(SWDIO) and PA14(SWCLK), SWV, 3V and GND as well as a button for the NRST to function. 

Does this seem correct?

I have ordered a ST-Link V2.

Posted on March 16, 2017 at 16:55

NRST in this context lets the debugger wrestle control of the part.

PB3 SWO provides a means of getting telemetry via the debugger (Keil's Debug printf), without having to connect a serial port.

Use standard header configurations, it saves a lot of unnecessary mucking around.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 17, 2017 at 11:12

I see, do I connect the NRST to the same as the one connected to the button or do I use the JTag NJTRST?

Also, what do you mean about standard header configurations? Is it for just plugging in a contact from the ST Link instead of dealing with wiring it up with jumpers?

Posted on March 17, 2017 at 16:34

NRST is the processor reset, that's the one you want, the debugger pod or other circuitry can drive low using open-drain driver.

Per the cite earlier : 

http://www2.keil.com/coresight/coresight-connectors/

 

It saves a lot of time/effort if these standards are used, rather than inventing assorted 4-6 pin single in-line headers where you have to dig out the schematic/documentation every time you get a new board.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Bob Boys
Senior
Posted on March 03, 2018 at 20:44

Hello

Here is an answer I received from Hans, one of the Keil engineers:

The TRST signal was never really necessary. It exists on many ARM7/9 and also Cortex-M3/4 devices but it is only available in the old 20 pin JTAG connector. The newer 10 pin Cortex and 20 pin Cortex+ETM connectors do not contain this signal. There are newer devices (especially Cortex-M0) which only have a SWD (no JTAG) interface and they don?t have a TRST signal at all. So one can leave this signal off. This saves one pin.

uVision uses the methods to RESET the part:  you can select them here:

A ULINK D is a ULINKpro without ETM instruction trace.  SWV works fine.

0690X00000609tdQAA.png
Bjoernar Maelum
Associate II
Posted on March 03, 2018 at 22:53

Thank you, Clive and Bob!

Sorry for not responding to this thread until now.

I have resolved the issue and the PCB is working perfectly. This project was finished in June 2017 but I forgot to respond to this thread. 

I looked up the documentation and we ended up connecting

the SWCLK to PA14, SWDIO to PA13 as well as 3V3 and GND signals to the STM32-chip. Keil found the ST-link and both debugging and programming worked perfectly. 

We used the ST-LINK/V2 for this.

http://www.st.com/en/development-tools/st-link-v2.html

 

Thanks for the help!