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.

C28x .sysmem vs .esysmem linker sections

Hi Folks,

Is there a need for both .sysmem and .esysmem sections? Some of the provided linker command files use one, some the other.

I did find a version change note in some document (cant recall which one now) that .sysmem is deprecated. Is that the case? Will using .esysmem alone now satisfy all uses? e.g. using malloc() on non-BIOS projects...

Ta, T

  • Toby,

    You ask a good question concerning the use and difference between .sysmem and .esysmem.  I frankly never figured out when the compiler uses which of these (similar for .ebss vs. .bss, and .econst vs. .const).  I know the 'e' sections were added when the memory model for data grew beyond the archaic 16-bit (64Kw) limit some 15 years ago.

    I found the following in the C28x Assembly Language Tools User's Guide, November 2014, SPRU513H, p.335:

    This user's guide version applies to compiler version v6.4 and later.  I do not see anything in the readme files for the compiler versions however (I checked the readme.txt file for cgtools v6.2.5 and v6.4.5).

    I built a test code project using both cgtools v6.2.5 and v6.4.5.  I included a malloc in the code.  According to the .map file, for v6.2.5, the heap was placed in the .sysmem section, constants in the .econst, and variables in the .ebss.  .const and .bss sections were not used.  For v6.4.5, the heap was placed in the .esysmem section.  Everything else was the same (meaning .sysmem, .const, and .bss sections were not used).  So it does appear that these sections are no longer employed by the compiler.

    Personally, I see no harm in keeping the .sysmem, .const, and .bss sections in the linker .cmd file.  Just allocate each section exactly the same as the 'e' version of the section.  Whatever you do with one, do with the other.  For example:

    .sysmem : > L4SARAM, PAGE = 1
    .esysmem : > L4SARAM, PAGE = 1

    If there is nothing in the section, the statement does nothing and you can see there is nothing in the section in the .map file.

    Alternately, if you omit the non-e version of the sections from the linker .cmd file, and there is in fact something allocated to that section, the linker will warn you provided the -w linker option is selected in the project properties (which it is by default).  So, you won't get in to trouble.

    Regards,

    David

  • Thanks for a comprehensive answer David!
    T