Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

5.2.1.1.1. alt_load ()

You may enable the alt_load () function in the HAL code. This function operates as a mini boot copier that copies only the writable memory sections to RAM based on the BSP settings. It optionally copies sections from the boot memory to RAM. It can copy data sections (.rodata, .rwdata, .exceptions) to RAM but not the code sections (.text). The code section (.text) section is a read-only section and remains in the booting flash memory region. This partitioning helps to minimize the RAM usage but may limit the code execution performance because accesses to flash memory are slower than accesses to the on-chip RAM. The alt_load () function can be enabled in the BSP Settings.
Table 27.  BSP Settings
BSP Settings Functions
hal.linker.enable_alt_load Enable alt_load() function.
hal.linker.enable_alt_load_copy_rodata alt_load() copies .rodata section to RAM.
hal.linker.enable_alt_load_copy_rwdata alt_load() copies .rwdata section to RAM.
hal.linker.enable_alt_load_copy_exceptions alt_load() copies .exceptions section to RAM.