ramfunc region is copied into RAM from FLASH region during XIP init. We copy from the loadaddr of the region, and were previously loading to the symbol __ramfunc_start. This is incorrect when using an MPU with alignment requirements, as the __ramfunc_start symbol may have padding placed before it in the region. The __ramfunc_start symbol still needs to be aligned in order to be used by the MPU though, so define a new symbol __ramfunc_region_start, and use that symbol when copying the __ramfunc region from FLASH to RAM. Fixes #75296 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
24 lines
546 B
Text
24 lines
546 B
Text
/*
|
|
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
* Copyright (c) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/* Copied from linker.ld */
|
|
|
|
SECTION_DATA_PROLOGUE(.ramfunc,,)
|
|
{
|
|
__ramfunc_region_start = .;
|
|
MPU_ALIGN(__ramfunc_size);
|
|
__ramfunc_start = .;
|
|
*(.ramfunc)
|
|
*(".ramfunc.*")
|
|
|
|
#include <snippets-ramfunc-section.ld>
|
|
|
|
MPU_ALIGN(__ramfunc_size);
|
|
__ramfunc_end = .;
|
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
|
__ramfunc_size = __ramfunc_end - __ramfunc_start;
|
|
__ramfunc_load_start = LOADADDR(.ramfunc);
|