cancel
Showing results for 
Search instead for 
Did you mean: 

unknown type name '__RAM_FUNC'; did you mean '__ARM_FP'?

DNeet.1
Associate II

I trying to port STM32CubeExpansion_LRWAN_V1.3.1 for the evaluation board B-L475E-IOT01A2. I managed to whittle the errors down to 2. In both cases i am getting

unknown type name '__RAM_FUNC'; did you mean '__ARM_FP'?

in a HAL file stm32l4xx_hal_flash_ramfunc.h generated by STM32CubeIDE. What does this error mean?

The crazy thing is that __RAM_FUNC gets defined in stm32l4xx_hal_def.h, and stm32l4xx_hal_def.h is included in stm32l4xx_hal_flash_ramfunc.h, but somehow the compiler fails to register this??

#if defined ( __CC_ARM  ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))

/* ARM Compiler V4/V5 and V6

  --------------------------

  RAM functions are defined using the toolchain options.

  Functions that are executed in RAM should reside in a separate source module.

  Using the 'Options for File' dialog you can simply change the 'Code / Const'

  area of a module to a memory space in physical RAM.

  Available memory areas are declared in the 'Target' tab of the 'Options for Target'

  dialog.

*/

#define __RAM_FUNC

#elif defined ( __ICCARM__ )

/* ICCARM Compiler

  ---------------

  RAM functions are defined using a specific toolchain keyword "__ramfunc".

*/

#define __RAM_FUNC __ramfunc

#elif defined  ( __GNUC__ )

/* GNU Compiler

  ------------

 RAM functions are defined using a specific toolchain attribute

  "__attribute__((section(".RamFunc")))".

*/

#define __RAM_FUNC __attribute__((section(".RamFunc")))

#endif

1 ACCEPTED SOLUTION

Accepted Solutions
Ozone
Lead II

> The crazy thing is that __RAM_FUNC gets defined in stm32l4xx_hal_def.h, and stm32l4xx_hal_def.h is included in stm32l4xx_hal_flash_ramfunc.h, but somehow the compiler fails to register this??

Not necessarily.

There is no un-conditional # else branch, if your toolchain does not support it (falls into one of the # if / # elif branches), it remains undefined.

For a start, you could conditionally define it to nothing (like the __CC_ARM branch), and drop the RAM function feature.

It is rarely a functional requirement, often only for performance.

View solution in original post

3 REPLIES 3
Ozone
Lead II

> The crazy thing is that __RAM_FUNC gets defined in stm32l4xx_hal_def.h, and stm32l4xx_hal_def.h is included in stm32l4xx_hal_flash_ramfunc.h, but somehow the compiler fails to register this??

Not necessarily.

There is no un-conditional # else branch, if your toolchain does not support it (falls into one of the # if / # elif branches), it remains undefined.

For a start, you could conditionally define it to nothing (like the __CC_ARM branch), and drop the RAM function feature.

It is rarely a functional requirement, often only for performance.

DNeet.1
Associate II

Thanks, I will try that. For now I just deleted the code which caused the bugs, however it keeps being regenerated by the IDE

Hi @DNeet.1​ ,

Please mark the post as a Best Answer if it solved your problem, so that this thread will be marked as solved

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen