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.

IQmathTablesRam: where they come from if they not in ROM Table?

IQmathTablesRam: where they come from if they not in ROM Table?

In linker command file...... it LOAD the table into RAML1 but does not appear to come from ROM, why?

IQmathTablesRam     : > RAML1,      PAGE = 1


Can it be placed in FLASH instead (FLASHA)?

  • richard payne said:

    In linker command file...... it LOAD the table into RAML1 but does not appear to come from ROM, why?

    IQmathTablesRam     : > RAML1,      PAGE = 1

    IQmathTablesRam are built into the ".lib" file - its used by IQasin, IQacos, and IQexp

    The tables in ROM are for division, IQsin, IQcos, IQatan, IQatan2

    richard payne said:
    Can it be placed in FLASH instead (FLASHA)?

    yes you can, but for speed its better to copy over to RAM as follows:

    1. in the linker command file, declare the section as

    IQmathTablesRam: LOAD = FLASHA, 
                     RUN  = RAML0, 
                     LOAD_START(_IQmathTablesRamLoad),
                     RUN_START(_IQmathTablesRamRun),
                     LOAD_SIZE(_IQmathTablesRamSize),
                     PAGE = 0

    2. in main.c, declare

    #include <string.h>
    
    extern uint16_t IQmathTablesRamLoad, IQmathTablesRamRun, IQmathTablesRamSize ;
    
    memcpy((uint16_t *)&IQmathTablesRamRun, (uint16_t *)&IQmathTablesRamLoad, (uint16_t)&IQmathTablesRamSize);