STLink doesn't connect to STM32F101 - Page 1
Forum section: electronics / general

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 17, 2018, 03:41:28 pm
content: I bought an STM32F101VBT6, soldered it on a TQFP100 - DIP converter PCB, checked soldering, connected all 5 power sources yet my STLink doesn't detect my STM32. I checked everything I possibly couldAny guesses on what I'm doing wrong?

author: mbless
author_rank: Regular Contributor
timestamp: January 17, 2018, 04:42:20 pm
content: Yay, another question without any detailsHow did you connect the STLink to the mcu? What STLink do you have? What config file did you use? What software are you using?

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 17, 2018, 04:45:42 pm
content: STLink v2 clone; connected via SWD using the stlink util

author: Rolo
author_rank: Regular Contributor
timestamp: January 17, 2018, 04:59:48 pm
content: Quote from: Ushiwaka on January 17, 2018, 04:45:42 pmAre you using the st-link programmer software? This has an option "connect under reset" somewhere. Try setting this option, while pressing reset click on "connect", release reset button. Helped me before.

author: Kjelt
author_rank: Super Contributor
timestamp: January 17, 2018, 05:56:13 pm
content: Quote from: Ushiwaka on January 17, 2018, 04:45:42 pmA clone? These things are €18 brand new original?Sorry but a Keil Ulink I can understand, but an STlink ? How cheap should a manufacturer make this stuff before there will no longer be clones.

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2018, 06:01:21 pm
content: You should also show us how did you wire the MCU up. That also tells a lot.Note: Connect under reset shall not be required to connect to a brand new MCU.

author: andyturk
author_rank: Frequent Contributor
timestamp: January 17, 2018, 06:09:03 pm
content: Quote from: Ushiwaka on January 17, 2018, 03:41:28 pmWell, one mistake is beginning your STM32 journey with a bare chip and a clone programmer.You'd be much better off buying something like a USD $12.50STM32L152 Discoveryboard.That provides you with working hardware and an official ST-Link programmer that's built-in.

author: mbless
author_rank: Regular Contributor
timestamp: January 18, 2018, 03:01:14 am
content: Quote from: Kjelt on January 17, 2018, 05:56:13 pmI have some ST-Link v2-1 from Nucleos, but I bought one of those $4 ST-Link v2 clones from eBay to see if they work, and well they do. I can debug with them no problem, so take that for what you want.Back to the topic at hand. I just tested my ST-Link v2 clone in STM32CubeProgammer on a Mac, and I can connect to an MCU. I also tested the setup in ST-Link Utility on Windows 10, and that also worked. So the hardware can work if you know what you're doing. The OP needs to give more details.The first thing would be to see if ST-Link Utility recognizes the ST-Link. On the menu bar select "ST-LINK" and then "Firmware update." Is the ST-Link listed there?

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 18, 2018, 07:18:08 am
content: I'm not new to STM32 devices lol; in fact, I have 2 STM32F407 discoveries, a STM32F769 discovery and a L011K4 nucleoI've been using this STLink for 3 years, tested it with other boards and it seems to work just fine

author: Kjelt
author_rank: Super Contributor
timestamp: January 18, 2018, 08:09:03 am
content: Quote from: mbless on January 18, 2018, 03:01:14 amI am not doubting they work, it just amazes me that someone buys a $5 clone instead of an $18 original.An Ulink that costs $200 I could understand but this is just sad.You are from the US always complaining about how the economy is going down well here is your answer, people , like you, rather buy a cheaper stolen IP cloned products than an original. Due to the loss of income these companies can not afford to develop new IP and go belly up. Long live China and the clone wars.

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 18, 2018, 09:21:35 am
content: I do have an original STLink v1 but my friend borrowed it so I have no choice but to use the clone which I found lying around in my office (could've used the discovery's builtin STLink but it's a bit inconvinient)

author: llkiwi2006
author_rank: Regular Contributor
timestamp: January 18, 2018, 10:13:38 am
content: Does whatever program that is already on the chip disable SWD/JTAG? Boot the chip into bootloader and try connect.

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 18, 2018, 11:00:28 am
content: Quote from: llkiwi2006 on January 18, 2018, 10:13:38 amIt's a fresh one

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 18, 2018, 11:26:38 am
content: So I decided to use openocd w/ an arm-usb-tinypretty much what I got

author: mbless
author_rank: Regular Contributor
timestamp: January 18, 2018, 01:26:10 pm
content: Quote from: Kjelt on January 18, 2018, 08:09:03 amTake your xenophobic generalizations somewhere else. This is not the place for political statements.

author: mbless
author_rank: Regular Contributor
timestamp: January 18, 2018, 01:33:29 pm
content: Quote from: Ushiwaka on January 18, 2018, 11:26:38 amSo it's trying to connect via JTAG? Earlier you said you were using SWD.(I have no experience with JTAG so I can't help you there.)

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 18, 2018, 02:27:36 pm
content: Quote from: mbless on January 18, 2018, 01:33:29 pmI did try w/ SWD earlier w/ stlink util, no luck; decided to use jtag

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 18, 2018, 02:32:18 pm
content: *sigh*Okay so I decided to go out and buy another STM32F101 and a LQFP100 -> DIP PCBstill the same resultsso now at least I know the chip isn't dead and I have 2 (currently) useless uCs

author: ealex
author_rank: Frequent Contributor
timestamp: January 18, 2018, 03:19:08 pm
content: can you make a rough schematic on how you wired the mcu on the adapter ?in the first post you wrote something about "connected all 5 power sources" - what does that mean ?i'm used to making quick prototypes with your setup.i got some of the same issues with the kind of clone debugger you are using so now i'm just using a STM32F051 dev board with a desoldered mcu ( read the dev. board manual as they explain how to use it as a SWD interface )try to keep the wires between the CPU and SWD interface as short as possible=> first post a photo / schematic to see what's connected where and how - psu decoupling, reset pin, etc.also, post the output of openocd in swd mode

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 18, 2018, 04:14:30 pm
content: Quote from: Rolo on January 17, 2018, 04:59:48 pmGood catch. It could be a problem such as this. But for this option to work, you have to connect the reset pin to the matching pin of the jtag adapter (NRST?)If you can't do that, one trick to try is to hold the µC in reset manually just before attempting to connect to it and then release the reset.The issue there if it solves the connection problem would most likely be that the µC internal clock is stopped. When it is, you can't connect JTAG or SWD. This is an issue if your µC for instance is in stop mode while you're attempting to connect to it.In the same vein, does the STM32F101 has an internal oscillator that it can start from? I have never used the STM32F1 family (only STM32L4 and F4, that do have an internal oscillator). If suppose it does, but if not, you may need to wire an external crystal or such.All in all, if you're sure about power supply and SWD connections, it may be this kind of oscillator problem - something to check. SWD will not work without the µC clock running.You could also try to lower the SWD frequency in the settings.

author: andyturk
author_rank: Frequent Contributor
timestamp: January 18, 2018, 05:45:48 pm
content: Quote from: Ushiwaka on January 18, 2018, 02:32:18 pmAre you powering VDDA in addition to all the VDD pins? Is there decoupling somewhere?Sounds like either a power or wiring problem.

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 19, 2018, 02:05:50 am
content: Quote from: andyturk on January 18, 2018, 05:45:48 pmafaik VDDa and VSSa are 'optional'Also I don't think an external osc. is required

author: andyturk
author_rank: Frequent Contributor
timestamp: January 19, 2018, 03:08:57 am
content: Quote from: Ushiwaka on January 19, 2018, 02:05:50 amThe datasheet does say, "VDDA and VSSA must be connected ..."

author: Kjelt
author_rank: Super Contributor
timestamp: January 19, 2018, 07:58:31 am
content: I should connect all voltages and small decoupling cap.Measure if the internal osc is functioning at the MCO pin,And not sure about bootpins but check anyway, these should be configured for boot from user flash.

author: ealex
author_rank: Frequent Contributor
timestamp: January 19, 2018, 09:56:06 am
content: VDDA and VSSA are not optional.on page 12 of the data sheet:http://www.st.com/content/ccc/resource/technical/document/datasheet/6b/28/4e/ce/a7/d3/42/8d/CD00161561.pdf/files/CD00161561.pdf/jcr:content/translations/en.CD00161561.pdfNRST is in the VDDA domain -> VDDA domain needs to be powered as wellalso, on page 16 under "2.3.9 Power supply schemes":VDDA and VSSA must be connected to VDD and VSS, respectively.The internal oscillator is enough to get SWD running and it's enabled by default.Connect the 2 boot pins to a valid state - even if that's the internal bootloader.Check that NRST is pulled high with 10K or something like that - the SWD clones can't handle low value reset resistors.You really need some capacitors on all VDD pins - 100nF is enough to get it going.Check the power supply voltage - it must be 3.3V and stable.Check the current draw - you should see ~1mA or less when you pull NRST low and then it will go to 10mA or more once the chip tries to boot.Add a clear photo with you setup, maybe someone can see something obvious.If you don't send any of the data we requested above this will be a guessing game ...

author: llkiwi2006
author_rank: Regular Contributor
timestamp: January 19, 2018, 10:38:25 am
content: Who designed the board? Can you post a schematics of at least the microcontroller part?

author: Backlash
author_rank: Newbie
timestamp: January 21, 2018, 10:31:33 am
content: Tie BOOT0 to GND using a pulldown resister and try again!

author: Ushiwaka
author_rank: Regular Contributor
timestamp: January 22, 2018, 05:10:26 am
content: Quote from: llkiwi2006 on January 19, 2018, 10:38:25 amI'm using a breakout board lolI connected VSSa and VDDa and now it's working properly. Thanks ealex for pointing out!man i really need to read dses more carefully

author: llkiwi2006
author_rank: Regular Contributor
timestamp: January 22, 2018, 05:24:41 am
content: Quote from: Ushiwaka on January 22, 2018, 05:10:26 amI'm glad it's working for you now. Btw, quite an interesting breakout board you've got there, usually they just tie VDDa and VSSa to VDD and VSS (respectively), since most people feed microcontrollers on a single supply.