cancel
Showing results for 
Search instead for 
Did you mean: 

BUG REPORT: Cube32 in F446 code generation

Harvey White
Senior III
Posted on April 29, 2018 at 20:30

Cube MX 4.25

Generate source using F446 processor for Atollic TS v9

CubeMX and TS are up to date

get following error:

..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c:163:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'HAL_FLASHEx_DisableFlashSleepMode'

 __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_DisableFlashSleepMode(void)

(same error for any instance of RAMFUNC prefix.

example error line in code is

__RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_DisableFlashSleepMode(void)

Line #185 in  stm32f4xx_hal_def.h is

#define __RAM_FUNC HAL_StatusTypeDef __attribute__((section('.RamFunc')))

which expands to

HAL_StatusTypeDef __attribute__((section('.RamFunc')))HAL_StatusTypeDef HAL_FLASHEx_DisableFlashSleepMode(void)

Cube32 is remarkably consistent in generating this error.  Since I don't use code executed from RAM (no guarantee that the compiler doesn't), the code doesn't do anything for me except cause an inconvenience.

PLEASE fix the code generation (or file definition) as needed or at least tell me the settings to remove the 'RAMFUNC' option from my code.  I haven't found it.

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III
Posted on April 29, 2018 at 20:56

This probably has been fixed in the latest libraries release for F4 v 1.21.0. Definition of  

__RAM_FUNC fixed.

--pa

View solution in original post

2 REPLIES 2
Pavel A.
Evangelist III
Posted on April 29, 2018 at 20:56

This probably has been fixed in the latest libraries release for F4 v 1.21.0. Definition of  

__RAM_FUNC fixed.

--pa

Harvey White
Senior III
Posted on April 29, 2018 at 21:54

It turns out that this is absolutely correct.  Cube32 was keeping earlier versions of the library and using them rather than the current version.  Removing those earlier versions solved the problem.  I'll just rebuild other software projects.

Thanks