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(…)
Solved! Go to Solution.
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:
Step2: add code:
__attribute__((section(".dummySectionName1"))) unsigned char mych[128];
Best regards,
Gavin
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:
Step2: add code:
__attribute__((section(".dummySectionName1"))) unsigned char mych[128];
Best regards,
Gavin