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.

TMS320F28069M: Is there an IQmath library for 'F2806xM Devices?

Part Number: TMS320F28069M
Other Parts Discussed in Thread: C2000WARE, MOTORWARE

I'm trying to use the IQmath library from C2000ware v1.00.06.00 with TMS320F28069M and I'm having trouble. Is this library compatible with the 'F28069M device? If not, is there another version of the library that can be used with that device?

I'm testing with the 28069_IQsampleC example project but I updated the linker command file with the '28069M ROM addresses from the TRM for the IQTables regionss. However, the IQ function calls are still not linking to the correct addresses, causing problems at runtime. After debugging this further I think the library has hardcoded "abs" addresses for certain function symbols. For example see the address of the __IQ24mag function in the screenshot below from the map. I am attaching my linker command file and map file for your reference.

/*
//###########################################################################
//
// FILE:    28069_IQmath_lnk.cmd
//
// TITLE:   Linker Command File For IQmath examples that run out of RAM
//
// NOTE; The example project uses memory protected by the
//       Code Security Module (CSM).  Make sure the CSM is
//       unlocked before you load the project.  One quick way
//       to do this on an erased device is to open a memory
//       window to the CSM password locations.  If these locations
//       read back 0xFFFF (or non-zero), then the CSM is unlocked:
//
//      Device    Password locations
//      28027:    0x3F7FF8 - 0x3F7FFF
//
//
//###########################################################################
// $TI Release: C28x IQmath Library v1.60.01.00 $
// $Release Date: Thu Oct 18 15:53:01 CDT 2018 $
// $Copyright: Copyright (C) 2014-2018 Texas Instruments Incorporated -
//             http://www.ti.com/ ALL RIGHTS RESERVED $
//###########################################################################
*/


MEMORY
{
PAGE 0 :

   /* IQTABLES, IQTABLES2 and IQTABLES3 are part of the boot ROM.
      The boot ROM is available in both program or
      data space so this can be defined on page 0 or page 1
   */

   IQTABLES   : origin = 0x3FDC30, length = 0x000b50
   IQTABLES2  : origin = 0x3FE780, length = 0x00008C
   IQTABLES3  : origin = 0x3FE80C, length = 0x0000AA
   BEGIN      : origin = 0x000000, length = 0x000002
   RAMM0      : origin = 0x000002, length = 0x0003FE
   RAML0      : origin = 0x008000, length = 0x000800
   RAML3      : origin = 0x009000, length = 0x001000
   RESET      : origin = 0x3FFFC0, length = 0x000002


PAGE 1 :

   RAML1L2   : origin = 0x008800, length = 0x000800
   BOOT_RSVD : origin = 0x000400, length = 0x000080     /* Part of M1, BOOT rom will use this for stack */
   RAMM1     : origin = 0x000480, length = 0x000380     /* on-chip RAM block M1 */
}


SECTIONS
{

   /* IQmath inclues the assembly routines in the IQmath library
      IQmathTables is used by division, IQsin, IQcos, IQatan, IQatan2
                   this is in boot ROM so we make it NOLOAD.  Using
                   the ROM version saves space at the cost of 1 cycle
                   per access (boot ROM is 1 wait).
      IQmathTablesRam is used by IQasin, IQacos, and IQexp
      Noticed these tables are linked seperatly since they are from
      two source files within the library.
   */
   IQmath           : > RAML3,      PAGE = 0
   IQmathTables     : > IQTABLES,   PAGE = 0, TYPE = NOLOAD
   IQmathTables2    : > IQTABLES2,  PAGE = 0, TYPE = NOLOAD
   {
        IQmath_fpu32.lib<IQNexpTable.obj> (IQmathTablesRam)
   }
   IQmathTables3    :> IQTABLES3,   PAGE = 0, type = NOLOAD
   {
       IQmath_fpu32.lib<IQNasinTable.obj> (IQmathTablesRam)
   }


   codestart        : > BEGIN,      PAGE = 0
   ramfuncs         : > RAMM0       PAGE = 0
   .text            : > RAML0,      PAGE = 0
   .cinit           : > RAMM0,      PAGE = 0
   .pinit           : > RAMM0,      PAGE = 0
   .switch          : > RAMM0,      PAGE = 0
   .reset           : > RESET,      PAGE = 0, TYPE = DSECT /* not used, */

   .stack           : > RAMM1,      PAGE = 1
   .cio             : > RAML1L2,    PAGE = 1
   .ebss            : > RAML1L2,    PAGE = 1
   .econst          : > RAML1L2,    PAGE = 1
   .sysmem          : > RAML1L2,    PAGE = 1





}

/*
//===========================================================================
// End of file.
//===========================================================================
*/
******************************************************************************
             TMS320C2000 Linker PC v18.1.3                     
******************************************************************************
>> Linked Tue Dec 18 16:44:00 2018

OUTPUT FILE NAME:   <28069_IQsampleC.out>
ENTRY POINT SYMBOL: "code_start"  address: 00000000


MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
PAGE 0:
  BEGIN                 00000000   00000002  00000002  00000000  RWIX
  RAMM0                 00000002   000003fe  0000001f  000003df  RWIX
  RAML0                 00008000   00000800  000002d1  0000052f  RWIX
  RAML3                 00009000   00001000  000001c5  00000e3b  RWIX
  IQTABLES              003fdc30   00000b50  00000000  00000b50  RWIX
  IQTABLES2             003fe780   0000008c  00000000  0000008c  RWIX
  IQTABLES3             003fe80c   000000aa  00000000  000000aa  RWIX
  RESET                 003fffc0   00000002  00000000  00000002  RWIX

PAGE 1:
  BOOT_RSVD             00000400   00000080  00000000  00000080  RWIX
  RAMM1                 00000480   00000380  00000190  000001f0  RWIX
  RAML1L2               00008800   00000800  000003ce  00000432  RWIX


SECTION ALLOCATION MAP

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
IQmath     0    00009000    000001c5     
                  00009000    0000009d     IQmath_fpu32.lib : IQ24log.obj (IQmath)
                  0000909d    00000088                      : IQ24atan2PU.obj (IQmath)
                  00009125    00000052                      : IQ24asin.obj (IQmath)
                  00009177    0000003d                      : IQ24exp.obj (IQmath)
                  000091b4    00000011                      : IQ24mpyI32int.obj (IQmath)

codestart 
*          0    00000000    00000002     
                  00000000    00000002     CodeStartBranch.obj (codestart)

.cinit     0    00000002    0000001f     
                  00000002    0000000e     rts2800_fpu32.lib : exit.c.obj (.cinit)
                  00000010    00000005     IQsampleSmall.obj (.cinit)
                  00000015    00000005     rts2800_fpu32.lib : _lock.c.obj (.cinit:__lock)
                  0000001a    00000005                       : _lock.c.obj (.cinit:__unlock)
                  0000001f    00000002     --HOLE-- [fill = 0]

.text      0    00008000    000002d1     
                  00008000    0000012b     IQsampleSmall.obj (.text)
                  0000812b    00000083     rts2800_fpu32.lib : fd_mpy28.asm.obj (.text)
                  000081ae    00000056                       : boot28.asm.obj (.text)
                  00008204    00000029                       : exit.c.obj (.text)
                  0000822d    00000024                       : cpy_tbl.c.obj (.text)
                  00008251    0000001f                       : fd_tol28.asm.obj (.text)
                  00008270    0000001d                       : memcpy.c.obj (.text)
                  0000828d    00000019                       : args_main.c.obj (.text)
                  000082a6    00000017                       : u_tofd28.asm.obj (.text)
                  000082bd    00000009                       : _lock.c.obj (.text)
                  000082c6    00000008     CodeStartBranch.obj (.text)
                  000082ce    00000002     rts2800_fpu32.lib : pre_init.c.obj (.text)
                  000082d0    00000001                       : startup.c.obj (.text)

.pinit     0    00000002    00000000     UNINITIALIZED

.reset     0    003fffc0    00000002     DSECT
                  003fffc0    00000002     rts2800_fpu32.lib : boot28.asm.obj (.reset)

.stack     1    00000480    00000190     UNINITIALIZED
                  00000480    00000190     --HOLE--

.ebss      1    00008800    000003ca     UNINITIALIZED
                  00008800    000003c0     IQsampleSmall.obj (.ebss)
                  00008bc0    00000006     rts2800_fpu32.lib : exit.c.obj (.ebss)
                  00008bc6    00000002                       : _lock.c.obj (.ebss:__lock)
                  00008bc8    00000002                       : _lock.c.obj (.ebss:__unlock)

.econst    1    00008bca    00000004     
                  00008bca    00000004     IQsampleSmall.obj (.econst)

MODULE SUMMARY

       Module                code   initialized data   uninitialized data
       ------                ----   ----------------   ------------------
    .\
       IQsampleSmall.obj     299    9                  960               
       CodeStartBranch.obj   10     0                  0                 
    +--+---------------------+------+------------------+--------------------+
       Total:                309    9                  960               
                                                                         
    C:/TI/c2000/C2000Ware_1_00_06_00/libraries/math/IQmath/c28/lib/IQmath_fpu32.lib
       IQ24log.obj           157    0                  0                 
       IQ24atan2PU.obj       136    0                  0                 
       IQ24asin.obj          82     0                  0                 
       IQ24exp.obj           61     0                  0                 
       IQ24mpyI32int.obj     17     0                  0                 
    +--+---------------------+------+------------------+--------------------+
       Total:                453    0                  0                 
                                                                         
    C:/TI/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/lib/rts2800_fpu32.lib
       fd_mpy28.asm.obj      131    0                  0                 
       boot28.asm.obj        86     0                  0                 
       exit.c.obj            41     14                 6                 
       cpy_tbl.c.obj         36     0                  0                 
       fd_tol28.asm.obj      31     0                  0                 
       memcpy.c.obj          29     0                  0                 
       args_main.c.obj       25     0                  0                 
       _lock.c.obj           9      10                 4                 
       u_tofd28.asm.obj      23     0                  0                 
       pre_init.c.obj        2      0                  0                 
       startup.c.obj         1      0                  0                 
    +--+---------------------+------+------------------+--------------------+
       Total:                414    24                 10                
                                                                         
       Stack:                0      0                  400               
    +--+---------------------+------+------------------+--------------------+
       Grand Total:          1176   33                 1370              


GLOBAL DATA SYMBOLS: SORTED BY DATA PAGE

address     data page           name
--------    ----------------    ----
00000480      12 (00000480)     __stack

00008800     220 (00008800)     _GlobalQ
00008802     220 (00008800)     _Step

00008840     221 (00008840)     _Dlog

00008bc0     22f (00008bc0)     ___TI_enable_exit_profile_output
00008bc2     22f (00008bc0)     ___TI_cleanup_ptr
00008bc4     22f (00008bc0)     ___TI_dtors_ptr
00008bc6     22f (00008bc0)     __lock
00008bc8     22f (00008bc0)     __unlock


GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 

page  address   name                            
----  -------   ----                            
0     00008000  .text                           
0     00008204  C$$EXIT                         
0     0000812b  FD$$MPY                         
0     00008251  FD$$TOL                         
0     000082a6  U$$TOFD                         
1     00008840  _Dlog                           
1     00008800  _GlobalQ                        
abs   003feadc  _IQasinTable                    
abs   003fe724  _IQatan2HalfPITable             
abs   003fe762  _IQatan2Table                   
abs   003fe410  _IQdivTable                     
abs   003feac8  _IQexpTableCoeff                
abs   003fea50  _IQexpTableMinMax               
1     00008802  _Step                           
0     00009125  __IQ24asin                      
0     0000909d  __IQ24atan2PU                   
abs   003fef83  __IQ24div                       
0     00009177  __IQ24exp                       
0     00009000  __IQ24log                       
abs   003fee35  __IQ24mag                       
0     000091b4  __IQ24mpyI32int                 
abs   003ff2c2  __IQ24sin                       
abs   003ff1ec  __IQ29sqrt                      
1     00000610  __STACK_END                     
abs   00000190  __STACK_SIZE                    
1     00008bc2  ___TI_cleanup_ptr               
1     00008bc4  ___TI_dtors_ptr                 
1     00008bc0  ___TI_enable_exit_profile_output
abs   ffffffff  ___TI_pprof_out_hndl            
abs   ffffffff  ___TI_prof_data_size            
abs   ffffffff  ___TI_prof_data_start           
abs   ffffffff  ___binit__                      
abs   ffffffff  ___c_args__                     
0     00000002  ___cinit__                      
0     000082d1  ___etext__                      
abs   ffffffff  ___pinit__                      
0     00008000  ___text__                       
0     0000828d  __args_main                     
1     00008bc6  __lock                          
0     000082c5  __nop                           
0     000082c1  __register_lock                 
0     000082bd  __register_unlock               
1     00000480  __stack                         
0     000082d0  __system_post_cinit             
0     000082ce  __system_pre_init               
1     00008bc8  __unlock                        
0     00008204  _abort                          
0     000081ae  _c_int00                        
0     0000822d  _copy_in                        
0     00008206  _exit                           
0     00008000  _main                           
0     00008270  _memcpy                         
abs   ffffffff  binit                           
0     00000002  cinit                           
0     00000000  code_start                      
0     000082d1  etext                           
abs   ffffffff  pinit                           


GLOBAL SYMBOLS: SORTED BY Symbol Address 

page  address   name                            
----  -------   ----                            
0     00000000  code_start                      
0     00000002  ___cinit__                      
0     00000002  cinit                           
0     00008000  .text                           
0     00008000  ___text__                       
0     00008000  _main                           
0     0000812b  FD$$MPY                         
0     000081ae  _c_int00                        
0     00008204  C$$EXIT                         
0     00008204  _abort                          
0     00008206  _exit                           
0     0000822d  _copy_in                        
0     00008251  FD$$TOL                         
0     00008270  _memcpy                         
0     0000828d  __args_main                     
0     000082a6  U$$TOFD                         
0     000082bd  __register_unlock               
0     000082c1  __register_lock                 
0     000082c5  __nop                           
0     000082ce  __system_pre_init               
0     000082d0  __system_post_cinit             
0     000082d1  ___etext__                      
0     000082d1  etext                           
0     00009000  __IQ24log                       
0     0000909d  __IQ24atan2PU                   
0     00009125  __IQ24asin                      
0     00009177  __IQ24exp                       
0     000091b4  __IQ24mpyI32int                 
1     00000480  __stack                         
1     00000610  __STACK_END                     
1     00008800  _GlobalQ                        
1     00008802  _Step                           
1     00008840  _Dlog                           
1     00008bc0  ___TI_enable_exit_profile_output
1     00008bc2  ___TI_cleanup_ptr               
1     00008bc4  ___TI_dtors_ptr                 
1     00008bc6  __lock                          
1     00008bc8  __unlock                        
abs   00000190  __STACK_SIZE                    
abs   003fe410  _IQdivTable                     
abs   003fe724  _IQatan2HalfPITable             
abs   003fe762  _IQatan2Table                   
abs   003fea50  _IQexpTableMinMax               
abs   003feac8  _IQexpTableCoeff                
abs   003feadc  _IQasinTable                    
abs   003fee35  __IQ24mag                       
abs   003fef83  __IQ24div                       
abs   003ff1ec  __IQ29sqrt                      
abs   003ff2c2  __IQ24sin                       
abs   ffffffff  ___TI_pprof_out_hndl            
abs   ffffffff  ___TI_prof_data_size            
abs   ffffffff  ___TI_prof_data_start           
abs   ffffffff  ___binit__                      
abs   ffffffff  ___c_args__                     
abs   ffffffff  ___pinit__                      
abs   ffffffff  binit                           
abs   ffffffff  pinit                           

[57 symbols]

  • Hi,

    I will look into this issue and get back to you by tomorrow.

    Thanks,
    Sira
  • Hi,

    I see the issue you are mentioning. The IQMath tables (and possibly the selected IQMath functions) in the BOOT ROM are located at different locations between the 28069 and 28069M device, yet when the example project is built, I see the locations of the IQMath tables and these selected IQMath functions are identical between the 2 devices.

    I suspect this is occurring because the project links to an IQMath Boot ROM symbol library (2806x_IQmath_BootROMSymbols_fpu32.lib) that tells it where it can find the tables and selected functions. This library is located at

    C:\ti\c2000\C2000Ware_1_00_06_00\libraries\boot_rom\f2806x\v1_1\rom_symbol_libs\IQmath

    I tried to check how this library file is built, and think the corresponding source is present at
    C:\ti\c2000\C2000Ware_1_00_06_00\libraries\boot_rom\f2806x\v1_1\rom_sources

    I launched this project (2806x_boot_rom) in CCS, but building it results in errors (error: cannot find file
    "Flash2806x_API_V100.lib"). However, if you expand the project view and expand "lnk", you will see the file TMS320x2806x_boot_rom_lnk.cmd, which contains the locations of the IQMath tables. I believe this is where the corresponding addresses of the 28069M device will have to be entered, and the library rebuilt in order to generate the necessary effect.

    I will investigate how to build this Boot ROM symbols library.

    IQTABLES : origin = 0x3FDF00, length = 0x000b50
    IQTABLES2 : origin = 0x3FEA50, length = 0x00008C
    IQTABLES3 : origin = 0x3FEADC, length = 0x0000AA

    Thanks,
    Sira
  • Sira,

    Thank you for the quick and helpful reply. Before posting this I tried the E2E search engine and didn't find anything, but afterwards I searched with google and found several similar E2E posts. This post in particular points out that the symbols library from motorware 1-01-00-18 is properly built for 'F28069M. I'll try this and will report back.

    Ruben

  • Ruben,

    Thank you for the update. Please do follow up, and if your issue is resolved, please do click on "Verified Answer" so the issue is closed.

    Thanks,
    Sira
  • This problem is resolved when using the 2806xRevB_IQmath_BootROMSymbols_fpu32.lib from motorware 1-01-00-18. The library is located at this path: C:\TI\motorware\motorware_1_01_00_18\sw\modules\fast\lib\32b\f28x\f2806x

    Thanks