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.

TMS320F280039C: Questions about the default loading behavior of FPUmathTables section

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Hi TI experts,

I'm using expf() rts2800_fpu32_fast_supplement.lib on TMS320F280039C and have some questions about the FPUmathTables section behavior.

What I observed

In my project, the CMD file does not configure the FPUmathTables section at all, and I didn't add any manual copy code. However, during debugging, I found that the math tables seem to be automatically copied from ROM to the BOOT_RSVD area (around 0x000002) in RAM.

My questions

1: Is this automatic copy performed by the Boot ROM itself? Or is it done by the linker/startup code? What triggers this behavior?

2: When the CMD file has no configuration at all for FPUmathTables, what is the linker's default handling logic?

3: I'm also getting a linker warning (see details below). How can I properly eliminate it

MEMORY
{
   BEGIN            : origin = 0x00090000, length = 0x00000002
   BOOT_RSVD        : origin = 0x00000002, length = 0x00000126

   RAMM0            : origin = 0x00000128, length = 0x000006D0
//   RAMM0            : origin = 0x00000128, length = 0x000002D8
//   RAMM1            : origin = 0x00000400, length = 0x000003F8
   // RAMM1_RSVD       : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

   RAMLS_CLAprog   	: origin = 0x00008000, length = 0x00002000
   RAMLS4567      	: origin = 0x0000A000, length = 0x00002000

   RAMGS012       	: origin = 0x0000C000, length = 0x00003000
//   RAMGS1           : origin = 0x0000D000, length = 0x00001000
//   RAMGS2           : origin = 0x0000E000, length = 0x00001000
   RAMGS3           : origin = 0x0000F000, length = 0x00000F60
   // RAMGS3_RSVD      : origin = 0x0000FFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

   BOOTROM          : origin = 0x003F8000, length = 0x00007FC0
   SECURE_ROM       : origin = 0x003F2000, length = 0x00006000

   RESET            : origin = 0x003FFFC0, length = 0x00000002

   /* Flash sectors */
   //FLASH_BANK0     : origin = 0x080000, length = 0x10000			//BOOTLOADER AND DATA_STORAGE
   FLASH_BANK1     		: origin = 0x090002, length = 0x0FFDE			//CODE
   //FLASH_BANK2     : origin = 0x0A0000, length = 0x10000			//PROGRAM_BACKUP

   CLA1_MSGRAMLOW   : origin = 0x001480, length = 0x000080
   CLA1_MSGRAMHIGH  : origin = 0x001500, length = 0x000080

   DMA_CPUData_FSIRX	: origin = 0x0000FF60, length = 0x00000020
   DMA_CPUData1	    : origin = 0x0000FF80, length = 0x00000020
   DMA_CPUData2	    : origin = 0x0000FFA0, length = 0x00000020
   DMA_CPUData3	    : origin = 0x0000FFC0, length = 0x00000020
   DMA_CPUData4	    : origin = 0x0000FFE0, length = 0x00000020

   CLA2_MSGRAMLOW   : origin = 0x001680, length = 0x000080
//   CLA2_MSGRAMHIGH  : origin = 0x001700, length = 0x000080
   DMA_Data1	    : origin = 0x001700, length = 0x000020
   DMA_Data2	    : origin = 0x001720, length = 0x000020
   DMA_Data3	    : origin = 0x001740, length = 0x000020
   DMA_Data4	    : origin = 0x001760, length = 0x000020
}


SECTIONS
{
   .cinit           : > FLASH_BANK1, ALIGN(4)
   .text            : >>FLASH_BANK1, ALIGN(4)
   codestart        : > BEGIN, ALIGN(4)

   .stack           : > RAMM0
   .switch          : > FLASH_BANK1, ALIGN(4)

   .init_array      : > FLASH_BANK1,       ALIGN(4)
   .bss             : > RAMLS4567
   .bss:output      : > RAMLS4567
   .bss:cio         : > RAMLS4567
   .data            : > RAMLS4567
   .sysmem          : > RAMLS4567
   .const           : > FLASH_BANK1       ALIGN(4)
   .ebss            : > RAMLS4567
   ramgs           	: > RAMGS3

   .reset           : > RESET,          TYPE = DSECT /* not used, */

   dclfuncs         : > FLASH_BANK1,     ALIGN(4)


    /* CLA specific sections */
    Cla1Prog        : LOAD = FLASH_BANK1,
                      RUN = RAMLS_CLAprog,
                      LOAD_START(Cla1ProgLoadStart),
                      RUN_START(Cla1ProgRunStart),
                      LOAD_SIZE(Cla1ProgLoadSize),
                      ALIGN(4)

   //
   //Load tables to Flash and copy over to RAM
   //
   CLA1mathTables    :  LOAD = FLASH_BANK1,
                        RUN = RAMLS4567,
                        RUN_START(CLA1mathTablesRunStart),
                        LOAD_START(CLA1mathTablesLoadStart),
                        LOAD_SIZE(CLA1mathTablesLoadSize),
                      	ALIGN(4)

   	DMA_CPUData_FSIRXFile : > DMA_CPUData_FSIRX
   	DMA_CPUData1File : > DMA_CPUData1
	DMA_CPUData2File : > DMA_CPUData2
	DMA_CPUData3File : > DMA_CPUData3
	DMA_CPUData4File : > DMA_CPUData4

    Cla1ToCpuMsgRAM  : > CLA1_MSGRAMLOW
    CpuToCla1MsgRAM  : > CLA1_MSGRAMHIGH

    Cla1ToDMAMsgRAM  : > CLA2_MSGRAMLOW
//    DmaToCla1MsgRAM  : > CLA2_MSGRAMHIGH
	DMA_Data1File	 : > DMA_Data1
	DMA_Data2File	 : > DMA_Data2
	DMA_Data3File	 : > DMA_Data3
	DMA_Data4File	 : > DMA_Data4

   GROUP
   {
       .TI.ramfunc
//       { -l UserFunc_LLC.obj(.text)}
//       { -l Com_FSI.obj(.text)}
//       { -l Lib_LLC.obj(.text)}
//       { -l Serial_SCI.obj(.text)}
//       { -l DataStorage_Flash_API.obj(.text)}
//       { -l FAPI_F28003x_EABI_v1.58.10.lib}
       { -l UserFunc_PMSM.obj(.text)}
       { -l Lib_3PPWM.obj(.text)}
       { -l Lib_PMSM_FOC.obj(.text)}
   }             	  LOAD = FLASH_BANK1,
                      RUN = RAMGS012
                      LOAD_START(RamfuncsLoadStart),
                      LOAD_SIZE(RamfuncsLoadSize),
                      LOAD_END(RamfuncsLoadEnd),
                      RUN_START(RamfuncsRunStart),
                      RUN_SIZE(RamfuncsRunSize),
                      RUN_END(RamfuncsRunEnd),
                      ALIGN(4)

   .TI.ramconsts	: LOAD = FLASH_BANK1
   					  RUN = RAMLS4567
               		  RUN_START(Ramconsts_runstart),
               		  LOAD_START(Ramconsts_loadstart),
              		  LOAD_SIZE(Ramconsts_loadsize)

   .scratchpad      : > RAMLS4567
   .bss_cla         : > RAMLS4567

   Cla1DataRam      : > RAMLS4567
   cla_shared       : > RAMLS4567
   CLADataLS1       : > RAMLS4567

   .const_cla      : LOAD = FLASH_BANK1,
                      RUN = RAMLS4567,
                      RUN_START(Cla1ConstRunStart),
                      LOAD_START(Cla1ConstLoadStart),
                      LOAD_SIZE(Cla1ConstLoadSize),
                      ALIGN(4)
}

/*
//===========================================================================
// End of file.
//===========================================================================
*/
<Linking>
"../28003x_cla_flash_lnk.cmd", line 147: warning #10423-D: No placement specified for "FPUmathTables"; a default placement will be applied.
Finished building target: "test.out"

Could you please clarify the mechanism? Thank you! 

  • Hi YuanZe,

    Are you referring to/starting from a particular example from the C2000Ware SDK? If yes, could you please mention the path.

    Thanks,

    Ira

  • Hi,

    I've attached the project as Test_Fast_Supplement_expf.zip for your reference. In this project, the CMD file does not explicitly configure FPUmathTables, and I'm seeing the automatic copy to BOOT_RSVD along with a linker warning.

    Could you please take a look and help clarify the default behavior?

    Thanks,
    YuanZe

    Test_Fast_Supplement_expf.zip

  • Hi YuanZe,

    Sorry for the late reply and thank you for your patience. I went through your project and saw the following observations

    1. the flash_lnk cmd file does not configure any memory location to hold FPUMathTables

    2. In the .map file I can see that FPUMathTables is placed at 0x00000002 and has length 0xbe so it lies in the BOOT_RSVD section

    3. I get a warning saying warning #10247-D: creating output section "FPUmathTables" without a SECTIONS specification

    The linker automatically creates the FPUmathTables output section when any C28 floating‑point math routine is pulled from the run‑time library, and because your linker command file does not contain a placement rule for that section the linker falls back to its default map for the F28003x device, which assigns unspecified sections to the BOOT_RSVD region and hence you see the table at 0x00000002 with a length of 0xBE in the .map file and receive warning #10247‑D (“creating output section ‘FPUmathTables’ without a SECTIONS specification”). To eliminate the warning and control the location, add an explicit SECTIONS entry (e.g.,
    .FPUmathTables : > BOOT_RSVD
    or place it in a user‑defined memory block) or, if you never use floating‑point math, disable the FPU tables by compiling without floating‑point support (e.g., use the “Do not link floating‑point support libraries” option or link against a library set that omits the tables).