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-F280049C: DCL 2P2Z function fall triggers reset when system is running in stand alone mode

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

hi,

I am working of a digital inverter and using the C200 ware for the project.

When I run my control code in debug mode, the code runs well but when I run it in stand alone mode, the device enters reset continuously.

After going through my code, I observed that this happens when I call the below funtion 

extern float32_t DCL_runDF22_C1(DCL_DF22 *p, float32_t ek);

This function is in the DCLF32.h included file.

I changed the optimization level and other properties  of the .c file in which the function is located but the problem still persists. 

Please how can this problem be solved.

I am testing my HW and code on the lunch pad.

Thanks

  • Hello,

    As the first step of debug, since DCL_runDF22_C1 is an external assembly function, can you kindly check if DCL_DF22_C1.asm exists in your project space (could be either copied or linked)? 

    If not please have a copy of DCL_DF22_C1.asm within your project space, which could be found under C2000Ware_pkg/libraries/control/DCL/c28/source

    Best,

    Sen Wang

  • Hi Wang,

    Thanks for your reply. 

    This step is done already. The assembly file is in my project space.

  • Hello Abayomi,

    Thank you for your clarification. Just to be clear, when you mean standalone mode, does it mean running in Flash?

    DCL functions by default maps to a output section called "dclfuncs", if this section isn't specified within your linker script (.cmd file). It might be implicitly mapped to a RAM memory region, and therefore produces illegal code instruction.

    To check this, please find see the generated .map file and see what memory address did DCL_runDF22_C1 got mapped to. 

    For critical functions such as DCL, we recommend it to be stored in flash, but load from flash to ram at startup. See section 1.4.2 "Executing from RAM": https://software-dl.ti.com/C2000/docs/optimization_guide/phase3/memory.html, follow the same syntax as .TI.ramfunc output section that also gets placed in ram at startup, and make sure you have a memcpy function just like .TI.ramfunc in device.c for your dclfunc section.

    Alternatively, you can add both .TI.ramfunc and dclfuncs into one output group so existing setups for .TI.ramfunc will be applicable to dclfuncs as well. See https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html for more detail.

    Please let me know if you need more clarification on this.

    Best,

    Sen Wang

  • Hi Sen,

    Thank you for your reply.

    By stand alone mode, I mean I power up my Launch pad by connecting it to a USB power supply and not starting the CCS debugger.  It is in this mode that the device enters continuous reset.

    I have checked my linker commnad fine and the .map file.  The "dclfuncs" section was decleared in the .cmd file.

    I have looked at the linker command file and I observed the following

          -  I have two DCL functions; DCL_PI_L1 and DCL_DF22_C1.

          - the DCL_PI_L1  which runs in the CLA exist both in the flash and RAM memory

          - the DCL_DF22_C1 only exist in the Ram memory.  

    A snapshot is below:

    I think this might be the problem and based on your explaination.

    I would implement your recommendation and give you an update today.

    Thanks.

  • Hi,

    I trie creating a group and then put the ramfunc and the dclfuncs in it but the modificatio in the linker command file did not work.  

    The modification is below.  Please what could be wrong with it.  

    GROUP
    {
    .TI.ramfunc : { }
    //dclfuncs : {RUN_START(DCLfuncsRunStart), RUN_SIZE(RamfuncsRunSize), RUN_END(RamfuncsRunEnd) }
    } LOAD = FLASH_BANK0_SEC7, RUN = RAMLS0_RAMLS1, START(RamfuncsRunStart), LOAD(RamfuncsLoadStart), SIZE(RamfuncsLoadSize); //, PAGE = 0, ALIGN(4) crc_table(page0_crc_table, algorithm = CRC32_PRIME)

    I am using the TMS320C28x Assembly Language Tools v22.6.0.LTS document, section 8.5.11.7.3 GROUPs guide.

    What am I missing

  • Hi Abayomi,

    The linker syntax could be confusing especially when there's mulitple specifiers used in tandem, can you please try using the following syntax instead:

    GROUP   :   LOAD = FLASH_BANK0_SEC7,   // ":" or ": >" both works here
            RUN = RAMLS0_RAMLS1, 
            START(RamfuncsRunStart), 
            LOAD(RamfuncsLoadStart), 
            SIZE(RamfuncsLoadSize); 
            //, PAGE = 0, ALIGN(4) crc_table(page0_crc_table, algorithm = CRC32_PRIME)
    {
        .TI.ramfunc
        dclfuncs
    } 

    This is the way to combine both output sections to a same GROUP, which means any specifier will be applied to both and be treated in the same manner.

    Alternatively, both output sections could be seperate maintaining their own specifiers.

    dclfuncs   :   LOAD = FLASH_BANK0_SEC7,   // ":" or ": >" both works here
            RUN = RAMLS0_RAMLS1, 
            START(DCLfuncsRunStart), 
            LOAD(DCLfuncsLoadStart), 
            SIZE(DCLfuncsLoadSize),
            ALIGN(8)
    

    (":" is the shorthand for ": >",  and since load/run specifier requires a continuous memory ranges, the spilt across mutliple memory syntax ": >>" can not be used here.)

    Best,

    Sen Wang

  • Hi, 

    Thank you for your reply.

    I have tried both but it is negative.  This is very strange.  The memroy symbols for the DCL fuction placements where not created in the .map file.  

    Sections of my linker command file  is below:

    For the dclfunc
    dclfuncs : LOAD = FLASH_BANK0_SEC12_13, /* Load to flash, run from Program RAM */
    RUN = RAMLS0_RAMLS1,
    LOAD_START(DCLfuncsLoadStart),
    LOAD_SIZE(DCLfuncsLoadSize),
    RUN_START(DCLfuncsRunStart),
    ALIGN(8)

    For the ramfunc

    .TI.ramfunc LOAD = FLASH_BANK0_SEC7
    RUN = RAMLS0_RAMLS1,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    RUN_START(RamfuncsRunStart),
    PAGE = 0, ALIGN(4), crc_table(page0_crc_table, algorithm = CRC32_PRIME)

    The ramfunc works fine and the symbols are created while the dclfunc does not.

    A snapshoot from my .map file is below:

    The copy code is below 

    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (uint32_t)&RamfuncsLoadSize);

    memcpy((uint32_t *)&DCLfuncsRunStart, (uint32_t *)&DCLfuncsLoadStart, (uint32_t)&DCLfuncsLoadSize);

    This is abit abnormal.  Please can you show or explain to me why the symbols are not been created.

    Thanks

  • Hi Abayomi,

    So just to confirm, variables DCLfuncsRunStart, DCLfuncsLoadStart,DCLfuncsLoadSize aren't defined when you search it in the .map file?

    If so, then there might be more syntax issues within the linker file, it looks like it too, dclfunc is still placed in ram. If you don't mind, can you send me the content of your linker script in E2E's private chat? Anything you send in private will not be shared with any external outlets.

    Best,

    Sen Wang

  • Yes I would like to send it to you

  • HI;

    Problem resolved.

    The linker command file is correct as you noted.  I did a code reveiw and I added the 5 cycle delay after enabling of periphreal clock in the code (some wehre missing).  After this the symbols were generated and the problem solved.

    Thanks.

  • Awesome, glad to hear!