- This topic has 1 reply, 2 voices, and was last updated 7 years, 2 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › problem with include files
I’m using Eclipse Neon and imported a STM32CubeMX project. I successfully used the hal library uart functions and now I want to make a new project.
This time I want to put my uart functions in a separate header and source file, “uart.h” and “uart.c”.
So far, in my “uart.h” file I have
but I get a redline under UART_HandleTypeDef that says “Type UART_HandleTypeDef could not be resolved”
I’m pretty sure I’m including the correct header file. Also, when I try to declare a UART_HandleTypeDef in my main.c file, I don’t get any errors. I don’t know how to solve the error I’m seeing in my uart.h file. Any help? Thanks.
As a rule of thumb, never include individual HAL header files. Instead, include the “stm32f0xx_hal.h” file and ensure that the corresponding module is enabled inside the “stm32f4xx_hal_conf.h” file.