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.

How to define a DATABUF on L1D DM648

DM648  CCS3.3  


My tcf:
L1CACHE  16KB    addr:0x00f04000     len: 0x4000
L1D SRAM  16KB    addr:0x00f00000    len:0x4000  


In my app code:
#pragma DATA_SECTION(DATABUF,”L1DSRAM”)

But,in .map file,  the start address of  DATABUF is  0x00a08500 ; and it was located in IRAM (L2SRAM)  

????   why????  How to explain it?  I just want to define a DATABUF on L1D;

  • In my app code:

    #pragma DATA_SECTION(DATABUF,”L1DSRAM”)

    unsigned char DATABUF[16*1024];

  • Hongke Zhang,

    Please check the other questions in a forum to see if that is the right forum for your question. And please do not post onto an unrelated thread. A new thread with your question will be less confusing and more like to get serviced well.

    Your quotation from the .tcf file has a typo with a space in the middle of the "L1D SRAM" name. Also, those two lines quoted are not valid tcf syntax, so there is not a way for us to know what you have done wrong. You may have done nothing wrong there.

    You must add a second linker .cmd file that defines a new allocation section within the SECTION part of the linker command file. See the Assembly Language Tools Reference Guide for discussions of the SECTION part of the linker command file. Name the new allocation section ".l1dbuf" and use that section name in the DATA_SECTION pragma instead of "L1DSRAM".

    In the tcf, you allocate memory components that are defined in the MEMORY part of a linker command file. These are not the same as the allocation sections that are defined in the SECTION part of the linker command file. I apologize that our wording for these is confusing.

    Regards,
    RandyP

  • tks,RandyP !

    I am sorry of my carelessness.  I would post my picture to describe.

    First, my tcf  and map file;

    Second, my app code and CCS watch window.

    my confusion    was  :

    1.   In my tcf   bios  config ,  the start address of    "L1DSRAM"   was    0x00f0 0000  and    length   was  0x4000(16KB).

          Then , In my app code  when  I  put   array  "Buf_L1DSRAM"   on   "L1DSRAM"   using   #pragma DATA_SECTION ,

          But   when  I  complier  my  app code  ,Load  .out  into CCS  and  then  run.    I  got   the   start  address  of   my  "Buf_L1DSRAM"

          was  0x00a0 8500 in  CCS  watch window.  

          Why ?   how to explain ?   why  start address of  "Buf_L1DSRAM"   was  not   0x00f0 0000  but   0x00a0 8500 (It was start address of  L2SRAM  "IRAM") ?


    best regards!

  • Hongke Zhang,

    Perhaps I have a color blindness of some type, but it is very difficult for me to read the text that is highlighted with red background.

    RandyP said:

    You must add a second linker .cmd file that defines a new allocation section within the SECTION part of the linker command file. See the Assembly Language Tools Reference Guide for discussions of the SECTION part of the linker command file. Name the new allocation section ".l1dbuf" and use that section name in the DATA_SECTION pragma instead of "L1DSRAM".

    In the tcf, you allocate memory components that are defined in the MEMORY part of a linker command file. These are not the same as the allocation sections that are defined in the SECTION part of the linker command file. I apologize that our wording for these is confusing.

    To understand your start address concern, you probably need to look at the linker's warning messages. But is you add the second linker .cmd file, that will be taken care of. You can read about linker command files in the Assembly Language Tools Reference Guide. When you write the new linker command file, you will add it to your project but I do not remember the specifics for this for CCS 3.3. You will have to search the documentation for that.

    Regards,
    RandyP

  • Thx,RandyP:

    1. I will try according to your advice

    2. Because you said  " I have a color blindness of some type",  I posted  my problem again below ! 

     

    my confusion    was  :

    1.   In my tcf   bios  config ,  the start address of    "L1DSRAM"   was  0x 00f0 0000 and    length   was  0x4000(16KB).

          Then , In my app code  when  I  put   array  "Buf_L1DSRAM"   on   "L1DSRAM"   using   #pragma DATA_SECTION ,

          But   when  I  complier  my  app code  ,Load  .out  into CCS  and  then  run.    I  got   the   start  address  of   my  "Buf_L1DSRAM"

          was 0x 00a0 8500 in  CCS  watch window. 

          Why ?   how to explain ?   why  start address of  "Buf_L1DSRAM"   was  not   0x 00f0 0000 but    0x 00a0 8500 (It was start address of  L2SRAM  "IRAM") ?

  • According to your advice , I  solved it !  thx,RandyP