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.

TMS320F28377D: Porting Working Application Code from TMS320F28377S to TMS320F28377D

Part Number: TMS320F28377D
Other Parts Discussed in Thread: TMS320F28377S,

My customer asks the following question..

"I am working on porting some working application code from the TMS320F28377S to the TMS320F28377D.  I am now getting an error returned from the SFO() routine to calibrate the HRPWM.  As some of the EPWM modules are being used by CPU2, I suspect the SFO function cannot access them.

The HRPWM section of the reference manual contains the following variables used the SFO() routine.

int MEP_ScaleFactor = 0; //scale factor value

volatile struct EPWM_REGS *ePWM[] = {0, &EPwm1Regs, &EPwm2Regs, &EPwm3Regs, &EPwm4Regs};

It looks like the ePWM array might tell the routine which EPWM modules to use, but I cannot find any documentation on how to configure for a specific application.  In our case, we are using EPWM1, 2, 4, 5, 7, and 8 on CPU2 and EPWM3 on CPU1.  Could this be the cause of the SFO() error, or is it likely another issue? "

Thanks, Merril

  • No I bet that is the problem. When the SFO completes its calibration, using EPWM1. it will update the regs in all EPWMs. Since some EPWMs are owned by CPU2, this causes an issue. The SFO lib only runs on CPU1. 

  • Hi Team C2000,

    Customer asks.. "Does TI have a solution for allowing CPU1 to calibrate the HRPWM when CPU2 owns 1 or more of the PWM peripherals?"

    Thanks, Merril

  • We do not have an example but I can follow up to see what steps need to be followed for this to take place.

    Nima Eskandari
  • HRPWM feature is only available on CPU1. The ePWMs using HR must be assigned to CPU1. This is mentioned in the TRM. I searched around, asking design if there is a way around this and it seems like the answer is no.
  • Hi Nimi,

    Thanks.. the actual customer scenario/use-case/question is as follows..

    "We understand that the HRPWM can only be used on CPU1. However, our specific question is related to two *separate* ePWMs. For example:

    CPU1 owns ePWM3
    CPU2 owns ePWM1
    CPU1 tries to calibrate ePWM3 using the SFO() provided library
    CPU1 crashes because rather than the library just calibrating ePWM3, it tries to calibrate *all* PWMs, even ePWM1, which it doesn’t own."

    Thanks, Merril

  • Okay Newman,

    I researched your question and studied the SFO library.

    1. Do not use HRPWM on any PWM assigned to CPU2.

    2. EPWM1 must be assigned to CPU1 and will be used for SFO Calibration.

    3. Also as shown in the code below. The structure you pass to HRPWM SFO LIB should be defined like below, with EPWM1Regs as the zero-index element.

    int MEP_ScaleFactor; // Global variable used by the SFO library
                         // Result can be used for all HRPWM channels
                         // This variable is also copied to HRMSTEP
                         // register by SFO() function.
    
    //
    // Array of pointers to EPwm register structures:
    // *ePWM[0] is defined as dummy value not used in the example
    //
    volatile struct EPWM_REGS *ePWM[PWM_CH] =
                 {  &EPwm1Regs, &EPwm1Regs, &EPwm2Regs, &EPwm3Regs, &EPwm4Regs,
                    &EPwm5Regs, &EPwm6Regs, &EPwm7Regs, &EPwm8Regs};
    

  • Hi Nima,

    I'm one of the engineers who brought up this issue.  So, my interpretation of your information is as follows:

    With the library, EPWM1 *must* be on CPU1 if we want to do any HRPWMs at all.  In our current implementation, EPWM1 is needed by CPU2 due to our present hardware layout and necessary software segmentation.  I take it we would then need to redo the hardware layout to use a different EPWM?

    If my interpretation is correct, is there any way TI can change the SFO library to calibrate using the first PWM listed in the data structure rather than EPWM1?

    For all of this information, there needs to be a notice, big red flag, something in the Technical Reference Manual in the HRPWM chapter stating that:

    A. The HRPWMs can only be run on CPU1.

    B. You must have EPWM1 tied to CPU1 for the SFO to work.

    Regards,

    Jeremy Overesch

  • The HRPWM is mentioned to only be available on CPU1.

    With that said we are working on changing the SFO library and have been looking at what we can do to make the SFO more user friendly.

    I will try to see if I can change the SFO to use other EPWMs to calibrate the HR module. I will repost here if I i find any result that would be of help to you.