cancel
Showing results for 
Search instead for 
Did you mean: 

Compile error in stm32f4xx_hal_i2c.c.

richardst9
Associate II
Posted on October 09, 2016 at 09:45

I'm getting a basic compile error in stm32f4xx_hal_i2c.c.

The header on the file says:

  * @file    stm32f4xx_hal_i2c.c

  * @author  MCD Application Team

  * @version V1.5.1

  * @date    01-July-2016

I see:

HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)

{

  uint32_t tickstart = 0x00U;

  /* Init tickstart for timeout management*/

  tickstart = HAL_GetTick();

 

  __IO uint32_t count = 0U;

The error is:

..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c(2879): error:  &sharp268: declaration may not appear after executable statement in block

I think we can easy all see the obvious fix to this HAL library file, but I'm struggling to see how anyone could build this (unless they had -cpp flag set) in its released form.

Richard

P.S. I tried to format this better, but the link that says ''

'' is no help

#hal-broken
1 REPLY 1
Walid FTITI_O
Senior II
Posted on October 10, 2016 at 12:41

Hi richard, 

Check if the ''C99 mode'' in C/C++ options is enabled.

-Hannibal-