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.

EVMC6678L: data section

/* my application*/

.......

#pragma DATA_SECTION(ybuff,".dsect1");

char ybuff[ WIDTH * HEIGHT ] = {

#include "data.h"

};

 

int main()

{

.....

}

In my .cfg file,

Program.sectMap[".dsect"]             = "L2_DATA";

or Program.sectMap[".dsect"]             = "DDR3";

or Program.sectMap[".dsect"]             = "MSMCSRAM";

.....

After compileing the project, check the .map in Debug。Found this!!!

 

MEMORY CONFIGURATION

 

         name            origin    length      used     unused   attr    fill

----------------------  --------  ---------  --------  --------  ----  --------

  L2SRAM                00800000   00040000  0001bff4  0002400c  RW X

  L2_DATA               00840000   00040000  00000000  00040000  RW X

....

  DDR3                  80000000   10000000  00000000  10000000  RW X

 

On the L2_DATA , DDR3 or MSMCSRAM memory, there is no section for ybuff DATA_SECTION, 

Is there something wrong? I do'nt know what to do,need help!!!

thanks for your help!!

  • Hi sunny,

    First, you  designate section ".dsect1" for ybuff but make the allocation of ".dsect" in your cfg. And the '#include' expression located between the braces. Is it just a mis-writing?

    Second, the other reason can cause the situation is that if you only define the data array and section but didn't invoke the array in your application code. The complier will think you actually don't need the array and exclude it from the debug process. So the section will miss in map file.

     

    Allen

     

  • To add to Allen

     

    1. You can specify variable as Volatile so the compiler will not exclude it from the build

    2. If the linker does not know where to put a global variable because it does not find a section definition, it will print a warning message during the build process and put the variable somewhere.  Look at the map file to see where the variable is

     

    Ran

  • ran35366 said:

    1. You can specify variable as Volatile so the compiler will not exclude it from the build

    I'm sorry, this is not enough to force the linker to retain a variable.  Volatile matters to the compiler, not the linker.  The best thing to do is make sure there is an actual reference.  Other things you can do include using the --undef_sym or --retain linker options.  See the Assembly Language Tools User's Guide.

  • Hi Allen,

    thanks for you answer!!! you are right, I am late.