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.

MSPM0G1507: Regarding the format of the linker command file

Guru 14700 points

Part Number: MSPM0G1507

Hi,

We are using MSPM0G1507SPTR. We are considering implementing our own memory initialization in the startup code instead of relying fully on _c_int00().

In the linker command file, we tried to use LOADADDR(.data) to get the FLASH load address of the .data section, but it caused a linker error.

Our understanding is that LOADADDR() is GCC linker script syntax and cannot be used in a TI linker command file.
For TI linker command files, should we use LOAD_START(), RUN_START(), RUN_END(), etc. instead?

For example, is the following approach correct?

.data : palign(8)
{
    *(.data)
    *(.data.*)
} load = FLASH, run = SRAM,
  LOAD_START(_sidata),
  RUN_START(_sdata),
  RUN_END(_edata)

.bss : palign(8)
{
    *(.bss)
    *(.bss.*)
} run = SRAM,
  RUN_START(_sbss),
  RUN_END(_ebss)

In this case, we plan to copy .data from _sidata to _sdata–_edata and clear .bss from _sbss to _ebss in our startup code. Could you please confirm if this understanding is correct?

Thanks,
Conor

  • Do you have any update?

  • Hi Connor, yes, your understanding is correct. Since you are using the TI Arm Clang linker, the GCC-specific LOADADDR() function is not supported. Your proposed approach using built-in link operators is the standard way to retrieve these addresses for custom startup routines. I would recommend looking at this to make sure your compliant with your custom memory initialization. Hope this helps!

    -Brian