i.MX RT 1020 using SRAM_OC and ITC

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

i.MX RT 1020 using SRAM_OC and ITC

Jump to solution
102 Views
seanwu
Contributor IV

Dear sir,

I put the following variable & functions inside SRAM_OC & SRAM_ITC respectively, but it doesn't seem to take up SRAM. Could you please give some advice?

Thanks.

BR,

Sean Wu.

//////////////////////////////////////////////////////////////////////////////////////////////

__attribute__((section(".SRAM_OC"))) unsigned char UART0packetRdPtr=PARSER_RING_BUF0_BEGIN;

__attribute__((section(".SRAM_ITC"))) static void gsm_init_callback(…)

seanwu_0-1726627693953.png

 

 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
88 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @seanwu ,

Hope you are doing well!

1. For functions:

__attribute__((section(".ramfunc.$SRAM_ITC"))) int DbgConsole_Printf(const char *fmt_s, ...);
int DbgConsole_Printf(const char *fmt_s, ...)
{
...
}

2. For variables:

Please refer to these links: 
https://community.nxp.com/t5/i-MX-Processors/How-to-define-variables-to-SRAM-or-SDRAM-with-certain/t...

https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/NCACHE-REGION-issue-on-RT1024/td-p/1796363

https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/

For me, since I don't want to modify the linkfile manually, the easiest way is to just divide it into two steps:

Step1: Add extra linkfile sections in mcuxpresso:

Gavin_Jia_0-1726652278489.png

 

 

Step2: add code:

__attribute__((section(".dummySectionName1"))) unsigned char mych[128];

 

Best regards,
Gavin

 

 

View solution in original post

0 Kudos
Reply
2 Replies
62 Views
seanwu
Contributor IV

Dear @Gavin_Jia ,

It works.

Thanks for your help.

BR,

Sean Wu

89 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @seanwu ,

Hope you are doing well!

1. For functions:

__attribute__((section(".ramfunc.$SRAM_ITC"))) int DbgConsole_Printf(const char *fmt_s, ...);
int DbgConsole_Printf(const char *fmt_s, ...)
{
...
}

2. For variables:

Please refer to these links: 
https://community.nxp.com/t5/i-MX-Processors/How-to-define-variables-to-SRAM-or-SDRAM-with-certain/t...

https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/NCACHE-REGION-issue-on-RT1024/td-p/1796363

https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/

For me, since I don't want to modify the linkfile manually, the easiest way is to just divide it into two steps:

Step1: Add extra linkfile sections in mcuxpresso:

Gavin_Jia_0-1726652278489.png

 

 

Step2: add code:

__attribute__((section(".dummySectionName1"))) unsigned char mych[128];

 

Best regards,
Gavin

 

 
0 Kudos
Reply