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.

F29H85X-SOM-EVM: Code stuck in infinite loop in SFO() function

Part Number: F29H85X-SOM-EVM

Tool/software:

HI,

I am trying to make HRPWM work. My code is getting stuck in infinite loop in SFO() function and it does not return anything.

What could be possible reasons for SFO function to go into infinite loop?

Please let me know if you need any other information to understand the root cause.

Thanks,

Mukul

  • Hi Mukul,

    Were you able to try to run our HRPWM example for F29x?

    By the sounds of it, seems that for some reason the SFO library is not able to complete the calibration. Are you calling on SFO library after device initialization? 

    Best regards,

    Ryan Ma

  • Hi Ryan,

    yes I am able to run TI example.

    Yes, I am calling SFO after device init only.

    Thanks,

    Mukul

  • Hi Mukul,

    Does the example hang in the SFO function? 

    What might be different between the example, and where you are seeing the issue? Are you seeing the issue in your personal project?

    Best regards,

    Ryan Ma

  • Hi Ryan,

    I've compared my code with the TI example and couldn't find any significant differences. I am now able to reproduce the issue with the TI example as well.

    In both cases, the code does not get stuck inside the SFO function itself, but rather in the while loop that checks the status:

    while (status == SFO_INCOMPLETE)

    For both my code and the TI example, the calibration never completes—status always remains 0 (SFO_INCOMPLETE). Here’s the relevant section from my code:

    gHrpwmCal_base = HRPWMCAL1_BASE;
    do {
        status = SFO();
    } while (status == 0);

    I’m not sure what changed, but now this issue is occurring in both cases. Please see the attached image for reference.

    Thanks,
    Mukul
  • Hi Mukul,

    I am testing with F29x 1.02.00, and I am unable to replicate the issue.

    How are you able to reproduce the issue? Could you show the exact code that is able to reproduce the issue with the TI Example?

    Can you try setting a breakpoint in the for loop that is writing to the timebase period? Are you not able to reach this?

    Best regards,

    Ryan Ma