Managed ld scripts for MCUXpresso and RTOS_MPU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Managed ld scripts for MCUXpresso and RTOS_MPU

Jump to solution
1,000 Views
EugeneHiihtaja
Senior Contributor I

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

0 Kudos
1 Solution
812 Views
lpcxpresso_supp
NXP Employee
NXP Employee

There is no direct support built into the IDE for FreeRTOS MPU. However you should be able to reconfigure the linker scripts generated by the IDE by making use of Freemarker linker script templates - as described in chapter 16, "Memory Configuration and Linker Scripts", of the MCUXpresso IDE v10.2 User Guide (in particularly sections 16.12 and 16.13).

Regards,

MCUXpresso IDE Support

View solution in original post

0 Kudos
1 Reply
813 Views
lpcxpresso_supp
NXP Employee
NXP Employee

There is no direct support built into the IDE for FreeRTOS MPU. However you should be able to reconfigure the linker scripts generated by the IDE by making use of Freemarker linker script templates - as described in chapter 16, "Memory Configuration and Linker Scripts", of the MCUXpresso IDE v10.2 User Guide (in particularly sections 16.12 and 16.13).

Regards,

MCUXpresso IDE Support

0 Kudos