Configuration:
CCS Version: 6.1.0.00104 Compiler TIv5.1.7 TivaWare_C_Series-2.1.1.71 Bios_6_37_00_20
Hardware is other vendor production board with Tiva TM4C129XNCZAD processor with 8 Mbyte external SDRAM on EPI bus.
I have 2 active projects which will require more ram than is available internally on the processor.
I have not yet determined the correct/best method to build projects to "easily" reference the external SDRAM. I can only reference the SDRAM as a big array using a pointer (not good enough) for my needs/desires.
I would like to assign a "SECTIONS" to SDRAM and use that where reasonable for SECTIONS like .data, .bss, .sysmem if that is possible.
I just want to have more ram available for projects. I have not found a solution, if there is one, in the many, many references in the forums to external SDRAM,
only the way to reference SDRAM as a large array or structure.
I expect the external ram reference to be slower than internal memory and accept that limitation.
Present Situation:
Working code maps external SDRAM to 0x60000000. Existing application runs without problems and provides access to SDRAM through use of a pointer defining the starting address of an array. Present code accesses the SDRAM using writes and reads to store then read data at startup. The SDRAM is also used as LCD display memory. This works but limits C code to array reference.
I can easily overrun available heap when dynamically creating tasks, semaphores, mailboxes, etc.
Partial Progress:
Is it correct to modify the *.cmd file produced by CCS in the project to add an SDRAM section of memory and to provide the address/size in this file.
My present code follows.
With these changes to .cmd file, the project compiles and links without errors. The .map file shows a SDRAM SECTION at the desired location.
The application fails at "startup" in "loader_exit" without getting to main() in application code.
*** .cmd file modifications ****
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00100000
SRAM (RWX) : origin = 0x20000000, length = 0x00040000
SDRAM (RW) : origin = 0x60000000, length = 0x00800000 (this line added)
}
/* Section allocation in memory */
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
.sdram : > SDRAM (this line added)
}
*** .map snippet **
FLASH 00000000 00100000 0001f17e 000e0e82 R X
SRAM 20000000 00040000 000293b0 00016c50 RW X
SDRAM 60000000 00800000 00000002 007ffffe RW
*********************** code snippet *******************************************************
// at module level - not within a procedure
#pragma DATA_SECTION(ExtData, ".sdram")
uint16_t ExtData;
// in a task procedure
ExtData = 1;
********************************************************************************************
Above fails to reach main() as described above. Next try:
I am GUESSING that I need to insert a "startup" hook before BIOS_start() in main() to initialize the
EPI interface to the SDRAM, but am way out of my depth here.
My (bad) ideas for .cfg changes follow. This does not even build.
***************** .cfg snippet ******************************
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.addUserStartupFunction('&SDRAMInit'); // this added
var Startup = xdc.useModule('xdc.runtime.Startup');
Startup.firstFxns[Startup.firstFxns.length++] = 'SDRAMInit'; // this added
*********************************************************************
Of course I would greatly appreciate help ;-)). I did a lot of searching on forums and did not see this exact question asked.