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.

TMS320F28388D: ALIGN(4) vs. ALIGN(8) in cmd files

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hi Champs,

I know Flash data needs to be 64 bit aligned due to ECC generation.  So C2000 devices that has ECC feature like F2804x and F2837x used ALIGN(4) in cmd files. However, in the recent C2000Ware, ALIGN(8) is using in F2837x, F2838x and F28002x. 

Does this have anything to do with EABI? If not, why ALIGN value was changed from (4) to (8)? 

One more odd thing is that  "iddk_servo_2838x_flash_lnk_cpu1.cmd" file in MotorControl SDK uses both ALIGN(4) and ALIGN(8) as following. Is there any reason about this different ALIGN value should be used according to sections?

SECTIONS
{
  codestart : > BEGIN, ALIGN(4)
  .text : >> FLASH1 | FLASH2 | FLASH3 | FLASH4, ALIGN(4)
  .cinit : > FLASH5, ALIGN(4)
  .switch : > FLASH1, ALIGN(4)
  .reset : > RESET, TYPE = DSECT /* not used, */
  .stack : > RAMM1

#if defined(__TI_EABI__)
  .init_array : > FLASH6, ALIGN(8)
  .bss : > RAMLS6 | RAMLS7
  .bss:output : > RAMLS6 | RAMLS7
  .bss:cio : > RAMLS6 | RAMLS7 
  .data : > RAMLS6 | RAMLS7
  .sysmem : > RAMLS6 | RAMLS7
/* Initalized sections go in Flash */
  .const : > FLASH6, ALIGN(8)
#else
  .pinit : > FLASH6, ALIGN(8)
  .ebss : > RAMLS6 | RAMLS7
  .esysmem : > RAMLS6 | RAMLS7
  .cio : > RAMLS6 | RAMLS7
/* Initalized sections go in Flash */
  .econst : >> FLASH4 | FLASH5, ALIGN(4)
#endif

  • Steve,

    For C28x: We suggest ALIGN(8) everywhere.  This aligns the section start address to be on 128-bit aligned address.  Flash wrapper can program 128-bits at once.  To take advantage of this, many 3rd party tools and TI's flash kernels stream 128-bit data.  These tools may ignore upper 64-bits if the lower 64-bits of a 128-bit data segment is all 1s or partially ones (LSBs).  Hence, we suggest to align everything using ALIGN(8).

    I will file a ticket to fix "iddk_servo_2838x_flash_lnk_cpu1.cmd".  Thank you for bringing this to our notice.

    Thanks and regards,
    Vamsi

  • Vamsi,

    Thanks for your quick answer.

    One more note is all cmd files for F28004x still use ALIGN(4) in the recent C2000Ware. If ALIGN(8) is recommended for all Gen3 C2000 devices as you mentioned, I hope all cmd files are updated with ALIGN(8) in the next coming C2000Ware. 

    Regards,

    Steve

  • Steve,

    These changes will be prioritized for Q1 2021 release and not the 4Q 2020 release.

    Thanks and regards,

    Vamsi