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.

Enlarging RAM sections in linker file?

Other Parts Discussed in Thread: TMS320F28335

Hi

I am using the TMS320C2000 (F28335) Development Tool and CCSv4 in a project, where I need store a couple of large arrays on the RAM of the DSP. Therefore I have tried enlarging the RAML6 section in the linker file (28335_RAM_lnk.cmd). Here is the changes I have made:


====== BEFORE ======
PAGE 1 :BOOT_RSVD : origin = 0x000002, length = 0x00004E
RAMM1 : origin = 0x000400, length = 0x000400
RAML4 : origin = 0x00C000, length = 0x001000 RAML5 :  origin = 0x00D000, length = 0x001000
RAML6 : origin = 0x00E000, length = 0x001000
RAML7 : origin = 0x00F000, length = 0x001000
ZONE7B : origin = 0x20FC00, length = 0x000400
====== AFTER ======
PAGE 1 :
BOOT_RSVD : origin = 0x000002, length = 0x00004E
RAMM1 : origin = 0x000400, length = 0x000400
RAML4 : origin = 0x00C000, length = 0x001000
RAML5 : origin = 0x00D000, length = 0x001000
RAML6 : origin = 0x00E000, length = 0x200C00
RAML7 : origin = 0x20EC00, length = 0x001000
ZONE7B : origin = 0x20FC00, length = 0x000400
==================


Also, in order to make sure that the arrays (of doubles) are placed in the RAML6 section (called ".toRAML6") , I have made the following above my main.c file:


#pragma DATA_SECTION(Table1, ".toRAML6");
#pragma DATA_SECTION(Table2, ".toRAML6");
#pragma DATA_SECTION(Table3, ".toRAML6");
double Table1[BufferSize];
double Table2[BufferSize];
double Table3[BufferSize];
==================

Because this gave the error "memory map prevented read of target memory......" when trying to access the tables from the Watch window, I found some inspiration on the Internet regarding changes in the "f28335.gel" file, which is used for the project. In the file I just changed the sizes of the RAM sections according to those in the linker file:

hotmenu F28335_Memory_Map()
{
...
/* Program memory map */
...
GEL_MapAdd(0xE000,0,0x200C00,1,1); /* L6 SARAM */
GEL_MapAdd(0x20EC00,0,0x1000,1,1); /* L7 SARAM */
...
/* Data memory map */
...
GEL_MapAdd(0xE000,1,0x200C00,1,1); /* L6 SARAM */
GEL_MapAdd(0x20EC000,1,0x1000,1,1); /* L7 SARAM */
...
}
hotmenu Fill_F28335_RAM_with_ESTOP0()
{
...
GEL_MemoryFill(0x00E000,1,0x201C00,0x7625); /* Fill L6/L7 */
...
}
==================


This cancelled the error, but I am still not able to use some of the memory in the RAML6 section. When using a "BufferSize" of, say, 2000 everything works. However, when increasing the "BufferSize" to 5000, none of the entrances in the arrays get updated at all and all I get is af bunch of zeros in the arrays. And there is no error messages or what so ever.


Can anyone help explaning what I have done wrong? And how to fix it?


Best regards,


Morten.

  • The actual device of the TMS320F28335 does not physically have that much RAM on chip.  Therefore what you are doing is not going to work.

    Keep in mind, the memory declarations in the linker command file communicates to the linker the memory map of the target device and platform.

    If you need more RAM, then the TMS320F28335 supports the XINTF interface which allows connection to external memory like SRAM.  You can then add that particular memory to the linker command file to describe the availability of this RAM to the linker.  But again, it doesn't change what is physically on the device which is fixed and unchangeable.

  • Thanks for the reply, Brandon.

    Maybe I will consider using external RAM instead. But if not, do you have a suggestion of how to change the RAM sections in order to gain - as much as possible - RAM for the arrays? Which RAMLx sections should I enlarge? And how much?

    Morten.

  • Morten Walku said:

    But if not, do you have a suggestion of how to change the RAM sections in order to gain - as much as possible - RAM for the arrays? Which RAMLx sections should I enlarge? And how much?

    This is something you need to be very careful with to ensure that you are properly describing the memory map to the linker.  The saving aspect of this is that the RAM blocks are actually contiguous, so it would be safe to combine, for instance, 2 memory segments into 1.

    For example:

    Before
    RAML6 : origin = 0x00E000, length = 0x001000
    RAML7 : origin = 0x00F000, length = 0x001000

    After
    RAML67 : origin = 0x00E000, length = 0x002000

    Again, this will only work for contiguous memory segments.