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.

Accessing FPU Math tables from RAM in assembly programming

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I am using f28335 experimenters kit (TMDSDOCK28335) for my development. I am doing my development in assembly language and in this situation trying to access the FPU Math tables.

The FPU Math tables are stored in Boot ROM which are copied into RAM (if loaded) in run time. While it would be simple for me to reference the memory address of the FPU tables in Boot ROM to perform my operations, this is undesirable. I want to access the FPU tables from the copied memory location in the RAM which I am thinking varies with compilation. 

Is there any way to store the memory address of the copied FPU tables in RAM in a different variable and use this variable to perform my operations in assembly language? 

Thanks.

  • Hi,

    These tables are part of the FPU fast RTS library. So what you could do is include the rts2800_fpu32_fast_supplement.lib library in your project to get access to the table symbols. Now, since the tables are already in ROM, you dont want to load them again you would define the FPUMathTables section in the linker command as follows (see C:\ti\controlSUITE\libs\math\FPUfastRTS\V100\examples_ccsv4\cmd\28335_fastRTS_lnk.cmd)

     FPUmathTables    : LOAD = FPUTABLES, 
                        RUN  = RAML0,
                        LOAD_START(_FPUmathTablesLoadStart),
                        RUN_START(_FPUmathTablesRunStart),
                        LOAD_SIZE(_FPUmathTablesLoadSize),
                        PAGE = 0, TYPE = NOLOAD

    In main.c you define three extern variables

    extern uint32_t FPUmathTablesLoadStart, FPUmathTablesRunStart, FPUmathTablesLoadSize

    and then use these three variables to memcpy the tables from ROM to RAM at runtime. In your assembly code you would have to .ref the table you want to access. For example, the sine table

        .ref _FPUsinTable
    _functionA:
        MOVW  DP, #_FPUsinTable     ; set the data page pointer to the right page
        MOV32 R0H, @_FPUsinTable    ; access first entry of the sine table