2024-10-18 03:37 AM
Dear all,
I'm unable to connect via SWD to my STM32F103C8T6. What ever I try I get no target found with STM32CubeProgrammer or ST-LINK Utility (I have tried all combinations at slow and high speeds).
- device is virgin
- BOOT0 is low
- NRST unconnected (shows 3V3) and connected/removed while testing
- Connections go through from ST-Link to STM32 pins
- 30 Ohm and 0 Ohm tested for SWCLK and SWDIO (GND and 3V3 connection to ST-Link with no resistor)
- Correct mapping of ST-LINK pins to STM32 checked multiple times
- There are no obvious shorts between any of the paths
- 3V3 is stable and GND closed
- The ST-Link was tested with a "blue pill" board with the same STM32 on it and it worked flawlessly
I have also tried:
- Cutting the path to the esternal 16MHz crystal curcuit
- Connecting/Disconnecting VCC
- Soldered a new STM32 onto the board
I am currently running out of ideas, I think there is either a fault in the PCB design that damages the MCU or prevents booting or maybe some config that I have missed? I'm grateful for any ideas..
Some info on the board: It's a 2-Layer 1 mm board with a solid GND plane on the backside, I have attached sreenshots of the schematic and the routing. Please not that the LED on the BOOT0 path has been replaced with a 0 Ohm resistor to actually pull the pin low. Please let me know any further info required.
Solved! Go to Solution.
2024-10-19 04:55 AM
Analogue power
Part Orientation
2024-10-18 04:48 AM
Welcome @akenvi, to the community!
Why do you have an LED in the direction of BOOT0? If you set the switch to GND, the LED is in the blocking direction, which means that BOOT0 cannot recognise a clear low.
In addition, you should no longer use ST-LINK Utility, as it was replaced by STM32CubeProg a long time ago.
Blue Pill is by no means a reference, as it is not an ST product and fake MCUs have been used there for years. Is the ST-LINK one of these colourful tin cans?
Regards
/Peter
2024-10-18 05:01 AM
Have you tried with NRST connected to the ST-Link, and configured for 'Connect under reset' ?
As @Peter BENSCH said, do you have one of these clone ST-Links:
@akenvi wrote:- Correct mapping of ST-LINK pins to STM32 checked multiple times
As noted in the above link, Beware that the pinouts of the clones are not consistent!
2024-10-18 06:07 AM
Hi Peter, thank you for your answer!
I realized my mistake with the LED after I created it and changed the LED to a 0 Ohm resistor - I verified the BOOT0 is low. Thanks on the ST-LINK Utility info, I was not aware and that it would be the more in-depth program.
I am using one of those colourful tin cans - but I thought if it works on the blue pill without any problem it should also work on this one. (I checked the pins at which SWCLK and SWDIO connect and they are the same as on my MCU) I have however ordered a "real" one yesterday, also for enhanced features.
Hi Andrew, thank you too - I tried Connect under Reset, Hot Plug, Normal and Power Down to no avail. I did leave NRST open on most tries though - although some said that it might need to be toggled.
The clone is the upper one shown in the post you linked.
2024-10-18 06:19 AM
@akenvi wrote:I tried Connect under Reset, Hot Plug, Normal and Power Down to no avail. I did leave NRST open on most tries though
Connect under reset won't work unless NRST is connected to the ST-Link!
2024-10-18 07:08 AM
AND the st-link clones (the "stick" ) dont have NRST working for stm32 ! (its only for stm8 .)
(At least all the st-links i have. Dont connect nrst here.)
So only connect : mode: normal + reset mode : software reset -- will work.
And use stm32CubeProgrammer ! -> show, what its telling then.
2024-10-19 02:25 AM - edited 2024-10-19 02:30 AM
Hi, so this is what I get.
There is one peculiar thing: When I switched on the power with the previous MCU (before desoldering it) the LEDs D3 and D5 lit up very dimly, leading me to believe the chip was faulty, the new chip also did it shortly but stopped after I disconnected it from power immediately. (Not a good sign either) A test with an older, less complex PCB design (different purpose board) also showed LEDs glowing dimly after some seconds but here the SWD is indeed working. So I'm asking myself again if the my new chip is faulty and if the problem is with the board design. Is it normal for some regular unprogrammed GPIO pins to go high after boot? One problem I could see is that 3V3 connection to the ST-LINK is straight through without a resistor and when I unplug the PCB the ST-LINK will feed the 3V3 to the board - might that have damaged something?
PS: Is there any way for me to check if the MCU is defective or not? I usually read that its not easy with virgin devices, but maybe with an oscilloscope probe to specific pins?
2024-10-19 03:06 AM
Hi,
> Is it normal for some regular unprogrammed GPIO pins to go high after boot?
Yes. See pin functions at start/reset : you need sdw, jtag working, so these pins do something, pullup on, etc.
+
>Is there any way for me to check if the MCU is defective or not?
Not really ; see power consumption -> normal , as ds tells ? chip getting hot or pulls no power at all ?
ESD handling ...? solder station grounded/ESD protected ? --- just some indication , not more.
Then connects on swd ? (Thats my usual "test" : cpu seems good - or not. )
+
The F103 is very old, i had my first about 14 years ago; so its impossible , that you discover a "new" problem on this series.
If your swd/swc pins are connected to st-link (not puzzled! )and cpu has 3v3 : it will connect - if alive.
So if you sure, all vcc/vdda/gnd is connected and power consumption looks "normal" : it will connect.
Otherwise: find the hardware/connection error.
2024-10-19 04:55 AM
Analogue power
Part Orientation
2024-10-20 03:16 AM
SWD lines (SWCLK, SWDIO) should be routed properly with minimal length and no sharp turns or excessive vias. These lines should also avoid high-noise areas. A solid ground return path for the SWD lines is critical, so verify the integrity of the ground plane and the connections between ST-Link and STM32. You mentioned that NRST is unconnected. You can connect it directly to the ST-Link reset pin and attempt a reset before programming to ensure a clean reset signal. Before printing the PCB, it is always better to simulate the schematic. You can use simulation software for this task.