AnsweredAssumed Answered

Compile error in stm32f4xx_hal_i2c.c.

Question asked by richard on Oct 9, 2016
Latest reply on Oct 10, 2016 by FTITI.Walid
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:  #268: 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.


P.S. I tried to format this better, but the link that says "Click for help about adding HTML formatting." is no help