Page 1 of 1

How does the Setup works on F411 Blackpill

Posted: Sun Jul 23, 2023 10:51 am
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

Re: How does the Setup works on F411 Blackpill

Posted: Mon Aug 28, 2023 8:57 am
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/