cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103RBT6 basic requirement to load program with SWD

jean2
Associate II
Posted on January 28, 2014 at 10:50

Hi! 

I have been playing with a STM32f103rbt6 chinese board for the last few months, it's working well. I am using the SWD of my stm32F4 discovery to upload the program. 

Now i wanted to make my own board, so i designed one based on the schematic of this chinese board and the same micro-contrôleur, but impossible to program it... I always get a ''Can not connect to target'' error with stm32 utility. 

So i focused on what's is really important to just push a program with SWD, i have : 

 -Every VDD to a 3.3V, all of them with 1uF capacitor. 

 -All the VSS to the ground

 -Reset with 10k pull up

 -BOOT0 and BOOT1 to the ground

 -SWDIO to PA13 with 10k pull up

 -SWCLK to PA14 with 10k pull down

Anything else really mandatory to upload with SWD? Do i need to add a quartz? Why some people use a 8MHz quartz and some other 8.192MHz? 
19 REPLIES 19
chen
Associate II
Posted on January 28, 2014 at 11:11

Hi

Why do people never read the manual?!?

It is all in the manual people!

See the section titled ''Debug support'' in the reference manual.

There are 5 pins needed for JTAG/SWD

JTMS/SWDIO - which you have

JTCK/SWCLK - which you have

JTDI

JTDO/TRACESWO

NJTRST

You must actively drive the SWD pin during programming.

''Do i need to add a quartz? Why some people use a 8MHz quartz and some other 8.192MHz? ''

This just provides a very stable source for clocking the processor. I do not know why people use the 8.192MHz but it should make little difference (unless you require absolute timing - in which case you must work all you timing calculations back to the the source clock)

jean2
Associate II
Posted on January 28, 2014 at 11:30

Thanks for the quick answer, 

But if i use the Serial Wire Debug (not the JTAG)on the manual i just need SWCLK, SWDIO and the Reset (For the Reset i don't use it on my chinese board...). Or is it because it s the first time i use the chip?  

So if i anderstand well, external clock is just to have a more stable source, the internal one is enough to get the program on the chip. 

chen
Associate II
Posted on January 28, 2014 at 11:36

Hi

What are you using for the debugger?

ALL debuggers must conform to the JTAG/SWD interface specified by ST

jean2
Associate II
Posted on January 28, 2014 at 11:41

I am using the ST-LINK/V2 of my STM32F4 discovery. It only offer a SWD connector to program and debug... 

chen
Associate II
Posted on January 28, 2014 at 11:45

'' so i designed one based on the schematic of this chinese board''

Does the Chinese board schematic use all the JTAG/SWD pins by any chance?

jean2
Associate II
Posted on January 28, 2014 at 11:51

Yes there is the JTAG 20 pin port, so i just wired two of them to program my board. What would be the difference using the JTAG instead of SWD? 

thanks... :s

chen
Associate II
Posted on January 28, 2014 at 11:56

''Yes there is the JTAG 20 pin port, so i just wired two of them to program my board. What would be the difference using the JTAG instead of SWD? ''

You have not even provided the basic SWD pins let alone the full JTAG port.

JUST WIRE THE 5 PINS THAT ST SPECIFY and it will work!

jean2
Associate II
Posted on January 28, 2014 at 12:09

sorry, i am not sure i get it : 

I have a stm32f4 discovery with only the SWD (no jtag), it works well programming the chinese board with only SWCLK and SWDIO (+gnd and VCC of course)

I don't have other Pin on my programmer (no JTAG so no JTDI and JTDO)

On the board i designed, i added a pull up to JTDI and JTDO (like the chinese board)

chen
Associate II
Posted on January 28, 2014 at 12:34

Well, what does the chinese design do with the other 3 pins?

JTDI

JTDO/TRACESWO

NJTRST