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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

532件の閲覧回数
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 返答(返信)

485件の閲覧回数
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 件の賞賛
返信

481件の閲覧回数
emb02
Contributor IV
Hi,
I've tried this way but my MIMXRT1021_Project_Debug.ld file does not update after doing this steps.
0 件の賞賛
返信

477件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信

473件の閲覧回数
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 件の賞賛
返信

380件の閲覧回数
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 件の賞賛
返信

417件の閲覧回数
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 件の賞賛
返信