Oled ssd1306 stm32f103c8

I have an issue trying to use the SSD1306 128x64 OLED on a Bluepill or STM32F103C8 development board. When I compile and upload the sketch, it works as advertised. However, when I power down the development board and switch boot0 back to normal mode and power the development board back up, the SSD1306 does not display anything. It does not even flicker during setup() or loop().

This occurs both with my own sketch and a clean copy of the Adafruit_SSD1306 ssd1306_128x64_i2c_STM32 sketch. I have never run into this issue before with any other sketch or peripheral device. All wiring connections are solid and the issue is not intermittent. It is a consistent failure, both sketches compile without error and upload/run successfully. But the OLED does not work when the Bluepill is taken out of programming mode.

The sketches do run as verified by the serial monitor output but the OLED display only works on upload in programming mode. I have tried two different Bluepill modules and two different SSD1306 OLEDs. Any help would be appreciated.

Arduino IDE: 2.3.3
Adafruit_GFX 1.11.11
Adafruit_SSD1306 2.5.13

How are you powering the SSD1306?
What are the power requirements for the SSD1306 versus the supplied power?

Did you forget the information to read in How to get the best out of this forum?

If you provide complete information, then you can be helped more quickly.

  • link to the display, so we can see its connections
  • your wiring, pin-to-pin

how do you handle reset / RST of your display?
Maybe a short delay() in setup() would help.

I am powering the SSD1306 from a 3.3VDC 700ma supply which also powers the STM32F103C8. The SSD1306 is a I2C version which draws a maximum of 80ma. I am not sure why this would matter since once the sketch is uploaded and begins execution it should be drawing the same power that it would draw running the sketch in normal (non upload/boot) mode.

What are the power requirements for your SSD1306?

As stated above the SSD1306 draws a maximum of 80ma and is run on 3.3 VDC. The unit I am using is capable of running on 3.3 or 5 VDC.

Glad to hear it works now.

What do you mean it works. The display still only works when the MCU is in programming mode. When I power the system down and change the boot0 jumper to normal mode and power it back up, the display does not work. I merely stated that the sketch is running as evidenced by the serial monitor output but the SSD1306 no longer display anything.

Since I did not get an answer on this forum, I submitted the issue on the Adafruit forums it was resolved there. The issue is that the SSD1306 OLED display requires a certain amount of time to initialize and the resolution was to place a delay(100) before the display.begin() call. For a more complete explanation see Adafruit forum entry "https://forums.adafruit.com/viewtopic.php?t=215548".

You might use a similar solution on serial comm devices... some years ago the advice was to wait one second. I have not experienced that (even on SSD1306). Maybe the OLED in question lacks pullup resistors to avoid a floating or slow-to-transition signal?

An Adafruit forum had the solution for an Adafruit problem in an Adafruit library? Straight-up Muenchhausen by Proxy, page 1.

Try reading the Adafruit forum entry referenced in my last update. That entry will explain everything related to this issue in accurate detail.

No.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.