cancel
Showing results for 
Search instead for 
Did you mean: 

Another ST Link Can not connect to target error.

yoma1993
Associate II
Posted on May 21, 2015 at 03:46

Hello,

I bought a ST link v2 and stm32f103 dev board from ebay (

http://www.ebay.com/itm/331348706014?_trksid=p2060353.m2749.l2649&ssPageName=STRK:MEBIDX:IT

) plugged up the st link to the header on the board as such.

  • st link pin 19 -> 3.3v
  • st link pin 20 -> ground
  • st link pin  7  -> DIO
  • st link pin  9  -> clk

Downloaded ST link utility, upgraded the firmware on the ST link, and tried to connect to the MCU. I get the following error in the st link utility.

20:01:54 : Can not connect to target!

                  Please select ''Connect Under Reset'' mode from Target->Settings menu and try again.

                  If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.

20:01:55 : No target connected

I've try every setting on the st link utility settings, including the instructions in the error, with no luck. I've also tried different boot pin configurations.

http://i.imgur.com/KA14Hj9.png

, but it was able to update the firmware so i think the drivers are okay. ''SM Bus Controller'' is there even when the ST Link is not connected. I've also tried multiple computers and multiple versions of Windows with the same issue. It seems there is something wrong with the MCU it self, but i have no idea to test it. Also just FYI i can upload .hex files to the MCU just fine over UART1. I currently have a blink LED program running which uses pin PC13.

7 REPLIES 7
Posted on May 21, 2015 at 11:35

The reset setting probably won't help if you're not connecting the NRESET pin.

Try accessing the device after you reset it with BOOT0 pin pulled high.

The Pin 19 thing doesn't make a lot of sense. Are you trying to power the device this way? And what voltage comes out of Pin 19?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
stm32forum
Associate II
Posted on May 21, 2015 at 16:09

Do you power the F103 board trough usb when you try to program it?

Did you set in StLinkUtility -> settings to swd ?

yoma1993
Associate II
Posted on May 21, 2015 at 20:40

Hi,

Yes I was trying to power the device with the stlink. I was following

http://startingelectronics.org/tutorials/STM32-microcontrollers/ST-link-v2-SWD-windows-programming/

 example and just assumed the st link would power the board. When I connected the board it wasn't turning on so i looked in the ST link user manual and saw 3.3v was on pin 19. I just measured pin 19 and it was 3.3v. I also tried to power the device other ways, with no luck. However by switching from pin 19 to pin 1 like the example says, powering the device via USB (thank you Edje for the tip), and setting BOOT0 high I am getting a response as you can see

http://i.imgur.com/vmydIQH.png

.

Is there a way to power the F103 MCU so i wont need a USB cable, and do i have to change the BOOT0 pin everytime i want to reflash the MCU?

Posted on May 21, 2015 at 21:07

The BOOT0 trick allows you to over come problems caused by your own code on the device. ie Low power modes, disabling the SWD/JTAG pins, etc.

JLINK's push 5V out of  pin 19, I've used that previously to power boards.

You'll have to examine the design of your board, didn't see any schematic or design documents on the eBay page.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
yoma1993
Associate II
Posted on May 21, 2015 at 22:39

Just to be clear it is possible to have both BOOT0 and BOOT1 low, flash the MCU, and have the code start running automatically. Or maybe just with the push of the reset button. This is how the st link is supposed to function right?

Posted on May 21, 2015 at 22:59

Right, and in most circumstances you'll be able to access/flash the device, provided you've connected NRST, and the ST-LINK can wrestle control of the part.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
yoma1993
Associate II
Posted on May 22, 2015 at 00:11

Awesome! I just got it to work! For future reference heres how I connected everything.

  • st link pin  1  -> 3.3v on header

  • st link pin  7  -> DIO on header

  • st link pin  9  -> clk on header

  • st link pin 15 -> jumper wire to reset on board

Thanks for your help guys!