cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411-VET6 with SSD1322 compilation errors

Andy11430
Associate

Hello Guys,

 i want to use the Display SSD 1322 OLED with the STM32F411-VET6 Development Board but i cant use the example on github: https://github.com/wjklimek1/SSD1322_OLED_library it comes with many errors when i use the library for the STM32F411. Following error displays on CubeIDE "error: 'hspi5' undeclared (first use in this function)".

i have attached my project file for testing.

 

many thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello,

First, you need to add a declaration of hspi5 in SSD1322_HW_Driver.c:  extern SPI_HandleTypeDef hspi5;

Second, I don't know why you have two initialization functions for the same peripherals in spi.c and uart.c (Ex: HAL_SPI_MspInit() declared twice).

These functions were already generated in main.c by CubeMx!

Attached your project on which I fixed the compilation error. You need to check again your peripherals configurations.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3

@Andy11430 wrote:

CubeIDE "error: 'hspi5' undeclared (first use in this function)".


So you haven't defined the handle for your SPI interface?

Or, if you have defined one, you've given it a different name?

TDK
Guru

Declare the variable before you use it. You don't say which file has this error, but put this declaration before its use.

extern SPI_HandleTypeDef hspi5;

 

If you feel a post has answered your question, please click "Accept as Solution".
SofLit
ST Employee

Hello,

First, you need to add a declaration of hspi5 in SSD1322_HW_Driver.c:  extern SPI_HandleTypeDef hspi5;

Second, I don't know why you have two initialization functions for the same peripherals in spi.c and uart.c (Ex: HAL_SPI_MspInit() declared twice).

These functions were already generated in main.c by CubeMx!

Attached your project on which I fixed the compilation error. You need to check again your peripherals configurations.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.