FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches
define_memory_sections.h File Reference

Defines for placing functions in specific memory sections. More...

Go to the source code of this file.

Macros

#define INIT3_SECTION
 Defines compiler-specific attributes for placing a function in the .init3 memory section.

Detailed Description

Defines for placing functions in specific memory sections.

Definition in file define_memory_sections.h.

Macro Definition Documentation

◆ INIT3_SECTION

#define INIT3_SECTION

Defines compiler-specific attributes for placing a function in the .init3 memory section.

This macro is used to define the attributes used to place a function in the .init3 section, and to prevent the function from being removed during optimization, even if it is declared static and not called anywhere.

Note
The .initN sections are used to define the startup code from reset until the start of main(). These are all subparts of the .text section. The purpose of these sections is to allow for more specific placement of code within a program.
The .init0, .init1, .init3 and .init5 to .init8 memory sections are unused by default.
The .init2 memory section initializes the Stack Pointer and sets the zero register (the compiler assumes R1 in the CPU is zero).
The .init4 memory section copies the contents of the .data section in Flash to RAM and zeroes out the .bss section.
The .init9 memory section jumps to the main() function.
Warning
While in the .init3 memory section, accessing or modifying uninitialized global variables located in .data or .bss sections can lead to undefined behavior or ECC errors.
Standard library functions may rely on an initialized C runtime environment. It is recommended to avoid calling library functions that depend on the runtime environment in the .init3 memory section.

Definition at line 57 of file define_memory_sections.h.