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.

TMS320F28384D-Q1: JTAG repeatedly resetting device during debugging

Part Number: TMS320F28384D-Q1
Other Parts Discussed in Thread: TMDXIDDK379D, C2000WARE, TMS320F28384D, CONTROLSUITE, TMS320F28388D

Hi, 

I am trying to load the reference project code "IDDK_PM_Servo_F2837x-v2" onto a F28384DPTPQR CPU, but am unable to get to a debug state.  

The CCS debug state is noting that a reset is occurring on the device.  Probing with a scope, I see a reset coming from the JTAG adaptor (XDS110) every few 10s of MSEC.  

Any ideas what the issue could be?  

***** here is the output from the device ****** 

C28xx_CPU1: GEL Output:
Memory Map Initialization Complete
C28xx_CPU1: GEL Output:
... DCSM Initialization Start ...
C28xx_CPU1: GEL Output:
... DCSM Initialization Done ...
C28xx_CPU1: GEL Output:
CPU2 is out of reset and configured to wait boot.
(If you connected previously, may have to resume CPU2 to reach wait boot loop.)
C28xx_CPU1: GEL Output:
CM is out of reset and configured to wait boot.
(If you connected previously, may have to resume CM to reach wait boot loop.)
C28xx_CPU1: If erase/program (E/P) operation is being done on one core, the other core should not execute from shared-RAM (SR) as they are used for the E/P code. User code execution from SR could commence after both flash banks are programmed.
C28xx_CPU1: Only CPU1 on-chip Flash Plugin can configure clock for CPU1, CPU2 and CM Flash operations. Plugin automatically configures PLL when CPU1 Flash operations are invoked. However, if users want to do only CPU2 or CM Flash operations without doing a prior CPU1 operation in the current session, they should click on 'Configure Clock' button in CPU1's on-chip Flash Plugin before invoking CPU2 and CM Flash operations. When this button is used, Flash Plugin will configure the clock for CPU1/CPU2 at 190MHz and CM at 95MHz using INTOSC2 as the clock source. Plugin will leave PLL config like this and user application should configure the PLL as required by application.
C28xx_CPU1: GEL Output:
... DCSM Initialization Start ...
C28xx_CPU1: GEL Output:
... DCSM Initialization Done ...
C28xx_CPU1: GEL Output:
CPU2 is out of reset and configured to wait boot.
(If you connected previously, may have to resume CPU2 to reach wait boot loop.)
C28xx_CPU1: GEL Output:
CM is out of reset and configured to wait boot.
(If you connected previously, may have to resume CM to reach wait boot loop.)
C28xx_CPU1: GEL Output:
... DCSM Initialization Start ...
C28xx_CPU1: GEL Output:
... DCSM Initialization Done ...
C28xx_CPU1: GEL Output:
CPU2 is out of reset and configured to wait boot.
(If you connected previously, may have to resume CPU2 to reach wait boot loop.)
C28xx_CPU1: GEL Output:
CM is out of reset and configured to wait boot.
(If you connected previously, may have to resume CM to reach wait boot loop.)

  • Paul W,

    Which reset are you talking about (XRSn) (or) nTRST reset? 

    CCS output doesn't seem to suggest any reset. Do you see the problem only when programming code to flash? What about when you running the code from RAM? 

    Please provide more details.

    Regards,

    Manoj

  •  Hi Manoj,

    I am seeing the reset on pin 124 (XRSN).  

    The error message I attached above is from running from the RAM.  If I change to program to flash via the build menu (hammer icon), I have similar error messages in CCS.  

    Thanks,

    Paul

  • Paul,

    If XRSn is getting pulled low. Did you find the source of XRSn reset using RESC register?

    Regards,

    Manoj

  • Are you servicing watchdog? It looks like watchdog is the source of reset

  • Hi Manoj,

    Its a TI reference project, so I am assuming they set this all up correctly, but just in case:

    The main loop starts out like this: 

    void main(void)
    {
    
    	int mainStat = 1;
        volatile int16 temp;
    
    #ifdef _FLASH
    // Copy time critical code and Flash setup code to RAM
    // The  RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart
    // symbols are created by the linker. Refer to the linker files.
        memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (Uint32)&RamfuncsLoadSize);
    #endif
    
    	//  Initialize System Control:
    	// PLL, WatchDog, enable Peripheral Clocks
    	// This example function is found in the F28M3Xx_SysCtrl.c file.
    	InitSysCtrl();

    This calls a function that starts out like this:  

    void InitSysCtrl(void)
    {
        // Disable the watchdog
        DisableDog();
    

    Interestingly, I added the first variable in main to try to debug (int mainStat = 1), but it does not look like this is being set, so I am not sure if we are even getting to the main loop.  

  • Did you try running TI example code (IDDK_PM_Servo_F2837x-v2) without modification?

  • Hey Manoj,

    my only change so far has been adding "int mainStat = 1;" for debugging, but I reverted it back and have the same issue.  

  • What board/kit are you using? TI EVM kit? Or your own board? If you are using your own board, do you set up the clock PLL control according to your board? 

    BTW, this project only uses CPU1, so you should select and connect CPU1 to load/program the code.

  • Hi Yanming,

    This is a custom board.  The dev-kit is out of stock, so we were unable to test a bring-up there. Overall, I think the clock should be set up ok, but also, we are not reaching that point in the code (main does not seem to be reached).  

    I also just tried changing to the internal oscillator, and we have the same issue.  

    Demo code is initializing the clock using 

    InitSysPll(XTAL_OSC,IMULT_20,FMULT_0,PLLCLK_BY_2); 	
    
    void InitSysPll(Uint16 clock_source, Uint16 imult, Uint16 fmult, Uint16 divsel)
    {
        if((clock_source == ClkCfgRegs.CLKSRCCTL1.bit.OSCCLKSRCSEL)    &&
          (imult         == ClkCfgRegs.SYSPLLMULT.bit.IMULT)           &&
          (fmult         == ClkCfgRegs.SYSPLLMULT.bit.FMULT)           &&
          (divsel        == ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV))
        {
            //everything is set as required, so just return
            return;
        }
    
        if(clock_source != ClkCfgRegs.CLKSRCCTL1.bit.OSCCLKSRCSEL)
        {
            switch (clock_source)
            {
                case INT_OSC1:
                    SysIntOsc1Sel();
                    break;
    
                case INT_OSC2:
                    SysIntOsc2Sel();
                    break;
    
                case XTAL_OSC:
                    SysXtalOscSel();
                    break;
            }
        }
    
        EALLOW;
         // first modify the PLL multipliers
        if(imult != ClkCfgRegs.SYSPLLMULT.bit.IMULT || fmult != ClkCfgRegs.SYSPLLMULT.bit.FMULT)
        {
            // Bypass PLL and set dividers to /1
            ClkCfgRegs.SYSPLLCTL1.bit.PLLCLKEN = 0;
            ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV = 0;
    
            // Program PLL multipliers
            Uint32 temp_syspllmult = ClkCfgRegs.SYSPLLMULT.all;
            ClkCfgRegs.SYSPLLMULT.all = ((temp_syspllmult & ~(0x37FU)) | 
                                         ((fmult << 8U) | imult));
                   
            ClkCfgRegs.SYSPLLCTL1.bit.PLLEN = 1;            // Enable SYSPLL
    
            // Wait for the SYSPLL lock
            while(ClkCfgRegs.SYSPLLSTS.bit.LOCKS != 1)
            {
                // Uncomment to service the watchdog
                // ServiceDog();
            }
    
            // Write a multiplier again to ensure proper PLL initialization
            // This will force the PLL to lock a second time
            ClkCfgRegs.SYSPLLMULT.bit.IMULT = imult;        // Setting integer multiplier
    
            // Wait for the SYSPLL re-lock
            while(ClkCfgRegs.SYSPLLSTS.bit.LOCKS != 1)
            {
                // Uncomment to service the watchdog
                // ServiceDog();
            }
        }
    
        // Set divider to produce slower output frequency to limit current increase
        if(divsel != PLLCLK_BY_126)
        {
             ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV = divsel + 1;
        }else
        {
             ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV = divsel;
        }
    
        // Enable PLLSYSCLK is fed from system PLL clock
        ClkCfgRegs.SYSPLLCTL1.bit.PLLCLKEN = 1;
    
        // Small 100 cycle delay
        asm(" RPT #100 || NOP");
    
        // Set the divider to user value
        ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV = divsel;
        EDIS;
    }

  • Hi,

    Quick update... I created a new project using the hello world template on CPU1, and it runs correctly, so I think we can rule out a hardware issue.  The reference project "IDDK_PM_Servo_F2837x-v2" fails to even get to main().  

    I am thinking through the fishbone diagram, I think the only issues that could cause this are:

    -  Incorrect settings in #progma config

    -  Some other CCS bug

    Any recommended next steps? 

  • I am trying to load the reference project code "IDDK_PM_Servo_F2837x-v2" onto a F28384DPTPQR CPU
    The reference project "IDDK_PM_Servo_F2837x-v2" fails to even get to main().  

    Are you using F2837x project on F28384 project? Do you change the project files according to F28384 device like .cmd file, the PLL clock, the driverlib...

    Do you try to use the "fcl_f2838x_tmdxiddk_cpu1.projectspec" in MotorControlSDK directly as below? And just change .cmd file for F28384 device.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\f2838x\ccs\sensored_foc

    You may download and install MotorControl software development kit (SDK) for C2000Tm MCUs as the link below.

    C2000WARE-MOTORCONTROL-SDK: http://www.ti.com/tool/C2000WARE-MOTORCONTROL-SDK

  • Hi Yanming,

    Are you using F2837x project on F28384 project

    Yes.  

    Do you change the project files according to F28384 device like .cmd file, the PLL clock, the driverlib...

    I thought I did, but perhaps I missed one?  Will the CCS throw errors in this case, or just program to the device?  

    Do you try to use the "fcl_f2838x_tmdxiddk_cpu1.projectspec" in MotorControlSDK

    I did in the past, but I get an issue when I try to import it into CCS:

    Going forwards, do you recommend I work with the "IDDK_PM_Servo" project or the FOC project you linked?  I have a single TMS320F28384D driving 2x motor controllers using DRV8353FSRTAR

  • Please try to use the latest reference in motorcontrolSDK which includes the functions in controlSUITE. You may find the "fcl_f2838x_tmdxiddk_cpu1.projectspec" file at the folder, import this project into CCS, and change the iddk_servo_2838x_flash_lnk_cpu1.cmd file according to the TMS320F28384D device. 

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\f2838x\ccs\sensored_foc

    You can take a look at the users guide at the folder below, and follow the guide to run the project.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\docs

    If you want to run the dual motor, you may refer to the reference design "dual_axis_servo_drive_fcl_qep_f2837x.projectspec" with F28379.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\boostxl_3phganinv\f2837x\ccs\sensored_foc

    And take a look at user's guide at the folder for dual motor.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\boostxl_3phganinv\docs

    You may need to change the device configuration file according to the device and board you used. Or you may try to use the same supporting kits as the reference design that could be quick to start the evaluation.

  • Hi Yanming,

    When I try to import the project in "C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\f2838x\ccs\sensored_foc", I get this error: "See details below...Import failed for project 'sensored_foc' because its meta-data cannot be interpreted. Please contact support."

    Could we have a video call to debug real-time?  

  • Try to re-install the motor control SDK and import the project in new CCS workspace. And it's better to use the recommend or a newer CCS version.

  • Hi Yanming,

    I re-installed the motor control SDK and created a new workspace, but I am getting the same error.  I am on CCS 11.2.  

  • Interesting. What OS are you using? How do you import the project within CCS? Can you provide more details since we can't repeat the issue as you mentioned above?

  • Hi Yanming,

    I am on windows 10.  I am importing through the project >> import CCS project menu.  

    Do you have time to hop on a conference call today, and we can walk through this live?  

  • Sorry. Let's try to solve the question on E2E forum, you may post a few captured figures or video to show the issue you met. Thanks!

  • Hi Yanming,

    The error capture is up in the thread from (2) days ago.  Is there additional data needed? 

  • The project name is not correct. Please check if you follow the guide to import the right project into CCS rom the related folder.

    The project name is "fcl_f2838x_tmdxiddk_cpu1" if you don't change anything.

    Using the "fcl_f2838x_tmdxiddk_cpu1.projectspec" from the folder below.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\f2838x\ccs\sensored_foc

  • Hi Yanming,

    I see the "fcl_f2838x_tmdxiddk_cpu1.projectspec" file in the folder "C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\f2838x\ccs\sensored_foc", when I select this folder in the import CCS projects folder, it only shows the sensored_foc project.  

    This directory is a clean install of motorControl SDK, so nothing has been changed in this directory. 

    I can import the project for F2837x without issues, but the F2838x does not import.  

    I think it would be more efficient to have a remote desktop session on this topic?

  • You should see two projects as below and select the "fcl_f2838x_tmdxiddk_cpu1". If not , please uninstall the motor control SDk on your PC, and download the software from the link to re-install the software by default. Don't change anything in the original folder, just follow the guide to import the project from the folder " C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\f2838x\ccs\sensored_foc".

    C2000WARE-MOTORCONTROL-SDKhttp://www.ti.com/tool/C2000WARE-MOTORCONTROL-SDK

  • Hi Yanming,

    I uninstalled the motor control SDK, re-installed it, and tried to import the project per the guide here:  "file:///C:/ti/c2000/C2000Ware_MotorControl_SDK_4_00_00_00/solutions/tmdxiddk379d/docs/IDDKv2.2.1_UserGuide.pdf".  

    The only project I see in the folder you listed is "sensored_foc".  If I try to import, I get the same error as before.  

    Using the forum seems to be extremely inefficient on this issue (now 10 days old).  Can we move this to Email + Video conference session?  

  • That's very strange, nobody reported the same question as you mentioned. Can you find the "fcl_f2838x_tmdxiddk_cpu1.projectspec" and attached it on this forum. And also you can take a video and post on the forum to show the operation steps you did.

  • File is attached:

    The forum does not allow me to upload video.  

    7242.fcl_f2838x_tmdxiddk_cpu1.zip

  • Do you install the C2000Ware? Can you try to import any projects for F2838x in the C2000Ware folder as below?

    C:\ti\c2000\C2000Ware_<version>\driverlib\f2838x\examples\c28x

    Seems like somebody can upload the Video on the forum, you may try to click "Insert"->"Image/Video/File"->"Upload"

  • Hi Yanming, 

    I can import projects from C200ware, it is the motor SDK project that is not working. There is a size restriction on files, so I can't upload videos.  

    To increase speed on this issue, I would like this fork this conversation into 1 of 2 directions:  

    A)  You think this is a bug on the motor control SDK:  Lets start an email conversation with the software engineers of this SDK.  

    B)  You think this is a user error:  Lets have a video call so we can rule this out.  

  • Can you try importing it through the Resource Explorer instead?

    CCS Menu->View->Resource Explorer->Software->C2000Ware_MotorControl_SDK-4.00.00.00->Development Kits->TMDXIDDK379D->Example Projects->F2838x->DesignDRIVE->(CPU1) EtherCAT connected PMSM control using FCL->Import

  • Hi Yanming,

    It looks like this project is able to be installed correctly using resource explorer.  However, when I install the project this way, it appears some components such as PWMs are not correctly configured.  

    Has TI actually tested this project for the "F28384DPTPQR" processor? 

  • It has tested with F28388D controlCard. You may need to change some files according to F28384DPTPQR, maybe only .cmd file for memory and etherCAT is not supported on F28384DPTPQR. Seems like the other peripherals on F28384DPTPQR should be the same as F28388D.

    Could you please provide more details about the issues you mentioned above? How do you change the example for F28384DPTPQR?

  • Hi Yanming,

    I have only made changes inside the TMS320F28388D.ccxml file.  I have not changed any other files.  

  • it appears some components such as PWMs are not correctly configured.  

    Any details about this? Seems like there is no such issues as you mentioned above if just change the device from F28388D to F28384D.

  • Hi Yanming,

    When I check the PWM outputs of the DSP with a scope, they are not switching at all. So I would be looking for someone to hop on a video call to walk the code and see where the PWM outputs are enabled, to make sure the project does not have a bug of some sort.  

  • Do you take a look at the application reports as the below links which can be found in the folder of "C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\tmdxiddk379d\docs". Please note that the examples is based on the TI EVM kits (TMDXIDDK379D + TMDSCNCD28388D), and can run the motor well on the TI kits. You need to make some changes on the device configuration if you want to run the code on your own board.

    Quick Response Control of PMSM Using Fast Current Loop

    https://www.ti.com/lit/spracl1

    EtherCAT-Based Connected Servo Drive Using Fast Current Loop on PMSM

    https://www.ti.com/lit/spracm9b

  • Hi Yanming,

    Yes, I read this documentation, however it is not really applicable here.  The issue we are having here is not an understanding of how a motor controller works, but an issue with the low level driver configuration with CCS on this chip.  We have not even reached the point were we are debugging any of the higher level app code described in these manuals.  

    We have a similar design that is running already with a non-TI processor and have been trying to review how we second source TI.  Our long-term goal is to port this code over to the C2000 as well, but we were hoping the demo-code could allow us to accelerate this process.    

  • Hi Paul,

    We have moved this thread over to another expert for assistance, however, they are out of office this week. Please expect a reply by Monday at the latest

    Regards,

    Peter

  • Hi Paul,

    Are you using different device pins/signals for the PWM generation on your custom board? If so you'll need to make changes to the pin/signal configuration in the sub-functions of main(). See the initialization functions after line 763 (// GPIO Configuration).

    If you're new to C2000 it may be better to start with the simpler PWM software examples in C2000WARE install. Directory below for your convenience.

    C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2838x\examples\c28x\epwm

    Best,

    Kevin

  • Hi Kevin,

    No, I am using EPWM 1-6 (12 total PWMs).  The demo code does not output at any of these PWMs.  

  • Hi Paul,

    The demo code does not output at any of these PWMs.  

    Which demo code specifically? And if one of the IDDK examples which build level are you using?

    I'd recommend using the C2000WARE software examples to start with something simpler and work on seeing some ePWM signal outputs at least. This would verify HW too.

    Alternatively the Module 7 Control Peripherals section goes over the ePWM module details and has an accompanying SW example.

    https://dev.ti.com/tirex/explore/node?node=AOpze8ebskysmgASY3VKSA__jEBbtmC__LATEST

    Best,

    Kevin