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.

Placing Library Symbols in RAM on C28x

I'm working with a customer who is using our precompiled USB library for the F28069 device.  The library is compiled so that it does not have any special section attributes.  In other words, it is normally getting linked to run along with the rest of .text out of FLASH.

We want to move some of all of the methods to run from RAM.  Is there any linker magic that can be used to relocate precompiled library methods to run from RAM without having to recompile the library adding "ramfuncs" section attributes?

Thanks,

Stuart

  • Use the method described in the C28x Assembly tools manual section titled Specifying Library or Archive Members as Input to Output Sections.  Add something like this to the linker command file ...

        .rtstext > RAM
        {
            --library=libname.lib<file1.obj file2.obj /* and so on*/ > (.text)
        }

    This presumes your system has the ability to load the initialized section .rtstext directly into RAM.  If it has to be programmed into FLASH, and then copied to RAM prior to execution, then change it to something like this ...

        .rtstext > load=FLASH, run=RAM, table(BINIT)
        {
            --library=libname.lib<file1.obj file2.obj /* and so on*/ > (.text)
        }

    I do not have a system which allows me to test these code examples.  I'm confident they are correct.  However, if you find any errors, please post about them, so they can be corrected.  

    Thanks and regards,

    -George