AnsweredAssumed Answered

Problems with CubeMX and MDK-ARM

Question asked by Riccardo Mereu on Jun 15, 2017
Latest reply on Jun 16, 2017 by Frederic REMY

Hi, 

I'm trying to develop my own libraries to use a lux sensor MAX44009 with an STM32L476RG-Nucleo. I've modified the example I2C_TwoBoards_ComPolling and using its configuration I was able to set up and read the values even using interrupt of the sensor. Now I would use no more the I2C3 but I want to change on the I2C1. I try to generate the code through CubeMX. But I have some problems, first of all CubeMX doesn't generates/includes the library stm32l4xx_nucleo.h and trying to include stm32l4xx_hal_conf.h (generated by CubeMX) I have this error compiling with the MDK-ARM v5:

 

../Inc/MAX44009.h(37): error: #20: identifier "HAL_StatusTypeDef" is undefined
HAL_StatusTypeDef getLux(I2C_HandleTypeDef I2cHandle, float *luxVal);
../Inc/MAX44009.h(37): error: #20: identifier "I2C_HandleTypeDef" is undefined
HAL_StatusTypeDef getLux(I2C_HandleTypeDef I2cHandle, float *luxVal);
../Inc/MAX44009.h(38): error: #20: identifier "HAL_StatusTypeDef" is undefined
HAL_StatusTypeDef getInterruptStatus(I2C_HandleTypeDef I2cHandle, uint8_t *IT_Status);
../Inc/MAX44009.h(38): error: #20: identifier "I2C_HandleTypeDef" is undefined
HAL_StatusTypeDef getInterruptStatus(I2C_HandleTypeDef I2cHandle, uint8_t *IT_Status);
../Inc/MAX44009.h(38): error: #20: identifier "uint8_t" is undefined
HAL_StatusTypeDef getInterruptStatus(I2C_HandleTypeDef I2cHandle, uint8_t *IT_Status);
../Inc/MAX44009.h(39): error: #20: identifier "HAL_StatusTypeDef" is undefined
HAL_StatusTypeDef setInterruptStatus(I2C_HandleTypeDef I2cHandle, uint8_t *IT_Status);
../Inc/MAX44009.h(39): error: #20: identifier "I2C_HandleTypeDef" is undefined
HAL_StatusTypeDef setInterruptStatus(I2C_HandleTypeDef I2cHandle, uint8_t *IT_Status);
../Inc/MAX44009.h(39): error: #20: identifier "uint8_t" is undefined
HAL_StatusTypeDef setInterruptStatus(I2C_HandleTypeDef I2cHandle, uint8_t *IT_Status);
../Inc/MAX44009.h(57): error: #20: identifier "HAL_StatusTypeDef" is undefined
HAL_StatusTypeDef setThreshold_Lux(I2C_HandleTypeDef I2cHandle,
../Inc/MAX44009.h(57): error: #20: identifier "I2C_HandleTypeDef" is undefined
HAL_StatusTypeDef setThreshold_Lux(I2C_HandleTypeDef I2cHandle,
../Inc/MAX44009.h(58): error: #20: identifier "uint8_t" is undefined
uint8_t int_e ,
../Inc/MAX44009.h(59): error: #20: identifier "uint8_t" is undefined
uint8_t config ,
../Inc/MAX44009.h(60): error: #20: identifier "uint8_t" is undefined
uint8_t thr_upper,
../Inc/MAX44009.h(61): error: #20: identifier "uint8_t" is undefined
uint8_t thr_lower,
../Inc/MAX44009.h(62): error: #20: identifier "uint8_t" is undefined
uint8_t thr_timer);

 

Instead if I try to include manually on my library stm32l4xx_hal_i2c.h I receive errors on the files of the folder STM32L4XX_HAL_Driver

Could anyone give me some advices of what I'm doing wrong?

Outcomes