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.

CCS/UCD3138: How to debug UCD3138 in CCS

Part Number: UCD3138

Tool/software: Code Composer Studio

Hi,

I am trying to debug codes in UCD3138.

I have downloaded the program into controller using UCD3xxx Device GUI with usb interface adapter. In GUI, I can see the memory debugger showing register value. But as I pressed the updated funcation, a debugger error shows."error reading from the device,", though I have loaded the corresponding map.

The other question is how I can debug in ccs like using DSP 28335 with connection of usb interface adaptor.

Regards,

Cliff

  • Hi Cliff,

    Which code are you using? TI EVM code or your own code?

  • Hi Bosheng,

    I am using my own code.

    Thanks,

    Cliff

  • Cliff,

    To use memory debugger, you need to have correct parm_info and parm_value code, please refer to TI EVM source code.  

  • Hi Bosheng,

    Thank you for your answer. So what changes do I need to do in the source code? or do you have any guidance on it?

    How about the debugging in CCS? Is it doable with usb interface adaptor? If so, what is the setting and how to set it up?

    Regards,

    Cliff

  • copy all  parm_info and parm_value related code form TI EVM  source code, then it should work. 

    Memory debugger can be used to debug your code, we do not recommend to use JTAG

  • Thank you for you suggestion.

    But in memory debugger, it can only see register value, I am not able to set break point to check the operation whether some function is running or not?

    Is it possible to run debug in ccs with only usb interface adapter? 

    Thanks,

    Cliff

  • With memory debugger, you can not only see registers, but also globe variables. We do not recommend to set break points, stop the CPU may cause your power converter damage. 

  • Thank you for your reminder. But just want to check whether it is doable to debug in ccs with only usb interface adaptor. or do I have to use JTAG, like xds100 to debug in ccs.

    Regards,

    Cliff

  • no, CCS does not work with USB adaptor, you need JTAG emulator

  • I got it. Thank you for your answer.

    I will update parm_info and parm_value code and try to run memory debugger in design GUI.

    Regards,

    Cliff

  • Hi Bosheng,

    May I ask what you mean by copying all parm_info and parm_value and where can I find these values, in function or source code? Please give some more details. Besides, what are these two values for? I have lab1 code.

    I also have a issue that some of values I defined are not showing in the memory debugger and when I updated one variable, it worked fine. But when I clicked updated for all register, the memory reading error came as the figure showed. I have tried lab 1 and it gave the same error.

    Regards,

    Cliff

  • Cliss,

    If you use lab01, it already has parm_info and parm_value related source code. There may be something else not correct, I will ask an expert to take a look at this question.

  • Hi Bosheng,

    Thank you very much. Looking forward to your reply.

    Regards,

    Cliff

  • Hi Cliff

    There seems to be an issue with the lab code, that causes some issues with the memory debugger.

    In pmbus_common.h, at line 279, can you change the value of the #define SYSTEM_REGS_LENGTH from 0x2d0 to 0x300.

    #define SYSTEM_REGS_LENGTH       0x300

    Re-compile, download again, and re-load the map file in the memory debugger, and please check if the issue is resolved.

    best regards

    Cormac

  • Hi Cormac,

    The Lab 1 original code works fine.

    But as I have changed two locations,

    1. change GioRegs.FAULTIN.bit.FLT3_IN == 1 to GioRegs.FAULTIN.bit.TMS_IN == 0, as my board is not using Fault 3.

    if(GioRegs.FAULTIN.bit.TMS_IN == 0)

    {

    clear_integrity_word();

    }

    2. added some dpwm setting after string strcpy, and  its showed error when updating all memory.

    init_pmbus(0x58);

    strcpy(A_string,"Hello, World");

    Dpwm0Regs.DPWMCTRL0.bit.PWM_EN = 0;

    Dpwm0Regs.DPWMCTRL0.bit.CLA_EN = 0;

    Dpwm0Regs.DPWMCTRL0.bit.PWM_MODE = 0;

    Dpwm0Regs.DPWMPRD.all = 40000;

    Dpwm0Regs.DPWMEV1.all = 0;

    Dpwm0Regs.DPWMEV2.all = 40000/2;

    Dpwm0Regs.DPWMEV3.all = 40000/2+0;

    Dpwm0Regs.DPWMEV4.all = 0;

    Dpwm0Regs.DPWMSAMPTRIG1.all = (40000 * 3)/4;

    Dpwm0Regs.DPWMCTRL2.bit.SAMPLE_TRIG_1_EN = 1;

    Dpwm0Regs.DPWMCTRL1.bit.EVENT_UP_SEL = 1;

    Dpwm0Regs.DPWMPHASETRIG.all = 40000/4;

    Dpwm0Regs.DPWMCTRL0.bit.MIN_DUTY_MODE = 0;

    Dpwm0Regs.DPWMMINDUTYLO.bit.MIN_DUTY_LOW = (40000*1/10) >> 4;

    Dpwm0Regs.DPWMMINDUTYHI.bit.MIN_DUTY_HIGH = (40000*1/10) >> 4;

    Dpwm0Regs.DPWMCTRL0.bit.MASTER_SYNC_CNTL_SEL = 0;

    Dpwm0Regs.DPWMCTRL0.bit.PWM_EN = 1;

    Dpwm1Regs.DPWMCTRL0.bit.PWM_EN = 0;

    Dpwm1Regs.DPWMCTRL0.bit.CLA_EN = 0;

    Dpwm1Regs.DPWMCTRL0.bit.PWM_MODE = 0;

    Dpwm1Regs.DPWMPRD.all = 40000;

    Dpwm1Regs.DPWMEV1.all = 0;

    Dpwm1Regs.DPWMEV2.all = 40000/2;

    Dpwm1Regs.DPWMEV3.all = 40000/2+0;

    Dpwm1Regs.DPWMEV4.all = 0; 

    LoopMuxRegs.DPWMMUX.bit.DPWM1_SYNC_SEL = 0;

    Dpwm1Regs.DPWMCTRL0.bit.MSYNC_SLAVE_EN = 1;

    Dpwm1Regs.DPWMCTRL0.bit.PWM_EN = 1;

    Dpwm1Regs.DPWMPHASETRIG.all = 0;

     

    LoopMuxRegs.GLBEN.bit.DPWM0_EN = 1;

    LoopMuxRegs.GLBEN.bit.FE_CTRL0_EN = 1;

    LoopMuxRegs.GLBEN.bit.DPWM1_EN = 1;

     

    What do you think causes this and how to fix it?

    Regards,

    Cliff

  • Hi Cliff

    I made these changes to my local copy of the code, tied TMS to 3.3V, and it all works fine for me. I can use the memory debugger no problem.

    Specifically, what issue are you seeing? Can you take a screenshot of the GUI error message?

    Best regards

    Cormac

  • Hi Cormac,

    Here is the error.

    Actually, with the original code, I choose not to write program checksum, it won't be able to run as I click command rom to execute and shows no devices found. But as I have changed two parts mentioned before, it worked but directly program the checksum even though I select don't program checksum. And with modified code, all the memory update comes the error above.

    origin code

    modified code

    Regards,

    Cliff

  • Hi Cliff

    So when you click "DEVICE_ID" as shown below, what do you see in the message log

    Do you see something like this?

    Best regards

    Cormac

  • Hi Cormac,

    The picture didn't show. You might need to save and upload the picture.

    After click DECIVE ID, it shows id, which suggests it is in flash now, even though I select run in ROM mode.

    Thank you,

  • Hi Cliff

    Thanks. See attached now. For training lab 1, you should see the message below (HSFB, E1), you show LLC, E3. Is it definitely the training lab 01 firmware that you are using?

    Best regards

    Cormac

    The message 

  • Hi Cormac,

    The right one is shown below. The previous is with my own code. But the error is within lab 1

    Regards,

    Cliff

  • Cliff, one thing you can try:In device GUI, go to “settings”, then “override commands”, uncheck “override” for all of them

  • Hi Bosheng,

    I check this setting and it is not override for all of them already. if I checked it, an error came.

    Cliff