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.

PROCESSOR-SDK-AM62A: epwm0 interface not working

Part Number: PROCESSOR-SDK-AM62A
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi,

Yocto SDK: 09_02_00

EVM: AM62A SK EVM

I wanted to use the PWM on A53 core. I have configured the PWM in dts as below:

    main_ehrpwm0_pins_default: main-ehrpwm0-pins-default {
        pinctrl-single,pins = <
            AM62AX_IOPAD(0x01ac, PIN_OUTPUT, 6) /* (B21) MCASP0_AFSR.EHRPWM0_A */
            AM62AX_IOPAD(0x01b0, PIN_OUTPUT, 6) /* (A21) MCASP0_ACLKR.EHRPWM0_B */
        >;
    };
    
&epwm0 {
   status = "okay";
   pinctrl-names = "default";
   pinctrl-0 = <&main_ehrpwm0_pins_default>;
};

And I have enabled the eHRPWM driver in kernel. Than I have probed the channel A and channel B on user expansion jumper J3 in EVK. I didn't see any signals on CRO. 

Then I have tested the epwm1 interface on evk and that was working fine on evk and can see the signals properly on the CRO. I did dts configuration as below for epwm1:

    main_ehrpwm1_pins_default: main-ehrpwm1-pins-default {
        pinctrl-single,pins = <
            AM62AX_IOPAD(0x019c, PIN_OUTPUT, 6) /* (B18) MCASP0_AXR1.EHRPWM1_A */
            AM62AX_IOPAD(0x01a0, PIN_OUTPUT, 6) /* (B20) MCASP0_AXR0.EHRPWM1_B */
        >;
    };
    
&epwm1 {
   status = "okay";
   pinctrl-names = "default";
   pinctrl-0 = <&main_ehrpwm1_pins_default>;
};
 

Do you see any wrong configuration of epwm0 interface? If configurations are right then what could be the problem?

Regards,

Jay

  • Hello Jay,

    When I plugged your pinmux settings into the sysconfig pinmux tool, I got the same results. So the pinmuxing should be fine, as long as you have verified that there are not any other pinmux settings in your devicetree file that could conflict with those settings:

    &main_pmx0 {
    	myepwm1_pins_default: myepwm1-default-pins {
    		pinctrl-single,pins = <
    			AM62AX_IOPAD(0x01ac, PIN_OUTPUT, 6) /* (B21) MCASP0_AFSR.EHRPWM0_A */
    			AM62AX_IOPAD(0x01b0, PIN_OUTPUT, 6) /* (A21) MCASP0_ACLKR.EHRPWM0_B */

    I won't have time tonight to double-check the EVM schematics to see if J3 actually connects to B21 & A21.

    How are you testing your PWM output?

    Are you at least seeing the PWM show up as expected in the terminal, as documented at https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/09_02_00/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/PWM.html ?

    Regards,

    Nick

  • Hi Nick,

    Thank you for your reply.

    Yes, I have checked that epwm0 pins are not conflicting with other pins. Also interface shows up as mentioned here. Please check below log.

    root@am62axx-evm:~# cd /sys/class/pwm/pwmchip0/
    root@am62axx-evm:/sys/class/pwm/pwmchip0# cat /sys/kernel/debug/pwm
    platform/23000000.pwm, 2 PWM devices
     pwm-0   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
     pwm-1   ((null)              ): period: 0 ns duty: 0 ns polarity: normal
    root@am62axx-evm:/sys/class/pwm/pwmchip0#
    root@am62axx-evm:/sys/class/pwm/pwmchip0# echo 0 > export
    root@am62axx-evm:/sys/class/pwm/pwmchip0# echo 1 > export
    root@am62axx-evm:/sys/class/pwm/pwmchip0#
    root@am62axx-evm:/sys/class/pwm/pwmchip0# ls
    device     export     npwm       power      pwm0       pwm1       subsystem  uevent     unexport
    root@am62axx-evm:/sys/class/pwm/pwmchip0# cd pwm0/
    root@am62axx-evm:/sys/class/pwm/pwmchip0/pwm0#
    root@am62axx-evm:/sys/class/pwm/pwmchip0/pwm0# echo 100000000 > period
    root@am62axx-evm:/sys/class/pwm/pwmchip0/pwm0# echo 30000000 > duty_cycle
    root@am62axx-evm:/sys/class/pwm/pwmchip0/pwm0# echo 1 > enable

    Let me know if there is anything wrong with this.

    Regards,

    Jay

  • Hi Nick, 

    Were you able to check epwm0 interface on EVM?

    Regards,

    Jay

  • Hello Jay,

    Thanks for the ping.

    I was not able to run tests on my EVMs before leaving for vacation, but it does look like those signals should be pinned out to the user expansion connector.

    When I check the default EVM files, I don't see any conflicts you would need to avoid - in fact, there is an overlay file k3-am62a7-sk-rpi-hdr-ehrpwm.dtso that does the exact same mapping you seem to be doing.

    I don't see anything obviously wrong from your terminal output. My best guess would be to double-check you are connected to the right header pins (I'm not sure if the pin mapping changed at all between different EVM revisions), and maybe try using an unmodified dts file and apply the overlay file in uboot just to make sure there isn't a hidden issue with your custom devicetree file.

    I'm not sure if there is official documentation of how to do this somewhere, but you can find an example of applying overlays on a different device here: https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/09_02_01_09/exports/docs/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU_ICSSG_Ethernet.html#mii-support

    FYI: setting response expectations 

    I'll be on vacation from now until July 15. If you are waiting on me for a response, feel free to ping the thread several days into that week if I have not replied.

    Regards,

    Nick