OLED SSD1306 I2C e STM32F103C8T6

What are you developing?
Post Reply
Domenico
Posts: 16
Joined: Thu Jun 04, 2020 5:36 pm
Answers: 1

OLED SSD1306 I2C e STM32F103C8T6

Post by Domenico »

Hello.
I'm trying to run 2 0.96 "(128x64 px) OLED displays model SSD1306 with my STM32F103C8T6 card.
I use Windows 7, Arduino IDE 1.8.12, STM32 Cores 1.9.0 (from STMicroelectronics), 128x64 px I2C OLED display and AdaFruit Adafruit_SSD1306 library.
I state that I view the testimonials with Arduino UNO and Nano and verified.
To demonstrate the beginning of the Adafruit SSD1306 example for STM32 and the compiler of a series of errors.
I kindly ask if anyone could help me.
These are the writings that show me after the compilation:

Code: Select all

In file included from C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_MonoOLED.h:31:0,

                 from C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_MonoOLED.cpp:20:

C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:40:43: error: 'SPI_BITORDER_MSBFIRST' was not declared in this scope

                      BitOrder dataOrder = SPI_BITORDER_MSBFIRST,

                                           ^

C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:45:43: error: 'SPI_BITORDER_MSBFIRST' was not declared in this scope

                      BitOrder dataOrder = SPI_BITORDER_MSBFIRST,

                                           ^

C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_MonoOLED.cpp: In constructor 'Adafruit_MonoOLED::Adafruit_MonoOLED(uint16_t, uint16_t, int8_t, int8_t, int8_t, int8_t, int8_t)':

C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_MonoOLED.cpp:102:75: error: call to 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, int8_t, int8_t, int8_t, uint32_t, BitOrder, uint8_t)' uses the default argument for parameter 6, which is not yet defined

   spi_dev = new Adafruit_SPIDevice(cs_pin, sclk_pin, -1, mosi_pin, 1000000);

                                                                           ^

C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_MonoOLED.cpp: In constructor 'Adafruit_MonoOLED::Adafruit_MonoOLED(uint16_t, uint16_t, SPIClass*, int8_t, int8_t, int8_t, uint32_t)':

C:\Users\Perito Industriale\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_MonoOLED.cpp:135:53: error: 'SPI_BITORDER_MSBFIRST' was not declared in this scope

   spi_dev = new Adafruit_SPIDevice(cs_pin, bitrate, SPI_BITORDER_MSBFIRST,

                                                     ^

Più di una libreria trovata per "Wire.h"
Usata: C:\Users\Perito Industriale\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire
Non usata: C:\Users\Perito Industriale\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\WireSlave
exit status 1
Errore durante la compilazione per la scheda Generic STM32F103C series.
Attachments
Arduino IDE.jpg
Arduino IDE.jpg (73.58 KiB) Viewed 4604 times

User avatar
Bakisha
Posts: 70
Joined: Fri Dec 20, 2019 6:50 pm
Answers: 4
Contact:

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by Bakisha »

Try to downgrade Adafruit_GFX library from library manager.
I founded that last version that doesn't require Adafruit_BusIO library is 1.7.2
It will compile, but i can't say will it work.

Domenico
Posts: 16
Joined: Thu Jun 04, 2020 5:36 pm
Answers: 1

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by Domenico »

I downgraded the Adafruit_GFX library to version 1.7.2 and checked the sample code, it didn't give me any problems.
:)
Tomorrow morning I will load the code in the board and verify that it works.
Thank you for your suggestion.

stevestrong
Posts: 390
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany
Contact:

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by stevestrong »

You have chosen the board of the wrong core, according to the attached picture you selected a board from the Libmaple(Roger's) core.

Domenico
Posts: 16
Joined: Thu Jun 04, 2020 5:36 pm
Answers: 1

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by Domenico »

Domenico wrote:
Fri Jun 05, 2020 8:57 pm
I downgraded the Adafruit_GFX library to version 1.7.2 and checked the sample code, it didn't give me any problems.
:)
I uploaded the sketch to the MCU and it works perfectly !! : D Thanks!
The pins to which I connected the I2C are PB6 (SCL1) and PB7 (SDA1).
I have tried connecting to pins PB8 (SCL1) and PB9 (SDA1) and it doesn't work.
If I wanted to use I2C2 how could I do it? (is this part of another post?)

Domenico
Posts: 16
Joined: Thu Jun 04, 2020 5:36 pm
Answers: 1

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by Domenico »

stevestrong wrote:
Sat Jun 06, 2020 7:58 am
You have chosen the board of the wrong core, according to the attached picture you selected a board from the Libmaple(Roger's) core.
Which one should I choose?
"Generic STM32F1 series"?
Then use STM32CubeProgrammer to load the sketch?
What is the difference?
I'm not very knowledgeable about it.
Last edited by Domenico on Sat Jun 06, 2020 1:36 pm, edited 1 time in total.

stevestrong
Posts: 390
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany
Contact:

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by stevestrong »

I though you want to use STM32 Cores 1.9.0 (from STMicroelectronics), as you posted above.
For that, you have to select another board which is part of this core.
But then I don't know whether the Adafruit library will work.

User avatar
fpiSTM
Posts: 851
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 33
Location: Le Mans
Contact:

Re: OLED SSD1306 I2C e STM32F103C8T6

Post by fpiSTM »

Please read this:
viewtopic.php?f=2&t=301

Post Reply

Return to “Projects”