This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Team,
I have been working on a customer application that is running low on system SRAM in the device due to the amount of data being collected and processed. I would like to reclaim the 2KB of memory mapped Sensor Controller AUX RAM exclusively for use by the CM3 core because the SCE is not needed in their application.
To do this I have simply modified the linker .cmd file to add the region to the MEMORY and SECTION define as '.scratchpad':
#define AUX_RAM_BASE 0x400E0000 #define AUX_RAM_SIZE 0x800 /* System memory map */ MEMORY { /* Application stored in and executes from internal flash */ FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE /* Application uses internal RAM for data */ SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE /* Application uses AUX RAM for scratcpad data */ AUX_SRAM (RWX) : origin = AUX_RAM_BASE, length = AUX_RAM_SIZE } /* Section allocation in memory */ SECTIONS { .text : > FLASH .const : > FLASH .constdata : > FLASH .rodata : > FLASH .cinit : > FLASH .pinit : > FLASH .init_array : > FLASH .emb_text : > FLASH .ccfg : > FLASH (HIGH) #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT) #endif #endif .data : > SRAM .bss : > SRAM .sysmem : > SRAM .stack : > SRAM (HIGH) .nonretenvar : > SRAM .scratchpad : > AUX_SRAM }
then within application code I can now define buffers and use this admittedly non-contiguous scratchpad region:
// Allocate some buffers in our (AUX_RAM) scratchpad area #pragma DATA_SECTION(bufferA, ".scratchpad") char bufferA[512]; #pragma DATA_SECTION(bufferB, ".scratchpad") char bufferB[512];
I can see the linker allocating the AUX_RAM region to the buffers in the .map file correctly
MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- FLASH 00000000 00020000 00003420 0001cbe0 R X SRAM 20000000 00005000 0000124b 00003db5 RW X AUX_SRAM 400e0000 00000800 00000400 00000400 RW X
This all seems to work fine with default configurations within a TI-RTOS based sample application (idle task and standard power management framework).
Is there anything else I need to do to use this safely? Are there any other configuration requirements that are needed to do this safely such as enabling AUX clock and power domains, ensuring the SCE core is halted (AON_WUC_AUXCTL_SCE_RUN_EN_M cleared in AON_WUC_O_AUXCTL) or explicitly enabling AUX RAM retention (AON_WUC_AUXCFG_RAM_RET_EN set in AON_WUC_O_AUXCFG)?
Thanks for your recommendations.
Regards,
Garry
Hello Eirik,
thanks for the response and I look forward to additional feedback. Can you also quantify the AUX RAM access speed difference so that I have the whole picture. It may not be an issue for this particular customer application.
Regards,
Garry
Many thanks Eirik,
this is very useful information. We will test this out.
Regards,
Garry