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.

TMS320F280049C: Variable values in debug mode not updating

Part Number: TMS320F280049C


Hi,

In my project, I am an using the c28 and CLA cores and I am now debugging my codes that relates to the CLA but the debuging of the codes called by the CLA routines are not clear.  I am using the 

PCMC_PSFB_nonpowerSUITE_F28004x example as a guide to my development

My CLA routine is below

interrupt void Cla1Task3(void)
{
static int test;
__mdebugstop();
test++;
CLATask3FunctionCCL();
}

The above routine is regularly called.

The function CLATask3FunctionCCL() is located in a .h file.  This is a .h file for a .c file.  The function content is below

static inline void CLATask3FunctionCCL(void)
{
/**< current control loop calculation */

s_ccl_var.i_ref = 99;
s_ccl_var.i_ref = s_avg_var.rec_volt * s_avg_var.sin_factor * vcl_iac_ref;
s_ccl_var.rec_curr = CAL_REC_CURR(AdcbResultRegs.ADCRESULT3);
s_ccl_var.ccl_unit_ref_val = s_ccl_var.i_ref;
s_ccl_var.unit_rec_curr = s_ccl_var.rec_curr;

s_ccl_var.ccl_cont_signal = DCL_runPI_L5(&cla_con_pfc_ccl_pi_para, s_ccl_var.ccl_unit_ref_val, s_ccl_var.unit_rec_curr);

//avg_var_rec_volt_cla = (short)s_avg_var.rec_volt;
ccl_cont_signal_cla = (short)s_ccl_var.ccl_cont_signal;
}

The above code is in the flash memory and called from the CLA task above.

The variables have been put in a RAM that can be accessed by the CLA and the Ram has been configured as such and also the CMD file.  Sections of the code for this are below

controlVariablesCla : > RAMLS3,                PAGE = 1

    MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS3, MEMCFG_LSRAMMASTER_CPU_CLA1);

    MemCfg_setCLAMemType(MEMCFG_SECT_LS3, MEMCFG_CLA_MEM_DATA);

The variables are put in the controlVariablesCla  using the DATA_SECTION option.

When debugging and the C28 core is running, 

1. Setting a breakpoint in the function is not possible

2. The function variables are not been updated in the Expression view

3. The memory locations are also empty.

Is the above situation normal?

4.  Since the code is located in the .h file, should I use a DCL_runPI_C1 instead of a DCL_runPI_L5?

5. Is the function CLATask3FunctionCCL suppose to be in the flash or in the ram?

When I change the debugging to CLA 

1.  The breakpoint I set works fine.

2.  The variables are not been updated in teh expression view.

3.  The memory locations are also empty.

Is the above normal?

Thanks

Babatola Abayomi

  • Hi,

    The above code is in the flash memory and called from the CLA task above.

    CLA does not have access to Flash. Since the the function is defined in the .h file, I believe, it would be part of the claProg section and which should be run from an LSRAM.

    1. Setting a breakpoint in the function is not possible

    Do you mean keeping a breakpoint from the CLA side? What is the error you facing?

    2. The function variables are not been updated in the Expression view

    3. The memory locations are also empty.

    Where are the variables defined (.c file or .cla file)? Can you share the code snippet

    4.  Since the code is located in the .h file, should I use a DCL_runPI_C1 instead of a DCL_runPI_L5?

    DCL_runPI_C1 is written for the C28x core and cannot be invoked from CLA core

    Is the function CLATask3FunctionCCL suppose to be in the flash or in the ram?

    The function should be in LSRAM which is configured as CLA program memory. Can you check the .map file and confirm the the address it got allocated to?

    Regards,

    Veena

  • Hi,

    Thanks for your reply.  I have implemented your suggestions and also put the variabels defination in a ram that is accessable by the CLA and that solved the problem and I can now see the variables in the debug window.  But somethings are not clear and I would like some calrification on it.

    Firstly a brief overview.  For this purpose, I have 3 files

    1. My cla tasks (Cla1Task2) that runs in the CLA core and calls c functions that are located in a .h file

    2. my .h file that contains variable declaration and function defination.  The function CLATask3FunctionCCL is defined here and called by the CLA task

    3.  The .c file of the .h file in which the variables are defined and placed in a RAM accessible to the CLA.

    I also configured my .cmd file as I should.  I checked .map file and something things are not clear.  A snapshot is below

    The CLA1 section of my .cmd file is below 

    /* Section Cla1Prog used by file Cla.c */
    Cla1Prog : LOAD = FLASH_BANK0_SEC10_11, /* Load to flash, run from CLA Program RAM */
    RUN = RAMLS4_LS5,
    LOAD_START(_Cla1ProgLoadStart),
    LOAD_SIZE(_Cla1ProgLoadSize),
    RUN_START(_Cla1ProgRunStart),
    PAGE = 0, ALIGN(4)
    }

    From the .map file, the Cla1TAsk2 was copied from flash to the CLA1 programme memory.  However I did not find where the CLATask3FunctionCCL was copied or mapped to the CLA1 programme memory but I saw where it was reflected in the scratchpad. 

    Where is the CLATask3FunctionCCL  copied to?  The function executed when I ran the code.

    How do i do a CRC check on the functions that are placed in the scratchpad?  If this is needed

    Thanks.

  • Hi,

    As seen in the .map file, CLATask3FunctionCCL is part of Cla1Prog section. It also gets loaded to FLASH_BANK0_SEC10_11 and is copied to RAMLS4_LS5.

    Scratchpad is used to store the CLA function data, arguments, local variables etc. Each function has its own scratchpad area. Functions are not stored in scratchpad.

    Regards,

    Veena