PROBLEM SOLVED !!!
It was a constructor issue !
We cross posted !
I was using U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C ; found this information on the web....
I replaced with U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C ; also found on the web. But now, it works, and much faster than Adafruit.
Will hardware serial related library make any difference ? AFAIK, STM32duino (Roger's core), has software I²C only. The STM32Duino forum is down since the 1st week of august because of the load on the host server.
Try this :
/*
LcdOled
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <U8g2lib.h>
LiquidCrystal_I2C lcd(0x3F, 20, 4);
//U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C oled(U8G2_R0, A5, A4, U8X8_PIN_NONE);
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C oled(U8G2_R0, A5, A4, U8X8_PIN_NONE);
#define LCD
void setup(void)
{
oled.setI2CAddress(0x78);// 0x3C);
oled.begin();
oled.setFont(u8g2_font_ncenB10_tr);
oled.clear();
oled.setDrawColor(0xFF);
oled.drawStr(10, 30, "hello !");
oled.sendBuffer();
#ifdef LCD
lcd.init();
lcd.backlight();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("hello !");
#endif
delay(3000);
oled.clearDisplay();
}
void loop(void)
{
static int i = 0;
char buf1[16] = { 0 };
itoa(i, buf1, 16);
oled.clearDisplay();
oled.setCursor(0, 20);
oled.print(i);
oled.sendBuffer();
#ifdef LCD
lcd.clear();
lcd.setCursor(0, 1);
lcd.print(i);
#endif
i++;
}