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: Code Composer Studio
My hardware is using an F28377D connected to an external SDRAM. Everything is working fine with the SDRAM. I can copy and work with large amounts of data on it.
The code also dynamically allocates memory on the heap for certain tasks. This works OK when the heap is defined in the linker in internal memory:
RAMGS5 : origin = 0x011000, length = 0x001000
.esysmem : > RAMGS5 PAGE = 1
The problem now is that I need to allocate much larger amounts of memory than 0x1000 words. I don't have any more resources in internal RAM so I need to use my external SDRAM to store the heap. I changed my linker file to include these lines:
EMIF1_CS0nA : origin = 0x80000000, length = 0x200000 // An 8Mbyte SDRAM chip connected to EMIF1 CS0 (low 4 MBytes)
EMIF1_CS0nB : origin = 0x80200000, length = 0x200000 // An 8Mbyte SDRAM chip connected to EMIF1 CS0 (high 4 Mbytes)
.esysmem : > EMIF1_CS0nB PAGE = 1 //used for mallocs
Even if I leave my heap size at 0x1000 in the linker settings, every time I call malloc now, it returns NULL. Note that I am NOT using any RTOS.
Is there some other Linker setting I am missing?
Trevor,
I suspect that this may be related to C28x access of the SDRAM address space.
I'm not an expert in this area, but I think that you may need to modify and rebuild memory.c in the RTS library to declare the heap space variable "_sys_memory" as __attribute__((far)) volatile int so that the compiler will know to use 32-bits for heap addresses. There may be additional changes as well.
You can see this Application Report for more information about accessing variables in SDRAM space.
-Tommy