2021-05-29 11:35 AM
I am new to STM32CubeIDE and I was trying to write a simple UART driver using polling method. I was successful when I wrote the function in the main.c and compiled the code.
So, I wanted to make an API of the same function and moved the function to separate .c files (in 01-uart/Core/Src/ i.e., where main.c is placed by default on code generation) and added the declaration in respective .h files (in 01-uart/Core/Inc/ i.e., where main.h is placed by default on code generation) just like in any other C project source code. But this threw 150+ errors on build and all related to HAL types. How do I fix it? It would be helpful if someone could give a pointer on how to do this. Attached below is my source code.
Solved! Go to Solution.
2021-05-31 07:06 AM
The only file you should include is "stm32f3xx_hal.h". Look at the generated main.h for an example.
2021-05-31 07:06 AM
The only file you should include is "stm32f3xx_hal.h". Look at the generated main.h for an example.
2021-05-31 11:07 PM
Thanks a lot @TDK . My include was clearly wrong. I had #included "stm32f3xx_hal_uart.h" instead.