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

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

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

1,129 Views
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 Kudos
Reply
6 Replies

1,082 Views
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 Kudos
Reply

1,078 Views
emb02
Contributor IV
Hi,
I've tried this way but my MIMXRT1021_Project_Debug.ld file does not update after doing this steps.
0 Kudos
Reply

1,074 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply

1,070 Views
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 Kudos
Reply

977 Views
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 Kudos
Reply

1,014 Views
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 Kudos
Reply