2026-06-03 3:20 AM
Hello, I've been trying to get an OLED screen to work on my H7S3L8, but I've not been successful. I've followed this tutorial perfectly (as much as I could - there were things I couldn't do such as setting fast mode duty cycle as the option isn't there in CubeMX).
So far I've tried:
- Using 4.7k resistors between VCC and SDA/SCK (also tried without them)
- Only sending the command to turn all pixels on the screen on (0xA5 from the datasheet)
- Following different tutorials with example code to no avail
- Making sure there are no shorts and that the voltage is correct with my multimeter
I haven't yet had success. Does anybody have experience with the H7S3L8 or have an idea why this would not be working? The tutorial I linked at the top explicitly mentions that the code works on H7 families.
I only used this part of the above tutorial to display 2 words:
SSD1306_Init (); // initialise the display
SSD1306_GotoXY (10,10); // goto 10, 10
SSD1306_Puts ("HELLO", &Font_11x18, 1); // print Hello
SSD1306_GotoXY (10, 30);
SSD1306_Puts ("WORLD !!", &Font_11x18, 1);
SSD1306_UpdateScreen(); // update screen
while (1) { }Side note - I know the screen works as it has been tested on an ESP32 using Espressif code.
Let me know if this is enough information, I'm happy to answer questions if it'll help!
Solved! Go to Solution.
2026-06-03 8:35 AM - edited 2026-06-03 9:40 AM
I had a SSD1306 oled ...found it and tried, on F103 board , blue Pill.
test with the instructions you used;
and set fast mode...is there:
OLED init : 30 ms
OLED start : 30 ms - write hello world
So example from controllerstech working fine, just some strange pixels on right border...
....aaa, found it : oled wants some time to init, then can program/use; put a waiting time at start !
/* USER CODE BEGIN 2 */
HAL_Delay(100); // wait for oled ready to work
SSD1306_Init (); // initialise the display
2026-06-03 3:47 AM - edited 2026-06-03 3:52 AM
Hi,
so you doing something wrong. :)
The cpu , H7.., not important here, just I2C setup in Cube, then include the lib, set defines...and go.
Are you on the selected pins ? really ? check with scope, signal coming here ?
+
You can compile - without any errors or warnings ??
2026-06-03 8:35 AM - edited 2026-06-03 9:40 AM
I had a SSD1306 oled ...found it and tried, on F103 board , blue Pill.
test with the instructions you used;
and set fast mode...is there:
OLED init : 30 ms
OLED start : 30 ms - write hello world
So example from controllerstech working fine, just some strange pixels on right border...
....aaa, found it : oled wants some time to init, then can program/use; put a waiting time at start !
/* USER CODE BEGIN 2 */
HAL_Delay(100); // wait for oled ready to work
SSD1306_Init (); // initialise the display
2026-06-04 3:40 AM
Thank you so much for taking the time to do this!
I found a different solution yesterday (increasing the timeout on the `HAL_I2C_Master_Transmit` function calls), though your solution is definitely more practical as it only introduces a delay at the start rather than letting every I2C transfer take longer to timeout.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.