How to add C++ file in SDRAM section using MCUXPresso Linker script

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

How to add C++ file in SDRAM section using MCUXPresso Linker script

1,019 次查看
emb02
Contributor IV

Hi,

I'm using MIMXRT1021 evaluation board in which I want to put the entire C++ file into external SDRAM.

In MCUXpresso project settings there is one option to Manage Linker script but I'm not getting any reference to add file into SDRAM section.

I've tried but not able to do the same. Please guide me further.

MIMXRT.PNG

0 项奖励
回复
6 回复数

972 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @emb02 ,

Hope you are doing well!

This post should meet your needs, please refer to it: https://mcuoneclipse.com/2021/05/26/placing-code-in-sections-with-managed-gnu-linker-scripts/

 

Best regards,
Gavin

0 项奖励
回复

968 次查看
emb02
Contributor IV
Hi,
I've tried this way but my MIMXRT1021_Project_Debug.ld file does not update after doing this steps.
0 项奖励
回复

964 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Is your *.cpp file in the source folder? This should be necessary.

0 项奖励
回复

960 次查看
emb02
Contributor IV

Hi,
Yes my Test1.cpp file is in the source folder.
Can you verify - */Test1.o (.text .text*)
Is this the correct way of adding file name?

0 项奖励
回复

867 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @emb02 ,

On my side, I have implemented a method to put a C file into SDRAM. Please refer to <MCUXpresso IDE User Guide> Chapter 20.13.5 Placing specific functions into RAM blocks.

Gavin_Jia_0-1713522954031.png

// test.h

#ifndef TEST_H_
#define TEST_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <cr_section_macros.h>
__RAMFUNC(RAM2) void my_function(void);

#ifdef __cplusplus
}
#endif

#endif /* TEST_H_ */

Hope it helps!

Best regards,
Gavin

0 项奖励
回复

904 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @emb02 ,

Thanks for your feedback!

I'll test it for you on my end and get back to you in a timely manner. It may take some time because of the recent backlog. Thanks in advance for your kind understanding!

Best regards,
Gavin

0 项奖励
回复