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: DCL User Guide Question

Part Number: LAUNCHXL-F28379D


Hello, 

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

I'm reading DCL user guide. However, at section "Step 3. Allocate the controller functions in the linker command file DCL"  at page 19 of DCL user guide, I got confused.

1. I am going to use FPU32, do I need to update my linker command file? If yes, how?

2. Is it necessary to declare and use some CLA issue, although I already decided to use FPU32?

3. I investigated F28069_DCL.cmd in the project examples as written in the DCL User guide. What should I do now with this F28069_DCL.cmd file. Do I need to add them to my project?

4. Do i need to add lines as below like this to my linker command file?

dclfuncs : > RAML4, PAGE = 0

ty.

  • 1 & 2. You will only need to add the section "dclfuncs" to the SECTIONS part of your linker command file. The example .cmd file supplied with the library has to support all the examples, so has sections for fixed-point (dcl32funcs) and CLA functions which you do not need. You may safely ignore those sections.

    3 & 4. The file "F28069_DCL.cmd" is there as an example. You could use possibly it in place of your existing linker command file, but since you only need the dclfuncs section, I recommend you just add that line to your existing file.

    BTW, if you do not specify the dclfuncs section you'll get a linker warning, but your project will still build and run. Specifying 'dclfuncs' separately just allows you to place the DCL functions in a specific memory block so you could (for example) copy them into RAM at run time.

    Hope this helps. Please post back if anything's still unclear.

    Regards,

    Richard

  • Hello,

    1. I'm going to just insert following lines to my linker command file could you please correct me?

    2. Where do I need to insert below lines into my linker command file? It is at the bottom of my explanations.

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

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

    3. I'm following up DCL user guide, I added #include "DCLF32.h" and file to location. I have the following error at my ISR.

    I added this line:     uk = DCL_runPI(&pi_cur, rk, yk lk);         //Returns a single floating-point variable

    But there is an error and optimization offer like this. 

    MY LINKER COMMAND FILE AS BELOW:


    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 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    RAMGS13 : origin = 0x019000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    RAMGS14 : origin = 0x01A000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    RAMGS15 : origin = 0x01B000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */

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

    CANA_MSG_RAM : origin = 0x049000, length = 0x000800
    CANB_MSG_RAM : origin = 0x04B000, length = 0x000800
    }


    SECTIONS
    {
    codestart : > BEGIN, PAGE = 0
    ramfuncs : > RAMM0 PAGE = 0
    .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

    #ifdef __TI_COMPILER_VERSION__

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

    /* 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
    }

    /* The following section definition are for SDFM examples */
    Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111
    Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222
    Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333
    Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444
    Difference_RegsFile : >RAMGS5, PAGE = 1, fill=0x3333
    }

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

  • The lines you propose to add are correct.  It does not matter much where in the SECTIONS part you add them, but for readability I suggest adding them just under the .text line.  That way you keep the initialized sections together.  You also need to remove the ramfuncs line in the original file or you'll have that defined twice.  Something like:

    SECTIONS

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

    dclfuncs : > RAMLS4, PAGE = 0

    ramfuncs : > RAMLS4, 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, */

    The error you're getting is because you need a comma after "yk".  Function arguments are de-limited by commas in C:

    uk = DCL_runPI(&pi_cur, rk, yk, lk);

    Regards,

    Richard