2024-02-05 05:03 AM - last edited on 2024-02-05 05:27 AM by SofLit
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!
Solved! Go to Solution.
2024-02-05 05:25 AM - edited 2024-02-05 05:26 AM
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.
2024-02-05 05:16 AM
@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?
2024-02-05 05:23 AM
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;
2024-02-05 05:25 AM - edited 2024-02-05 05:26 AM
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.