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.

Library functions load from Flash to Ram



Hallo, is ther a posibility to load the rts2800_fpu32.lib functions e.g. "sin" from Flash to Ram, as shown in several examples

with the #pragma CODE_SECTION?

I've defined a section called ramfuncs, as shown in several eamples:

ramfuncs                : LOAD = FLASHD,
                            RUN = RAML0,
                            LOAD_START(_RamfuncsLoadStart),
                            LOAD_END(_RamfuncsLoadEnd),
                            RUN_START(_RamfuncsRunStart),
                            PAGE = 0

This works so far, with my own functions, but I've no idea to bring some Lib-Functions during Run-Time from FLASH to RAM.

  • Ralf,

    You should be able to do the same thing you show in your post with the library.  What you do is form a new section from all the library sections you are interested in rellocating.  Each library function is in its own source file, and correspondingly put in its own object file.  These object files are then combined into the single .lib file.  Each function typically is just compiled into the .text section as I don't think any CODE_SECTION pragmas are used in the library source.  So, what you can do is form a new section from the .text sections in the object files of interest.

    For example, just suppose I wanted sin and cos to be copied to RAM.  These are in source files sin.c and cos.c, and correspondingly end up in object files sin.obj and cos.obj.  I would do this in the linker .cmd file:

    .text1 : LOAD = FLASH,
             RUN = RAM,
             LOAD_START(_text1LoadStart),
             LOAD_END(_text1LoadEnd),
             RUN_START(_text1RunStart),
             PAGE = 0
             {
                 -l rts2800_fpu32.lib <sin.obj> (.text)
                 -l rts2800_fpu32.lib <cos.obj> (.text)
             }

     

    The above memory, LOAD/RUN label names, and .text1 names are just my example.  You can call them whatever you want.  I think you can see what I'm doing.

    Regards,

    David 

  • David,

    thank you for your help, that's what I've nearly found out, when reading the assembler hand-book!

    Now I'will see where to get from the source code of my LIB-functions!

    Ralf