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.

LAUNCHXL-F28379D: Adding DCL lib. and using FPU32 to a basic project

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE

Hello,

I'm trying to add DCL library to my basic LED blinking project....  I'm trying to use FPU32 functions for PI controller for my LAUNCHXL-F28379D device.

I'm following up videos and also I've already read DCL user guide but I cannot solve.

I'm making what video explained at link https://www.youtube.com/watch?v=7j1nyIYGRNQ  

1. At first I got following errors and warnings for following line. How can I solve? I need to set my own PI parameters. How can I do?

2. At second, I tried to comment those error lines and I got following errors and warnings for following line. How can I solve?

 

3. Maybe the problem at question 2 is related to linker command file. I loaded it to below. I don't know how to configure it. If I had lines, it will give errors I know. I used standard linker command file which is installed at control suite folder. The name of it is "2837x_RAM_lnk_cpu1.cmd"

MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to SARAM" bootloader mode */

BEGIN : origin = 0x000000, length = 0x000002
RAMM0 : origin = 0x000122, length = 0x0002DE
RAMD0 : origin = 0x00B000, length = 0x000800
RAMLS0 : origin = 0x008000, length = 0x000800
RAMLS1 : origin = 0x008800, length = 0x000800
RAMLS2 : origin = 0x009000, length = 0x000800
RAMLS3 : origin = 0x009800, length = 0x000800
RAMLS4 : origin = 0x00A000, length = 0x000800
RESET : origin = 0x3FFFC0, length = 0x000002

PAGE 1 :

BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
RAMD1 : origin = 0x00B800, length = 0x000800


RAMLS5 : origin = 0x00A800, length = 0x000800

RAMGS0 : origin = 0x00C000, length = 0x001000
RAMGS1 : origin = 0x00D000, length = 0x001000
RAMGS2 : origin = 0x00E000, length = 0x001000
RAMGS3 : origin = 0x00F000, length = 0x001000
RAMGS4 : origin = 0x010000, length = 0x001000
RAMGS5 : origin = 0x011000, length = 0x001000
RAMGS6 : origin = 0x012000, length = 0x001000
RAMGS7 : origin = 0x013000, length = 0x001000
RAMGS8 : origin = 0x014000, length = 0x001000
RAMGS9 : origin = 0x015000, length = 0x001000
RAMGS10 : origin = 0x016000, length = 0x001000
RAMGS11 : origin = 0x017000, length = 0x001000
RAMGS12 : origin = 0x018000, length = 0x001000
RAMGS13 : origin = 0x019000, length = 0x001000
RAMGS14 : origin = 0x01A000, length = 0x001000
RAMGS15 : origin = 0x01B000, length = 0x001000

CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400
CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400
}


SECTIONS
{
codestart : > BEGIN, PAGE = 0

#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
.TI.ramfunc : {} > RAMM0, PAGE = 0
#else
ramfuncs : > RAMM0 PAGE = 0
#endif
#endif

.text : >>RAMM0 | RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, 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
.ebss : > RAMLS5, PAGE = 1
.econst : > RAMLS5, PAGE = 1
.esysmem : > RAMLS5, PAGE = 1
Filter_RegsFile : > RAMGS0, PAGE = 1

ramgs0 : > RAMGS0, PAGE = 1
ramgs1 : > RAMGS1, PAGE = 1

/* The following section definitions are required when using the IPC API Drivers */
GROUP : > CPU1TOCPU2RAM, PAGE = 1
{
PUTBUFFER
PUTWRITEIDX
GETREADIDX
}

GROUP : > CPU2TOCPU1RAM, PAGE = 1
{
GETBUFFER : TYPE = DSECT
GETWRITEIDX : TYPE = DSECT
PUTREADIDX : TYPE = DSECT
}

}

  • 1. The lines you have written to initialize the controller are code, not declarations. They need to go with your program code, typically just after main().

    2. Since you are using bit-field header structures to communicate with the device registers you will need to add another linker file to your project. In C2000Ware, the file "F2837xD_Headers_nonBIOS_cpu1.cmd" does this for you. You will also need to define the dclfuncs section in your linker file, as I described in your other forum thread.

    3. You can use this linker command file, with the addition of the dclfuncs section as I described.

    There is a code example in the DCL which shows a PID controller setup and run on the F28069. Even though it's for a different device, if you refer to the code and linker command files in that example I think it will answer a lot of your questions. With C2000Ware installed in the default directory on your hard drive, you can find the example at:
    C:\ti\c2000\C2000Ware_3_01_00_00\libraries\control\DCL\c28\examples\F28069_PID

    Regards,

    Richard

  • Richard,

    Thank you for your help.

    1. The problem is solved.

    2. First of all, I cannot understand which lines, sections etc. to be added to linker command file. The file is very complicated, if I add some lines it would give errors. Therefore, firstly, before trying to add some dclfunc sections, I just tried to change the linker command file as you offered.

    When I used "F2837xD_Headers_nonBIOS_cpu1.cmd" at c2000 folder instead of "2837x_RAM_lnk_cpu1" which is found at "C:\ti\ccs930\ccs\ccs_base\c2000\include" location, the errors and warnings occured as below figure.  (Note. No extra dclfuncs sections written.)

    (error #10430-D: ".TI.ramfunc" section generated by __attribute__((ramfunc)) or --ramfunc=on requires a SECTIONS specification to function.)

    3. At F28069_PID project, the linker command file is a file called "F28069_DCL.cmd". Therefore, I have two questions here

    3.1 While "F2837xD_Headers_nonBIOS_cpu1.cmd" is added to my project, do you offer me to directly use "F28069_DCL.cmd" file as a linker cmd file?

    3.2 Do you offer me to remowe "F2837xD_Headers_nonBIOS_cpu1.cmd" and use "F28069_DCL.cmd" instead?

    I really got confused about linker issue. 

  • I did not mean, or say, to remove your existing linker command file.  I only said "... to add another linker file to your project.".  You need two linker command files - one to define where the generic program sections are placed, the other to define placement of the memory mapped registers.  Please take a look at the example I recommended - there are two .cmd files. 

    To summarize, this is what you do:

    • You keep the linker command file you already had: "2837x_RAM_lnk_cpu1.cmd",  You only need to add dclfuncs to this file, as described in the other thread.  Do not add "F28069_DCL.cmd" - that's just the example.
    • You add the file "F2837xD_Headers_nonBIOS_cpu1.cmd" to your project.  Do not change it.

    Your linker warnings and build error should go away when you do this.

    Regards,

    Richard 

  • Hello,

    I got what I need to do.

    • I keept my linker file "2837x_RAM_lnk_cpu1.cmd", and added some dclfuncs lines which is shown as below.  I commented ramfuncs at beggining. 
    • I added "F2837xD_Headers_nonBIOS_cpu1.cmd" to my project and no change.

    However, I got following errors and warnings.


    MEMORY
    {
    PAGE 0 :
    /* BEGIN is used for the "boot to SARAM" bootloader mode */

    BEGIN : origin = 0x000000, length = 0x000002
    RAMM0 : origin = 0x000122, length = 0x0002DE
    RAMD0 : origin = 0x00B000, length = 0x000800
    RAMLS0 : origin = 0x008000, length = 0x000800
    RAMLS1 : origin = 0x008800, length = 0x000800
    RAMLS2 : origin = 0x009000, length = 0x000800
    RAMLS3 : origin = 0x009800, length = 0x000800
    RAMLS4 : origin = 0x00A000, length = 0x000800
    RESET : origin = 0x3FFFC0, length = 0x000002

    PAGE 1 :

    BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
    RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
    RAMD1 : origin = 0x00B800, length = 0x000800


    RAMLS5 : origin = 0x00A800, length = 0x000800

    RAMGS0 : origin = 0x00C000, length = 0x001000
    RAMGS1 : origin = 0x00D000, length = 0x001000
    RAMGS2 : origin = 0x00E000, length = 0x001000
    RAMGS3 : origin = 0x00F000, length = 0x001000
    RAMGS4 : origin = 0x010000, length = 0x001000
    RAMGS5 : origin = 0x011000, length = 0x001000
    RAMGS6 : origin = 0x012000, length = 0x001000
    RAMGS7 : origin = 0x013000, length = 0x001000
    RAMGS8 : origin = 0x014000, length = 0x001000
    RAMGS9 : origin = 0x015000, length = 0x001000
    RAMGS10 : origin = 0x016000, length = 0x001000
    RAMGS11 : origin = 0x017000, length = 0x001000
    RAMGS12 : origin = 0x018000, length = 0x001000
    RAMGS13 : origin = 0x019000, length = 0x001000
    RAMGS14 : origin = 0x01A000, length = 0x001000
    RAMGS15 : origin = 0x01B000, length = 0x001000

    CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400
    CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400
    }


    SECTIONS
    {
    codestart : > BEGIN, PAGE = 0

    //#ifdef __TI_COMPILER_VERSION__
    // #if __TI_COMPILER_VERSION__ >= 15009000
    // .TI.ramfunc : {} > RAMM0, PAGE = 0
    // #else
    // ramfuncs : > RAMM0 PAGE = 0
    // #endif
    //#endif

    .text : >>RAMM0 | RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, PAGE = 0

    /* Digital Controller Library functions */
    dclfuncs : > RAML4L, PAGE = 0

    ramfuncs : > RAML4L, PAGE = 0
    LOAD_START(_RamfuncsLoadStart),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRUNSize)

    .cinit : > RAMM0, PAGE = 0
    .pinit : > RAMM0, PAGE = 0
    .switch : > RAMM0, PAGE = 0
    .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */

    .stack : > RAMM1, PAGE = 1
    .ebss : > RAMLS5, PAGE = 1
    .econst : > RAMLS5, PAGE = 1
    .esysmem : > RAMLS5, PAGE = 1
    Filter_RegsFile : > RAMGS0, PAGE = 1

    ramgs0 : > RAMGS0, PAGE = 1
    ramgs1 : > RAMGS1, PAGE = 1


    /* The following section definitions are required when using the IPC API Drivers */
    GROUP : > CPU1TOCPU2RAM, PAGE = 1
    {
    PUTBUFFER
    PUTWRITEIDX
    GETREADIDX
    }

    GROUP : > CPU2TOCPU1RAM, PAGE = 1
    {
    GETBUFFER : TYPE = DSECT
    GETWRITEIDX : TYPE = DSECT
    PUTREADIDX : TYPE = DSECT
    }

    }

    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */

  • You are almost there.  The error is because you have not defined the memory block called RAML4L.  Change RAML4L to something which exists, such as RAMLS4, and it should link correctly.  You'll need to do this for both 'dclfuncs' and 'ramfuncs'. 

    Regards,

    Richard

  • Dear Richard,

    Your offer solved my problem.. Thank you very much. I just have following warnings. How can I solve them?

  • You're welcome, and I'm glad you got it working.

    Regret I don't recognize those sections.  From their names I guess they have something to do with code security and booting.  There must be a header or source file in your project which is defining them in a #pragma; can you find them in your project and let me know the file name and where it came from please?  If it's TI reference software I can ask the author to comment.

    Otherwise, since they are warnings rather than errors your program may run correctly without worrying about them for the moment.  It's probably something you can return to later.

    Regards,

    Richard

  • It turns out these section names come from an older version of the support files for F28379D which was delivered in controlSUITE.  In newer versions of the support files, the DCSM OTP items have been removed and the EMU key items changed to fix a bug.  In my first reply to this thread I referenced the newest version of C2000Ware, so perhaps your older files became mixed in with the newer ones then?

    If you want a quick solution, then make sure you are using the linker command file "F2837xD_Headers_nonBIOS_cpu1.cmd" from your controlSUITE installation.  You'll also need the older versions of "globalvariabledefs.c" and "globalprototypes.h".

    However, the best way to fix this is to make sure you are using the latest versions of the support files, which are those in C2000Ware v3.01.  This way you take all the bug fixes we have done in later revisions.  

    Regards,

    Richard

  • Dear Richard,

    Thank you for explanation. This resolved my problem.