I ported the custom LCD lib (Using u8g2) I was using for HK32/PY32 to STM32G0.
Works in my STM32G030.
Using LL, everything takes less than 8KB, including initialization, drawing routines, 9x15 font, test program...
1KB RAM is used for the local oled buffer (It's much better this way).
u8g2 is huge, so the files are too large to post here (10MB), uploaded to my
Google drive.
(Oops minor bug in the example, updating screen twice, so it reported half the speed. Ensure your file timestamp is 18:12 or download again).
As you'll see I do my own OLED initialization instead using some existing u8g2 profile, I prefer it like that to make it easier to modify, also u8g2 has a thousand profiles I don't feel like trying until finding the correct one.
I just copied the display test from the STM32 soldering FW and modified it slightly.
PB0 is a led, will blink slowly is ok, fast if the display was not detected.
The good about CubeMX is you can remap any pin easily, just choose any other pin and name it "LED".
Other pins are mostly explained in display.h.
It uses Fast Mode (400KHz), this gives about 35FPS, you can try setting it to Fast Mode Plus (1MHz) for about 80FPS.
Worked for me but will heavily depend on the display, wires/traces and pullup resistors (If not working, replace the default 10K with 2K2 or 1K).