cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting to STM32f0 with ST-Link Utility (SWD)

r23
Associate II
Posted on January 21, 2014 at 10:36

I'm having some troubles connecting an ST-Link to a STM32f0 microcontroller. Did is what i did/tried:

  • Soldering STM32f051 (LQFP48) to DIP adaptor
  • VBAT, VDDA, 2x VDD to +3,6V
  • VSSA, 2x VSS to GND
  • BOOT0 to GND
  • NRST with pullup to +3,6V (pin is not internally pulled low)
  • VDD, VSS, SWIO and SWCLK to 20 pin connector ST-Link

When i tried to connect with ST-Link Utility I get error ''Can not connect to target!''. I used the same ST-Link to connect to a STM32F051 Discovery Board (disabled on board st-link) and succesfully connected, so driver and connections seem ok.

Next thing i tried was resetting the MCU with BOOT0 pulled to +3,6V. I send 0x7F to USART1 with HyperTerminal and received 0x79 back. So the bootloader (and thus internal clock?) seem to be working.

Does anyone have any idea? Is a different approach required for first time programming?

Thanks for the help!

Ronald

6 REPLIES 6
r23
Associate II
Posted on January 21, 2014 at 14:19

I have had some success using a 100ohm resistor between SWDIO and GND. It's not a very stable solution though (only works in particular configuration with a lot of jumper wires). Anyone had such an issue before?

Posted on January 21, 2014 at 14:31

Well that certainly doesn't sound right?

You should probably consider connecting NRST to the 20-pin JTAG header.

BOOT0 should probably use a 10K connected to either GND or 3.6V to select mode. Though in a blank device you should be able to program/connect in either.

You can send hex characters in HyperTerminal? Try RealTerm 9600 8E1, the response to 0x7F should be 0x79, not 0x7F
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
r23
Associate II
Posted on January 21, 2014 at 17:01

It indeed doesn't sound right, but sometimes it does work strangely. I connected NRST to the 20 pin header and to +3.6V using 10k pullup. BOOT0 is pulled low with 10k pulldown. It makes no difference.

I did send the ASCI character corresponding to 0x7F and got a 0x79 response (sorry for the typo in my first post, corrected it now). So do the SWDIO and SWDCLK need any pulldown or -up connections other than the 100R is used?

I found another thread with the same issue. It is unsolved however: 

http://electronics.stackexchange.com/questions/74999/st-link-and-my-stm32f051-board-not-connecting-each-other

Posted on January 21, 2014 at 17:53

I have the biggest problem with the 100R, as this is likely masking other problems.

What version of firmware do you have on the ST-Link?

Please draw a schematic of your current connections.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
j_
Associate II
Posted on February 06, 2014 at 10:29

Hi,

I have the same problem connecting to a STM32F

I tried to use the Debugger on an STM32F0DISCOVERY-Board.

Therefore I disconnected the Jumpers on CN2 and the Soldering bridges on SB19 and SB

When I tried to connect to the Controller via STM32 ST-LINK Utility, it can't connect. I have tried holding BOOT0 HI or LO with no success. Leaving NRST open had although no effect.

Trying to erase the chip with CoIDE gave an ''Check Connection'' Error.

You find my basic schematic attached.

I hope anyone has an Idea!

EDIT: My Current-Consumption is about 2.5mA so I guess the Chip is operating

Thanks! Johannes

________________

Attachments :

STM32F051_Programming.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Jf&d=%2Fa%2F0X0000000blC%2FFqp.ixilwjPgakYtIShNuvrxijcOpvoGwfS4l5Tmmko&asPdf=false
Seb
ST Employee
Posted on December 18, 2016 at 12:01

First the device should not be protected [jtag disabled]. Second, the swd (swdio, sck) signal quality over wires should be good on oscilloscope and finally add decoupling capacitors to the dip adaptor. St link as i recall monitors vdd line to check if target mcu is present and powered. Good luck!