How do the HAL based header files work?

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

Posts: 1
Joined: Thu Feb 14, 2019 8:40 pm

How do the HAL based header files work?

Postby keithnicholas » Thu Feb 14, 2019 8:53 pm

Is there a good reference somewhere on how the header file system works?

I'm trying to mix C and C++ and cross compile to visual studio for unit testing / simulation

I'm actually having a lot of trouble in TrueStudio trying to get it to compile both C and C++, it seems to get confused about its own header files. But I'm actually unsure how it's intended to be done.

There are these header files


I seems like stm32l4xx_hal_conf.h should be included in most C files as it #includes the right things based on modules select?
Should each C file #include the specific header files it wants?

If I #include that then I get compile errors like the following

In file included from ../Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:238:0,
from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_def.h:46,
from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rcc.h:45,
from ../Inc/stm32l4xx_hal_conf.h:222,
from ../Inc/adc.h:50,
from ..\Src\adc.c:41:
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:580:1: error: unknown type name 'HAL_StatusTypeDef'
HAL_StatusTypeDef HAL_Init(void);
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:581:1: error: unknown type name 'HAL_StatusTypeDef'

I'm really not sure how to resolve them or what is the correct way of doing things



Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest