cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo board stuck when starting without USB connection

Jelurol
Associate II

Hello,

I am using a Nucleo F446RE board, and I have developped a small program that works fine as long as the board is connected to the PC with the USB cable.

Once the program has been tested, I have removed the USB cable and used E5V external power supply.

When I start the power supply, LD1 flashes red (waiting for USB), and nothing happens (stuck!).

If at that point I connect the USB it works ok.

Also, if I press the reset button, it also works ok.

Obviously, the system by default is waiting for a USB connection that will never come...

Is there a way to avoid that problem ?

Thanks for any help !

10 REPLIES 10
TDK
Guru

LD1 flashing red indicates the ST-Link chip doesn't have a USB connection. But your code isn't on that chip, so no issue there.

Since it "works ok" after pressing reset, your chip is certainly doing something, just not what you expect. Attach the debugger to an already running chip without reset to see where/why in the code it's stuck.

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

Thanks for your answer.

I have started a new test project from scratch that just makes the user LED blink to check the board is ok, and it does work fine even so the USB is not connected...

Then, I have added my new code bit by bit to find out which part causes the problem.

In fact, the problem arises when I configure the clock to use HSE (in "BYPASS Clock Source" mode) for "PLL Source Mux", instead of HSI.

As I did not cut off the ST-LINK, I thought it would be OK ?

It's a shame, because HSE is more precise...

KRoma.1
Associate

Hello @Jelurol​ ,

Your answer really helped me, because I had the same problem on my F429ZI. Could you or anyone tell me if it is possible to use HSE with E5V without resetting board? I don't really understand why it behaves like that - why reset help?

Jelurol
Associate II

Hello,

As I mentionned in my last comment, the problem is easy to reproduce for any expert to analyze (and solve) : just create an empty project and configure the clock to use HSE (in "BYPASS Clock Source" mode) for "PLL Source Mux", instead of HSI. Then the blocking occurs when using E5V without USB connection.

As I am not an expert in STM32, I took the coward way out, forget about the problem and use HSI... sorry.

However, if someone finds a solution, I will appreciate it as I would prefer to have the HSE precision...

Peter BENSCH
ST Employee

Many Nucleo boards, including the NUCLEO-F446RE mentioned here, do not have an HSE crystal. Instead, OSC_IN of the target is driven by the MCO of the ST-LINK.

This leads exactly to the behavior you observed: the HSE can only be operated in bypass mode without removing the jumper to the MCO and without soldering a crystal, the STM32F446 therefore gets its clock from the ST-LINK via the MCO.

As soon as the NUCLEO is not supplied via USB but an external voltage, the clock from the ST-LINK is therefore missing.

I have already mentioned the solution: remove the solder bridge to the MCO (at the NUCLEO-F446RE this is the SB50) and solder on crystal X3 including the passive components (R35, R37, C33, C34).

If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

Good luck!

/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.
harald
Associate III

Hy. I was facing the same issue with a F767ZI. Systems works perfectly when ST Link USB is plugged in and does not work only on external power supply. What did the trick for me was powering ST-Link part of the Nucleo from the 3V3 of the main board by connecting CN8 Pin 7 to JP1 Pin 1. Then ST-Link is powered even without USB and its HSE runs and can supply main board with clock. I use the "user USB" on the other end of the Nucleo board, so I needed high accuracy clock and could not live with other clock source.

Regards

Harald0693W00000FA9mnQAD.jpg0693W00000FA9miQAD.jpg

CButz.1
Associate III

Hi,

i just ran into this issue with a nucleo F429ZI, i needed HSE for USB too. @Peter BENSCH​ You are absoluty right about the HSE not being supplied from the ST Link, but the HSE is not missing, its just late (probably because the USB enumaration takes to long as no usb is connected). I measured between 1.5 to 2.5 seconds with different F429zi boards between powering the F4 and the HSE coming from the ST-Link. With that in mind a simple fix for this issue is to set the timeout for the HSE to three seconds. This can be done in the CubeMx under RCC->Parameter Settings->HSE Startup Timeout Value (ms) set to 3000. I verified that the HSE is present with the MCO2 of the F429zi set to HSE/1 and measuring the frequency, which was 8Mhz.

Regards

Christoph

Thanks, @CButz.1​, for the comment.

However, this only applies if the NUCLEO is connected to USB. However, the thread was about why the NUCLEO does not seem to work without USB.

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.

@Peter BENSCH​ Im aware of it and yes this applies to the nucleo being powered via E5V and the USB not connected. When I first found this thread, i thought why the LD4 of the ST Link happens to blink. That meant the ST Link is powered. See the schematics of the F429ZI. (MB1137)0693W00000JQ2LnQAL.png