2024-11-05 07:37 AM - edited 2024-11-05 07:42 AM
Hello.
I am working on the LSM110A communications module project https://github.com/Support-SJI/LSM110A and I want to enable the necessary peripherals to be able to communicate the module with a MEMS using the SPI standard.
The first thing I developed was the creation of a project, in STM32CubeIDE, in which I configured the SPI communication to the STM32WLE5CCU6 module. I created the code and used the source files (.c), which are included there, within the LSM110A project.
Inside the “Drivers/STM32WLxx_HAL_Driver” folder of the LSM110A project, I created a file with the “link to file in file system” configuration and linked the source file “stm32wlxx_hal_spi.c”. Likewise, I performed the above procedure but with the “spi.c” file that is hosted in the “Application/User/Core” location; I also made sure that, in the folder containing the header files (.h), the “stm32wlxx_hal_spi.h” and “spi.h” files were included.
My problem is that, when I made the linking of the “spi.c” file to the LSM110A project, I get the following errors:
I have checked with the project I created to enable the peripherals for SPI communication and it does not show any error. The only thing I have been able to detail is that, when I include the header file “stm32wlxx_hal_spi.h” in the “spi.c” file, most of the errors disappear, but the following ones appear:
Explicitly, it is this error that I cannot understand: conflicting types for "conflicting types for 'hspi1'; have 'SPI_HandleTypeDef' {aka 'struct __SPI_HandleTypeDef'}".
Thank you very much in advance for your attention and your cooperation to help me to solve this problem.
Solved! Go to Solution.
2024-11-05 12:32 PM
The first error about SPI_HandleTypeDef is "unknown type name 'SPI_HandleTypeDef' " - somehow stm32wlxx_hal_spi.h file content is not included in your compilation. Resolve this first.
2024-11-05 11:28 AM
It's better to copy & paste the build output from the 'Console' window as text - your screenshot image has cut off important information...
2024-11-05 12:32 PM
The first error about SPI_HandleTypeDef is "unknown type name 'SPI_HandleTypeDef' " - somehow stm32wlxx_hal_spi.h file content is not included in your compilation. Resolve this first.
2024-11-05 01:06 PM
@Pavel A. wrote:Resolve this first.
Indeed.
@DesignOmicron it's important to resolve the earliest-reported error first - as that is likely the source of many subsequent errors.
The 'Problems' view is particularly unhelpful here, as it does not present the errors in order.
Hence the 'Console' is the more useful view.
You can do a Select-all in the 'Console' window, copy, and then paste here as text - not a screenshot.
2024-11-06 12:06 PM
Thank you very much for your interest and collaboration. I managed to solve my problem and it was very simple. I only needed to enable the definition that enables the SPI module in the stm32wlxx_hal_conf.h header file.
2024-11-06 03:23 PM
@DesignOmicron wrote:I managed to solve my problem and it was very simple..
Indeed - as already noted, it is often the case that one simple fix will also fix loads of other resulting errors.
Please mark the solution:
https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256