cancel
Showing results for 
Search instead for 
Did you mean: 

No SWD target connection with STM32F103 on custom PCB

akenvi
Associate II

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.

 

akenvi_3-1729247754968.png

akenvi_0-1729246953860.png

akenvi_1-1729247086851.png

akenvi_2-1729247556002.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Analogue power

Part Orientation 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

13 REPLIES 13
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

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:

https://community.st.com/t5/stm32-mcus/how-to-recognize-a-genuine-st-link-v2-versus-a-cloned-one/tac-p/703663/highlight/true#M965https://community.st.com/t5/stm32-mcus-products/debug-problem-with-clone-st-linkv2/m-p/661306/highlight/true#M240845

 


@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!

@Peter BENSCH 

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.

 

@Andrew Neil 

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.


@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!

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.

If you feel a post has answered your question, please click "Accept as Solution".
akenvi
Associate II

Hi, so this is what I get.

akenvi_0-1729329369428.png

akenvi_1-1729329424671.png

 

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?

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.

 

AScha3_0-1729331577880.png

AScha3_1-1729331729765.png

+

>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.

If you feel a post has answered your question, please click "Accept as Solution".

Analogue power

Part Orientation 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
liaifat85
Senior III

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.

https://www.richardelectronics.com/blog/categories/integrated%20circuit/what-are-the-popular-electronic-component-simulation-software