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.

Refer Linker Sections in C Code

Other Parts Discussed in Thread: TMS320F28377D

Hello,

I am working with the TMS320F28377D Processor / CCS 6.1

I want to refer certain memory sections created in the linker command file directly in the C source code but using their names & not their addresses. This is so that down the line if memory section assignment changes for the project, rest of the source code is not affected,

I believe I would need to edit the linker command file to assign names to memory sections that can be used in the C code & then somehow access that memory location using the assigned name in my source code.

Can someone provide an example code or references for this? 

Thanks,

Jimit Doshi

  • Mr. Doshi,

    This is easy.  In your SECTIONS area, place a declaration like:

    sdram > SDRAM: { _sdramStart = .; }

    This will create a symbol sdramStart that you can reference from C with:

    extern unsigned sdramStart[];

    For documentation see page 183 of SPRU513E.

    Regards,

    Bill Finger

  • Hello Bill,

    Looks like SPRU513 has been updated and we have an "H" version now. It would be great if you could suggest the section heading you are looking at.

    In the meanwhile I am going to try out my code based on your example.

    Thanks!