Hello !
MCUXpresso generate nice looking ld scripts but it is difficult to modify it for some typical purposes.
For example if FreeRTOS MPU should be used a lot of definitions for sections
/* Variables used by FreeRTOS-MPU. */
_Privileged_Functions_Region_Size = 32K;
_Privileged_Data_Region_Size = 512;
__FLASH_segment_start__ = ORIGIN( ROM );
__FLASH_segment_end__ = __FLASH_segment_start__ + LENGTH( ROM );
__privileged_functions_start__ = ORIGIN( ROM );
__privileged_functions_end__ = __privileged_functions_start__ + _Privileged_Functions_Region_Size;
__SRAM_segment_start__ = ORIGIN( RAM );
__SRAM_segment_end__ = __SRAM_segment_start__ + LENGTH( RAM );
__privileged_data_start__ = ORIGIN( RAM );
__privileged_data_end__ = ORIGIN( RAM ) + _Privileged_Data_Region_Size;
and after that section usage everywhere.
/*
* For Cortex-M devices, the beginning of the startup code is stored in
* the .isr_vector section, which goes to ROM
*/
privileged_functions :
{
. = ALIGN(4);
_isr_vector = .;
KEEP(*(.isr_vector))
*(privileged_functions)
. = ALIGN(4);
/* Non privileged code is after _Privileged_Functions_Region_Size. */
__privileged_functions_actual_end__ = .;
. = _Privileged_Functions_Region_Size;
} > ROM
And a lot of other relative changes what is need for FreeRTOS_MPU usage.
Do you have ready to use templates for XPresso and Kinetis MCU ( K8x foe example ) ?
Or it is recommended to use some external scripts for this kind of case ?
Regards,
Eugene