How to add C++ file in SDRAM section using MCUXPresso Linker script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've tried this way but my MIMXRT1021_Project_Debug.ld file does not update after doing this steps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is your *.cpp file in the source folder? This should be necessary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
// 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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