AnsweredAssumed Answered

Compiler errors: unknown type name 'HAL_LockTypeDef' and 'HAL_StatusTypeDef' using CubeMX and Atollic TrueSTUDIO 7.1

Question asked by MohawkSpock on Aug 11, 2017
Latest reply on Sep 27, 2017 by Mike Hooper

I'm attempting to compile a STM32F303RE project using the Cube MX generated HAL drivers for Atollic TrueStudio 7.1.  I'm getting 39 errors on stm32f3xx_hal_dma.h, stm32f3xx_hal_uart.h, and stm32f3xx_hal_uart_ex.h wherever a HAL_StatusTypeDef or HAL_LockTypeDef type is referenced.    Each header file that has these errors has a #include "stm32f3xx_hal_def.h" where the type is defined at the top of the file.

 

This seems to be related to using the HAL drivers in source files other than main.c.  I've created a bare bones blinky project using CubeMX and I initially had the same errors, until I included stm32f3xx_hal.h in the external source file that I created that calls the HAL driver functions.  Unfortunately this solution didn't work with my more complicated project.

 

If the header file defining the type is right there, why in the world would the compiler not see it?  I feel like I'm missing something really basic, but I can't figure this out.  Any help would be greatly appreciated!

Outcomes