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.

IQMath run from RAM



I am running out of flash, but need to run IQ Math functions to RAM.   I added the following to my code:

#pragma CODE_SECTION(_IQ24div, "ramfuncs");

I am using other functions I wrote in RAM, and use a similar pragma for them, and they are copied without issue to RAM.

I check the map file, and the functions are still located in FLASH with a section of IQMath.  
My liner file has the following:

ramfuncs          : LOAD = APP_FLASH, 

                       RUN = progRAM, 

                       LOAD_START(_RamfuncsLoadStart1),

                       LOAD_END(_RamfuncsLoadEnd1),

                       RUN_START(_RamfuncsRunStart1),

                       PAGE = 0

 

   IQmath            : > APP_FLASH      PAGE = 0    

Do I need to create another load function for this specifically, or should the #pragma CODE_SECTION(_IQ24div, "ramfuncs"); work?

I am interested in copying only specific IQLib functions.  I am able to load ALL IQLib functions, which is not what I need.
  • Hi Tom,

    here is my solution:

    linker command file:

    SECTIONS
    {
    /* IQ MATH FUNCTIONS */
        IQmath:             LOAD = P_L01,
                            LOAD_START(_IQfuncsLoadStart),
                            LOAD_END(_IQfuncsLoadEnd),
                            RUN_START(_IQfuncsRunStart),
                            PAGE = 0

    header file:

    extern Uint16 IQfuncsLoadStart;
    extern Uint16 IQfuncsLoadEnd;
    extern Uint16 IQfuncsRunStart;

    source code, initialization routine

    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

     

    Hope it helps

    Cheers, Mitja

  • Thanks, this does work.  But is there a way to only put specific functions in RAM?  The above method will copy any IQLib function used into RAM, and this can be large.

     

    Tom

  • Tom,

    tom prohaszka said:

    Thanks, this does work.  But is there a way to only put specific functions in RAM?  The above method will copy any IQLib function used into RAM, and this can be large.

     

    Tom

    You can pull different .obj files from a library into different sections.  This is shown in www.ti.com/lit/spru513

    You can examine the .map file to see what the .obj file names are for different functions.

    Cheers

    Lori

     

  • Hi Tom,

    To achieve what you want the library should be compiled by TI with each function in its own section. I seem to recall that this was done, but I don't remember which library (maybe IQmath, or C run time support or floating point or, ...) or if it was even by TI. It is certainly worth to check out the documentation and release changes.

    Cheers, Mitja