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.

Compiler: CLA_type1 scratchpad linker definition



Tool/software: TI C/C++ Compiler

Hi all,

I'm trying to get two the scratchpad of two CLA objects (CLA1_main.c and CLA2_main.c) in one union.

But get the message 10030-D expecting section type (COPY, DSECT, or NOLOAD) instead of ".scratchpad"

[code]

  UNION (ClaScratchpads) > CLA_DRAMLS2 PAGE(DataPage)
   {     CLA1_main.obj(.scratchpad)
         CLA2_main.obj(.scratchpad)
   }

[/code]

while this declaration does work:

[code]

  ClaScratchpads > CLA_DRAMLS2 PAGE(DataPage)
   {     CLA1_main.obj(.scratchpad)
   }

[/code]

And what I would like to have is:

[code]

UNION (ClaScratchpads) > CLA_DRAMLS2 PAGE(DataPage)
{    GROUP (CLA1scratch)
    {   CLA1_main.obj (.scratchpad)
        CLA1_task1.obj(.scratchpad)
        CLA1_task2.obj(.scratchpad)
    }
    GROUP (CLA2scratch)
    {   CLA2_main.obj (.scratchpad)
        CLA2_task1.obj(.scratchpad)
        CLA2_task2.obj(.scratchpad)
    }
}

[/code]

Is this an issue in the compiler/linker?

Best regards,

  • As additional info:
    I'm using C2000 compiler 6.4.4. The above stated declarations do work for the normal c2000 core sections.
  • In the C28x compiler manual, in the section titled Memory Model - Sections, with regard to the scratchpad section it states ...

    The linker determines which function frames can be overlaid in placement to save memory.

    Your use of UNION and GROUP interferes with this behavior of the linker.  You should have something simple, similar to ...

        .scratchpad > CLA_DRAMLS2 PAGE(DataPage)

    Thanks and regards,

    -George

  • Hi George,

    Thank you for your reply.

    I'm using a dual core micro controller and need to only flash program to CPU1 Flash, zo it's a multicore system with only ONE project build output file.

    From that, through IPC, I'm able to load code, constants, and (pre)initialized memory to CLA1, CPU2 and CLA2 (LOAD=FLASH, RUN=RAM).

    What I'm doing now is:

    Code sections are forced in blocks next to each other by using GROUP { CPU1_code, CPU2_code, CLA1_code, CLA2_code, ...} LOAD=FLASH RUN=RAM

    Initialized data sections forced in blocks next to each other by using GROUP { CPU1_init, CPU2_init, CLA1_init, CLA2_init, ...} LOAD=FLASH RUN=RAM

    The non initialized variables are set to the identical memory locations for CPU1 and CPU2 (incl stack) so I can set this as UNION {CPU1_scratch, CPU2_scratch} RUN=RAM

    And only thing I still need is the CLA scratchpads to be catched in a UNION to use the same and FULL memory on both sides.

    UNION {CLA1_Scratch, CLA2_Scratch} RUN=RAM;

    If I don't do this, the linker will link cla2 scratch-memory after the scratch of cla1.

  • I did notice something regarding your first post ...

    Tjarco Boerkoel said:

    But get the message 10030-D expecting section type (COPY, DSECT, or NOLOAD) instead of ".scratchpad"

    [code]

      UNION (ClaScratchpads) > CLA_DRAMLS2 PAGE(DataPage)
       {     CLA1_main.obj(.scratchpad)
             CLA2_main.obj(.scratchpad)
       }

    [/code]

    The syntax inside that UNION is not correct.  You need to name the output section.  Then, inside braces, list the input section(s) for that output section.  Something similar to ...

    UNION (ClaScratchpads) > CLA_DRAMLS2 PAGE(DataPage)
       {
          scratch1_output_section { CLA1_main.obj(.scratchpad) }
          scratch2_output_section { CLA2_main.obj(.scratchpad) }
       }

    Speaking more generally ... We have no tests for a UNION of CLA scratchpads.  It is not a use case we ever thought to support.  If it turns out not to work, then our likely response will be to document this as a limitation of the linker.

    Thanks and regards,

    -George

  • Hi George,

    Thank you for your reply.

    Yes, indeed! I needed to create 'local' output sections before adding to the UNION section.

     

    UNION (CLAscratches) > CLA_DRAMLS2 PAGE(DataPage)
    {    CLA1scratch  { CLA1_main.obj(.scratchpad)
                      } PALIGN(0x0080),
                        RUN_END(CLAscratch_end)
    
          CLA2scratch  { CLA2_main.obj(.scratchpad)
                       }PALIGN(0x0080),
                        RUN_END(CLA2scratch_end)
    }

    Now builds perfectly!