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.

TDA4VE-Q1: run into some issues when using PWM on MCU3_0

Part Number: TDA4VE-Q1


Tool/software:

Hi expert,

We confirmed with BU expert that MCU3-0 can use PWM module in the below thread.

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1397914/tda4ve-q1-use-pwm-on-the-mcu3_0

But when customer try to run PWM app on the MCU3_0, they find the core will stuck and the phenomenon is very similar with the below thread.

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1335119/j721s2xsomxevm-the-pwm-example-in-mcal-doesn-t-output-a-waveform?tisearch=e2e-sitesearch&keymatch=j721s2%20pwm#

The difference is that customer SW will stuck between pwm_init and HW_RD_REG16_RAW(). Could you please help to check what we need to configure before running PWM on MCU3_0 

Best Regards,

Xingyu Zhu

  • Hello,

    Please share me the steps on how you have configured PWM_app on MCU3_0?

    Regards

    Tarun Mukesh

  • Hi Tarun Mukesh,

    Thanks for your reply. Our customer is referring to the Demo in SDK9.2. The code is same with MCAL.

    static void Pwm_PinMux(uint32 offset, uint32 muxmode)

    {

        uint32 regVal = 0U;

        regVal = CSL_REG32_RD(CSL_CTRL_MMR0_CFG0_BASE + offset);

        regVal &= 0U;

        regVal |= muxmode;

        CSL_REG3

        return;

    }

     

    void PwmApp_PowerAndClkSrc(void)

    {

        sint32 retVal;

        /* Mcu module, when included will replace this operation */

        retVal = AppUtils_ModuleClockEnable(160U);//linfeng 20240625

        if(retVa

  • Hello,

    sorry but we don't have demo on MCU3_0 right ? If you are using MCU2_1 it won't work as it is unless you do the necessary changes.

    May i know what changes customer has done apart above ? which is also not very clear

    static void Pwm_PinMux(uint32 offset, uint32 muxmode)

    {

        uint32 regVal = 0U;

        regVal = CSL_REG32_RD(CSL_CTRL_MMR0_CFG0_BASE + offset);

        regVal &= 0U;

        regVal |= muxmode;

        CSL_REG3

        return;

    }

     

    void PwmApp_PowerAndClkSrc(void)

    {

        sint32 retVal;

        /* Mcu module, when included will replace this operation */

        retVal = AppUtils_ModuleClockEnable(160U);//linfeng 20240625

    Please share entire changes done to review.

    Regards

    Tarun Mukesh

  • Hi Tarun Mukesh,

    Compared to the demo code of MCU2_1, it can be said that ihave not changed. The I/O port multiplexing parameters are configured correctly, and we can see it in the register. 
      

    When running into Pwm_Init(), and running in the line 240, it will abort. Sometime i can see it aborted after running HW_RD_REG16_RAW() in the line 240.
      

    I can't  think of a reason. And we saw this in an other issue,  whether the J721S2 does not support PWM and others peripheral? 


    Looking forward to your reply. Thanks.

    Best regrad

  • Hi Tarun Mukesh,

    Compared to the demo code of MCU2_1, it can be said that ihave not changed. The I/O port multiplexing parameters are configured correctly, and we can see it in the register. 
      

    When running into Pwm_Init(), and running in the line 240, it will abort. I can see it aborted after running HW_RD_REG16_RAW() in the line 240 all the time.
      

    I can't  think of a reason. And we saw this in an other issue,  whether the J721S2 does not support PWM and others peripheral? 


    Looking forward to your reply. Thanks.

    Best regrad

  • Hello,

    PWM instances can be used from MCU3_0 .PWM MCU2_1 examples cannot be used on MCU3_0 .You need to create proper folder structure with respective configuration files generated from EB tresos then only we can further debug on this.

    Regards

    Tarun Mukesh

  • Hi Tarun Mukesh,

    I had been configurated files from EB, please help to see. And the code can be run normally in MCU1_0, why it doesn't work in MCU3_0? Thanks.
    Pwm_Demo_Cfg.rar

    Regards

  • Hello,

    MCU1_0 core is on MCU domain and MCU3_0 is on main domain. If the PWM instance you are using in on MCU domain then you can directly use it from MCU1_0 but if you expect to use it from MCU3_0 you need to use interrupt routing.

    Regards

    Tarun Mukesh

  • Hi Tarun Mukesh,

    How to use interrupt routing? The pwm is worked without using interrupts in J721E MCU3_0, what's the difference between them?
    This question is a bit urgent, I hope to receive a quick response.Thank!

    Best regard

  • Hi Tarun Mukesh,
    It seems that the reason is that the PWM clock is incorrect? Why can't I apply for a clock? 

    Thanks

  • Hello, 

    Sorry for the delay, i was on sick leave.

    let me explain you in detail.

    MCU1_0 is mcu domain core and since you are using EPWM0 from main domain you need to do the interrupt routing as the instance will not be directly connected to the core.

    The below attached snippet is the interrupt routing done to MCU1_0 core

    whereas the MCU3_0 is main domain core and using main domain instance EPWM0 so no need of interrupt routing. But you mentioned you have used MCU2_1 example then you shouldn't be worried about interrupt routing.

    It seems that the reason is that the PWM clock is incorrect? Why can't I apply for a clock? 

    Could you please go through this document ?

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_01_00_11/exports/docs/mcusw/mcal_drv/docs/drv_docs/design_pwm_top.html

    It is clearly mentioned here in assumptions

    The clock-source selection for PWM is not performed by the PWM driver, other entities such as SBL, MCAL module MCU shall perform the same.

     

     

    Regards

    Tarun Mukesh