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.

Linker command file issue for TMS320F28377D

Other Parts Discussed in Thread: TMS320F28377D

Hi,

I am facing issue when non DSP BIOS project linking. 

Hardware TMS320F28377D Control Card and Compiler CCSV 6.2.5

 

In linked.cmd file I added overlay sections with same run address. And run address is 0x00008000.

 

SECTIONS

{

   UNION              : RUN = SRAM_L0_LOADABLE_RAM,

                        RUN_START(_RamTaskRunStart)

                        RUN_START(_RamTask)

                        RUN_END(_RamTaskRunEnd)

                        PAGE = 0

       {

 

              Sect_Ram_ReadTask:    LOAD = CBB_FLASHB,                          // Load address from flash

                                   LOAD_START(_Sect_Ram_ReadTaskLoadStart),

                                   LOAD_END(_Sect_Ram_ReadTaskLoadEnd)

 

              Sect_Ram_WriteTask:   LOAD = CBB_FLASHB,

                                   LOAD_START(_Sect_Ram_WriteTaskLoadStart),

                                   LOAD_END(_Sect_Ram_WriteTaskLoadEnd)

       }

}

 

 

 

And in application following #pragmas have been added

 

#pragma CODE_SECTION(Ram_ReadTask,"Sect_Ram_ReadTask");

void Ram_ReadTask(void)

{

       //Added customized memcopy function.

 

}

#pragma CODE_SECTION(Ram_WriteTask,"Sect_Ram_WriteTask");

void Ram_WriteTask(void)

{

       //Added customized memcopy function.

}

 

 

I observed in map file

 

Sect_Ram_ReadTask

*          0    00008000    00000000     UNINITIALIZED

 

Sect_Ram_WriteTask

*          0    00008000    00000000     UNINITIALIZED

 

For both the sections origin address is “0x00008000”, but origin should be any address from FLASH.

Due to this it shows above mentioned sections are uninitialized.

 

Could you please provide me solution for above mentioned problem.

 

Thanks and Regards,

Gajendra Ghate

  • Gajendra,

    I'm not sure what is wrong with your project, but I made a bogus test case and copied your linker .cmd syntax, and things seem to work.

    UNION : RUN = L0123SARAM, PAGE = 0
    RUN_START(_secureRamFuncs_runstart)
    {
    secureRamFuncs : LOAD = FLASH_ABCDEFGH, PAGE = 0
    LOAD_START(_secureRamFuncs_loadstart),
    LOAD_SIZE(_secureRamFuncs_loadsize)

    secureRamFuncs2 : LOAD = FLASH_ABCDEFGH, PAGE = 0
    LOAD_START(_secureRamFuncs2_loadstart),
    LOAD_SIZE(_secureRamFuncs2_loadsize)
    }

    and the .map file looks correct:

    secureRamFuncs
    * 0 003008cf 0000001f RUN ADDR = 00008000
    003008cf 0000001f Flash.obj (secureRamFuncs)

    secureRamFuncs2
    * 0 003008ee 0000001f RUN ADDR = 00008000
    003008ee 0000001f Flash.obj (secureRamFuncs2)

    I used compiler v6.2.5, same as you.  Incidentally, that is an old compiler to be using on F28377D.  I suggest that you update to the latest compiler, v6.4.4 (although that doesn't seem to be the problem you are having here).

    The syntax I use above is just slightly different from what you are using, but I played around with it and that doesn't seem to be the issue either.  I've attached my test project.  This is a CCSv6.1.0 project (the latest released CCS).  It is also for the F28335 device, but again that doesn't matter.  Again, remember this is a made up example.  I just duplicated an existing function/section that was copied from flash to RAM, and created the union.  It is for testing the codegen tools.

    Regards,

    David

    F28335_example_nonBIOS_flash.zip

  • David,
    Thank you.
    I have also done one dummy project, where called direct function below # pragma.
    Prior to that i have done memcpy() while initilisation.
    The above scenario is working fine.

    But my intension is diffrent.
    Actually i want overlay in linker cmd file, with load address from flash and run address from RAM.
    I declared it in linker cmd file.
    In my code,
    I typecast the run symbol in my code as a function pointer and called typecasted function.
    While debugging the code, I found my load and run adress is same this effectively give me length to be copied to ram is "0".
    The upper process is runtime process.
    My intensionis to get load address from Flash and Run address from RAM, but due to runtime address calculation linker will set the mentioned sections uninitilized.
    Do you have any idea about this problem?

    Thanks in advance.
  • Gajendra,

    Since you're using a function pointer, it sounds like maybe the compiler/linker is removing the functions from the build because it doesn't see anything calling them in the code. You can use the RETAIN pragma to force keeping the functions. For example:

    #pragma RETAIN(foo);
    #pragma CODE_SECTION(foo, "MySection");
    void foo(void)
    {
    }

    The RETAIN pragma is documented in the Compiler User's Guide, SPRU514H, p.117.

    - David
  • David,

    Thank you.

    Your suggetion is working as per my requirement.

    And i also found one solution for the same.

    In project properties below c2000 linker, there is a button to set additional flags where i added --disable_clink or -j  in project properties.

    Which does same work as i was intending.

    And now with 1. #pragma RETAIN() or 2. --disable_clink, my code is working fine.

    Thank you again.