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.

Compiler/TMS320F28379D: Question about the Flash programming and Fast FPU supplement

Part Number: TMS320F28379D
Other Parts Discussed in Thread: TMS320F28335, , C2000WARE, CONTROLSUITE, SFRA

Tool/software: TI C/C++ Compiler

Hi, there

I am migrating from TMS320F28335 to TMS320F28379D recently. Here's two question I have:

1st question is related to flash programming. I see some examples for the 28379D flash programming through C2000Ware device support. However, are there some documents available explain better how to do the FLASH API for TMS320F28379D? I know the TMS320F28335 has document talk about that.

2nd. I am trying to implement the fast FPU supplement math library like I did with the TMS320F28335. Here's what I have in the cmd file, section definition:

FASTRTS_LIBRARY:
{
       -l rts2800_fpu32_fast_supplement.lib(.econst)
       -l rts2800_fpu32_fast_supplement.lib(.text)
 }     LOAD = FLASHG,
     RUN = RAMD0_1,
     LOAD_START(_FastRTSLoadStart),
     LOAD_END(_FastRTSLoadEnd),
     RUN_START(_FastRTSRunStart),
     PAGE = 0

I keep get warnings "10068-D no matching section" even I do make sure I included the lib file and the path. Do you know why? Does the fast supplement FPU apply to  TMS320F28379D  too? Are there document talking about this?

Thanks

  • HI,

    1. If you have controlSUITE installed, flash API docs should be here c:\ti\controlSUITE\device_support\F2837xD\v210\doc\FlashAPI_Doc

    There should be similar path to C2000Ware


    2. There's no need to copy FPU supplement to RAM, you may just add this lib to linker search list.
    "10068-D no matching section" message must refer to non existing RAMD0_1. CCS default *.cmd file for 28379 doesn't list such section. I guess you meant RAMD0?

    Edward
  • Hi, Edward

    For the first one, I find the document, thank you

    For the second question, I combined RAMD0 and RAMD1 together to be RAMD0_1, I even tried RAMG6, still get the same warning. So, I think it is something else.

    My question here is, if I only add the lib to linker search list. How do I know it has been used since I couldn't find anything in the .map file shows the FPU supplement. And if I don't copy it to RAM, it is running from flash, will it get significantly slowed down?

  • Hainan,

    I noticed you referred to C2000Ware for Flash programming example - which is good.  

    Instead of Controlsuite (obsolete for F2837xD), please refer to C2000Ware for Flash API documentation as well:  \C2000Ware_1_00_05_00\libraries\flash_api\f2837xd\docs.

    Also note we have a Flash API wiki at http://processors.wiki.ti.com/index.php/C2000_Flash_FAQ .

    For your Flash execution performance question for the rts library, see below snippet from datasheet if that helps you:

    The on-chip flash memory is tightly integrated to the CPU, allowing code execution directly from flash through 128-bit-wide prefetch reads and a pipeline buffer. Flash performance for sequential code is equal to execution from RAM. Factoring in discontinuities, most applications will run with an efficiency of approximately 80% relative to code executing from RAM. This flash efficiency lets designers realize a 2×improvement in performance when migrating from the previous generation Delfino MCUs.

    If your application uses some function from that library, then you would see it in the map file.  Try searching for rts in the map file.

    Thanks and regards,

    Vamsi

  • Hi,

    Regarding combined RAMD0_1. Isn't it assigned to PAGE1 instead of PAGE0? Anyway "10068-D no matching section" belongs to missing section or nonvisible section due to PAGE number mismatch.

    Regarding performance executing from RAM. Like Vamsi stated, it's almost the same. Also you should know that fast RTS doesn't make sense on 2837x, presence of TMU obsoletes fast RTS and makes it not very fast. Divide, sqrt, sin, cos, atan2 much faster than in RTS. RTS is only necessary for SFRA library, which accesses FPUmathTables directly. Since it's interpolation table only few accesses are made to flash, it's not heavy crunching table, which could slow down things a lot placing table to slower memory. To use TMU make sure tmu0 and fpu32 are selected in compiler Processor Options page, also make sure --fp_mode = relaxed in Optimization page.

    Regarding " I couldn't find anything in the .map file shows the FPU supplement". Perhaps no symbol from this lib is used. If used, then perhaps linker finds equivalent in default lib, you need to check lib. priority in linker settings. Search library in priority order should be checked in Linker File Search Path settings, also fast RTS should be moved above lic.a and/or rts2800_fpu32.lib.


    Edward
  • Thanks a lot for clarifying that.
    So, what I understand is two things, 1st. Running from flash is almost as good as running from RAM. 2nd, no need to worry about fast FPU supplement in F2837X MCUs. However, I do have an extension question.
    If I have an CLA task need to call math functions like sqrt(x) or sin(x), can I directly call them? I tried but did not work. here's what I have in my ".cla" file:

    #include "cla_divide_shared.h"
    #include "F28x_Project.h"
    #include "math.h"

    extern Uint32 SumCla1;
    extern float fTestCla1;

    __interrupt void Cla1Task1 ( void )
    {
    SumCla1++;
    fTestCla1 = sin(SumCla1);
    GpioDataRegs.GPATOGGLE.bit.GPIO15 = 1;
    return;
    }

    Where SumCla1 and fTestCla1 is defined as:

    #pragma DATA_SECTION(SumCla1,"Cla1ToCpuMsgRAM");
    Uint32 SumCla1 = 0;
    #pragma DATA_SECTION(fTestCla1,"Cla1ToCpuMsgRAM");
    float fTestCla1 = 0;

    When compiling this, I got a whole bunch of errors. Do you know how to call math function in cla program?

    Eric
  • Hi,

    Regarding library functions usage on CLA. Since CLA and CPU instruction sets are different, it is obvious that you can't call function compiled for CPU from CLA or function compiled for CLA from CPU. Unfortunately compiler/linker does not prevent such errors and sin() in CLA code will compile but won't work. You need to use CLAMathLib from controlSUITE or C2000Ware, where sin() is called CLAsin(), cos() - CLAcos() etc.

    (I used some different architecture, where compiler for thing like CLA was mangling function names differently than compiler for main CPU. This prevented wrong function linking and allowed using same functions like sin() from both main CPU and helper processor. I think the same should be done in TI compiler.)


    #pragma DATA_SECTION(SumCla1,"Cla1ToCpuMsgRAM");
    Uint32 SumCla1 = 0;
    #pragma DATA_SECTION(fTestCla1,"Cla1ToCpuMsgRAM");
    float fTestCla1 = 0;

    Problem ^^ here is static non const variable initialization in CLA code is not implemented. Choices:
    -when possible initialize such variable in CPU code.
    -Since Cla1ToCpuMsgRAM is initialized to zero while you are initializing CLA RAM, zero initializers are not necessary.
    -Create variables initialization task, say Cla1Task8(). Trigger it once on completion of CLA initialization from CPU using Cla1Regs.MCTL.bit.IACKE = 1; Cla1ForceTask8andWait();

    Edward
  • Hainan,

    Can I consider this closed?

    Thanks and regards,
    Vamsi
  • Hi, there

    Yes, I got the CLA math part working. Thanks a lot