2024-07-09 03:20 AM
I have configured a STM32 project in the ioc interface to use SPI2 - I can see it having the green check mark in the ioc interface. However when I generate code I don't see any spi driver header, and when compiling I get a:
error: unknown type name 'SPI_HandleTypeDef'; did you mean 'TIM_HandleTypeDef'?
I am using the STM32CubeIDE version 1.16.0 on mac.
Solved! Go to Solution.
2024-07-10 02:37 AM
Thanks everyone for answering.
So a colleague ended up generating the code on his machine and pushing it in git so I inherited the files and didn't need to get them from the code generation anymore. However they were still not appearing in the project.
I found the "clean project" button, I did that and all the files appeared.
I suspect this was the solution since the beginning, however I can't reproduce what happened.
2024-07-09 03:36 AM
Hello @slai-nick and welcome to the ST Community :smiling_face_with_smiling_eyes:.
Can you share your .ioc file.
Best Regards.
STTwo-32
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.
2024-07-09 05:29 AM
Are you certain you generated your CubeMX project with SPI enabled ? normaly CubeMX should add in stm32X1xx_hal_conf.h file a #define HAL_SPI_MODULE_ENABLED. then when including stm32x1xx_hal.h it should include stm32x1_hal_spi.h and define SPI_HandleTypeDef.
2024-07-09 08:05 AM
Hello @slai-nick ,
This problem is not reproduced on Mac OS. So make sure that your code generation is correct and that you are using MacOS® 13 (Ventura) or MacOS® 14 (Sonoma) as this may affect some features in STM32CubeIDE.
2024-07-10 02:37 AM
Thanks everyone for answering.
So a colleague ended up generating the code on his machine and pushing it in git so I inherited the files and didn't need to get them from the code generation anymore. However they were still not appearing in the project.
I found the "clean project" button, I did that and all the files appeared.
I suspect this was the solution since the beginning, however I can't reproduce what happened.