2015-05-20 06:46 PM
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.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 connectedI'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., 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.2015-05-21 02:35 AM
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?2015-05-21 07:09 AM
Do you power the F103 board trough usb when you try to program it?
Did you set in StLinkUtility -> settings to swd ?2015-05-21 11:40 AM
Hi,
Yes I was trying to power the device with the stlink. I was followinghttp://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 .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?2015-05-21 12:07 PM
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.2015-05-21 01:39 PM
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?
2015-05-21 01:59 PM
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.
2015-05-21 03:11 PM
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!