Skip to main content
dreamcoder
Associate III
January 24, 2022
Question

Unable to flash STM32F401RET6 from ST-Link Utility or STM32CubeIDE

  • January 24, 2022
  • 8 replies
  • 6667 views

I have successfully tested a prototype with the Nucleo F401 board and I have now moved the design to a custom PCB but I cannot program the microcontroller. The microcontroller STM32F401RET6 is not detected in the ST-Link Utility tool or in the STM32CubeIDE. The 3.3V is supplied to the MCU correctly. There are no peripherals connected to the board at the moment.

0693W00000JN6CFQA1.png 

Did I miss any connection here?

I have tried these: connect VBAT to 3V3, changed C7, C8, C9, C10 to 100nF, changed C12 to 4.7uF for VCAP1.

The MCU is still not detected and I tried with my second board too. This rules out the MCU being broken.

This topic has been closed for replies.

8 replies

Peter BENSCH
Technical Moderator
January 24, 2022

Welcome, @Community member​, to the community!

At first glance, it looks essentially good.

Only C18 is a bit small with 4.3pF, you should better use 100nF there.

What debug hardware are you trying to connect to the target?

Are you sure you connected the cable or connector correctly?

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.
dreamcoder
Associate III
January 24, 2022

Thanks @Peter BENSCH​ , I am not really using the reset button but in any case, I have changed the C18 to 100nF on my board. I am using the STLink V3 to connect to the target. The cable and connector should be fine since I am using the similar connector on another board with STM32F405 controller and I can always talk to this controller. So the cable, connector and the debug tool are all good.

dreamcoder
Associate III
January 24, 2022

if this helps, the voltage readings on various pins are: Reset: 3.3V, Boot0: 0V, Vcap1: 1.13V

Peter BENSCH
Technical Moderator
January 24, 2022

Voltages are ok.

I can't find any noticeable error in the circuit. Do you happen to have other prototypes with the same structure that you can use to verify this?

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.
dreamcoder
Associate III
January 24, 2022

Yes, I tried this on the second board that I made and I cannot detect the microcontroller in this one either.

dreamcoder
Associate III
January 24, 2022

Are there any other things I could check?

Peter BENSCH
Technical Moderator
January 24, 2022

Well, if the layout might not be correct, the second board will behave the same way.

Are you sure the STM32F401 are genuine and not fakes?

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.
dreamcoder
Associate III
January 25, 2022

Yes, they are genuine since I am using the microcontrollers from the Nucleo F401 board. The layout for my design looks fine too. It is very similar to the F405 board that I created. The only difference I can see is that I am not using SWO pin on my F405. Do you think there is any effect by using this pin in my F401 board?

Peter BENSCH
Technical Moderator
January 25, 2022

No, SWO is optional.

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.
TDK
Super User
January 24, 2022

VBAT needs to be connected to VDD.

"If you feel a post has answered your question, please click ""Accept as Solution""."
dreamcoder
Associate III
January 25, 2022

Connecting VBAT to VDD did not change anything. I still cannot program the STM.

Peter BENSCH
Technical Moderator
January 25, 2022

VIN is probably 5V?

Cap C12 is a ceramic one (MLCC)?

Can you see the SWCLK and SWDIO signals with an oscilloscope on pins PA13/14?

Can you see a low pulse with an oscilloscope on the NRST when you try it with the STM32CubeProgrammer and Connect under Reset?

BTW: the ST-Link Utility is not recommended anymore, it is recommended to use the STM32CubeProgrammer instead.

Mmm, after that it gets tedious: you could transplant the STM32 to a NUCLEO and check if it works there - in this case the problem is definitely with your proto board.

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.
dreamcoder
Associate III
January 26, 2022

Yes, VIN is 5V. C12 is MLCC. Should this be an electrolytic capacitor?

I can see a certain signal on SWDIO line but not on SWCLK.

I can see a low pulse on NRST when I hit connect on the STM32CubeProgrammer.

Peter BENSCH
Technical Moderator
January 26, 2022

MLCC at C12 is fine.

However, it is not a good sign if there is no signal on SWCLK. If you look at a known good board, you will see clock pulses there. Please trace this line to your debugger to make sure there is no contact problem.

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.
TDK
Super User
January 25, 2022

I don't see 0.1uF decoupling caps on VDD. Doubt that's it though. I would guess a bad solder joint somewhere in a critical path.

VCAP should be 4.7uF since there is only one VCAP pin. Doubt that's it as well.

"If you feel a post has answered your question, please click ""Accept as Solution""."
dreamcoder
Associate III
January 25, 2022

I changed them both to the correct values, still nothing.