EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
RAMFUNC

Detailed Description

RAM code support.

This module provides support for executing code from RAM. A unified method to manage RAM code across all supported tools is provided.

Note
Other cross-compiler support macros are implemented in COMMON.
Functions executing from RAM should not be declared as static.
Warning
With GCC in hosted mode (default), standard library facilities are available to the tool regardless of the section attribute. Calls to standard libraries placed in the default section may therefore occur. To disable hosted mode, add '-ffreestanding' to the build command line. This is the only way to guarantee no calls to standard libraries with GCC. Read more at https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Standards.html


Usage

In your .h file:

#include "em_ramfunc.h"

SL_RAMFUNC_DECLARATOR
void MyPrint(const char* string);

Issues have been observed with armgcc when there is no declarator. It is recommended to have a declarator also for internal functions, but move the declarator to the .c file.

In your .c file:

#include "em_ramfunc.h"

SL_RAMFUNC_DEFINITION_BEGIN
void MyPrint(const char* string)
{
...
}
SL_RAMFUNC_DEFINITION_END

Macros

#define SL_RAMFUNC_DECLARATOR
 Compiler ported function declarator for RAM code.
 
#define SL_RAMFUNC_DEFINITION_BEGIN
 Compiler ported function definition begin marker for RAM code.
 
#define SL_RAMFUNC_DEFINITION_END
 Compiler ported function definition end marker for RAM code.
 
#define SL_RAMFUNC_DISABLE
 This define is not present by default. By compiling with the define SL_RAMFUNC_DISABLE, code placed in RAM by the SL_RAMFUNC macros will be placed in default code space (Flash) instead. More...
 

Macro Definition Documentation

#define SL_RAMFUNC_DISABLE

This define is not present by default. By compiling with the define SL_RAMFUNC_DISABLE, code placed in RAM by the SL_RAMFUNC macros will be placed in default code space (Flash) instead.

Note
This define is not present by default.

Definition at line 107 of file em_ramfunc.h.