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.

TMS570LC4357: Sections placement

Part Number: TMS570LC4357

Hello,

Considering the same memory section “FLASH” for “.const” and “.cinit” data, as indicated in the following .cmd instructions :

   .const : {} > FLASH          

   .cinit : {} > FLASH

Is there an placement instruction, to place “.const” at the end of the mapping, after .cinit block, at compilation ?

Best Regards,

  • Hello Adama,

    The directive GROUP forces output sections to be allocated to contiguously and in the order listed.

    For example:

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text : {} > FLASH0
        GROUP > FLASH0
        {
             .const
             .cinit
              .pinit
         }
         bss : {} > RAM
        .data : {} > RAM
        .sysmem : {} > RAM

    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

    And you can allocate the GROUP at a pre-defined address ( for example 0x200000)

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text : {} > FLASH0 
        GROUP  0x00200000
        {
             .const
             .cinit
              .pinit
         }
         bss : {} > RAM
        .data : {} > RAM
        .sysmem : {} > RAM

    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }