Managed ld scripts for MCUXpresso and RTOS_MPU

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Managed ld scripts for MCUXpresso and RTOS_MPU

跳至解决方案
2,877 次查看
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 项奖励
回复
1 解答
2,689 次查看
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 项奖励
回复
1 回复
2,690 次查看
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 项奖励
回复