How does the Setup works on F411 Blackpill

Post Reply
AlainBo26
Posts: 6
Joined: Sat Jul 15, 2023 5:10 pm

How does the Setup works on F411 Blackpill

Post by AlainBo26 »

Hello,
I do not understand what really happens in Setup() function on a WeAct Blackpill F411 V3.1.

When I write Serial.println("setup complete") at the end of my setup, I cannot see it if I don't do put a delay(1000); before.
Why do I have to put a so long delay()?

I also use a SSD1306 display, connected to I2C via PB6 and PB7 but connecting the SSD1306's SCL to PB6 prevents any Serial.Println() to work in Setup() (at least the 4.7K pullup because I still didn't connect the SSD1306). According to my oscillo, I2C seems to output something...

Serial.println() work in loop() any way.
What is the problem?

Alain
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How does the Setup works on F411 Blackpill

Post by fpiSTM »

If the Serial is linked to USB, USB have to be initialized.
You can add a while(!Serial);

https://www.arduino.cc/reference/en/lan ... /ifserial/
Post Reply

Return to “STM32F4 based boards”