STM32 blue plill / Adafruit_SSD1306 library problem

Hi Im learning to work with "blue pill" (STM32F103C8T6) on PlatformIO and have a problem. Its a simple test sketch for showing Adafruit logo on the 128x64 I2C oled and it compiles, uploads ok but showing only noise on the display.
The same code, library and hardware works great when uploaded over Arduino IDE (STM32duino).

[env:bluepill_f103c8_128k]
platform = ststm32
board = bluepill_f103c8_128k
framework = arduino
build_flags = -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC -Os
lib_deps = adafruit/Adafruit SSD1306@^2.5.6
upload_protocol = stlink

This is my .ini file, it must be something with the different cores? I`m still not clear with the that concept…

Which version of the STM32Duino core you using in the Arduino IDE? (See Tools → Boards → board manager)

I`m using this :

If you’re using the mapple core, tell PlatformIO so.

board_build.core = maple

I already tried that, it won`t compile, showing errors with Adafruit libraries…

What version of the Adafruit SSD1306 does the Arduino library manager say you have installed?

2.5.6 same as in PlatformIO.

Can you install Arduino_Core_STM32 (from STMicroelectronics) via GitHub - stm32duino/Arduino_Core_STM32: STM32 core support for Arduino and test whether the sketch still works in the Arduino IDE when using the F103C8 board from this core?

Ok, I`ll try that and inform you later, thanks.
So,this is the official core and I installed the “Maple”?

I tried what you proposed and now it behaves the same in Arduino IDE, NOT working.
It compiles, uploads and noise on the display…so, what is the conclusion?

The SSD1306 library should definitely work with the regular STM32 core. What’s the exact code?

Also, when you compile with the maple core and have File → Preferences → Verbose Compilation / Build turned on and build again, what does that build output say about the used SSD1306 library version?

And,


I already answered about library versions, its not the code you could use library example... Now , Arduino IDE its not working either, and it was about PlatformIO issue in the begining, is there a point on this investigation?
What should I do with Arduino IDE now, go back to previous core?

#include <Arduino.h>
#include <Adafruit_SSD1306.h>

#define DISPLAY_ADDRESS 0x3C

Adafruit_SSD1306 display(128, 64);

void setup()
{
  Serial.begin(9600);
  delay(1000);

  if (!display.begin(SSD1306_SWITCHCAPVCC, DISPLAY_ADDRESS))
  {
    Serial.println("SSD1306 allocation failed");
    for (;;)
      ;
  }

  display.display();
}

void loop()
{
}

So this is what I discovered, for some reason, Adafruit_SSD1306 library works well only when I use this core in Arduino IDE: “http://dan.drown.org/stm32duino/package_STM32duino_index.json
What could be done to make it work in PlatformIO ?