Defines for placing functions in specific memory sections.
More...
Go to the source code of this file.
|
| #define | INIT3_SECTION |
| | Defines compiler-specific attributes for placing a function in the .init3 memory section.
|
Defines for placing functions in specific memory sections.
- Copyright
- © 2025 Microchip Technology Inc. and its subsidiaries.
Subject to your compliance with these terms, you may use Microchip software and any derivatives exclusively with Microchip products. It is your responsibility to comply with third party license terms applicable to your use of third party software (including open source software) that may accompany Microchip software.
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
Definition in file define_memory_sections.h.
◆ 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.