Skip to main content
richardst9
Associate II
October 9, 2016
Question

Compile error in stm32f4xx_hal_i2c.c.

  • October 9, 2016
  • 1 reply
  • 810 views
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
This topic has been closed for replies.

1 reply

Walid FTITI_O
Visitor II
October 10, 2016
Posted on October 10, 2016 at 12:41

Hi richard, 

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

-Hannibal-