Associate II
May 29, 2021
Solved
How to add APIs
- May 29, 2021
- 2 replies
- 1506 views
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.
