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.

Linux/AM4379: SDK v5.2x can't enable PWM function

Part Number: AM4379
Other Parts Discussed in Thread: AM4372

Tool/software: Linux

Hi,

We tried to debug the PWM function in our project base on AM4379 SDK V5.x.
I added the PWM node in DTS, and I could find the SYSFS interface '/sys/class/pwm/pwmchip0'.
I configured the device referring PWM user guide, and adjusted the duty cycle, but the voltage of corresponding pin was no change.
I checked the control mode register value, the PWM function was not enable.

DTS:
myecap2_pins_default: myecap2_pins_default {
pinctrl-single,pins = <
AM4372_IOPAD(0x19c, PIN_OUTPUT_PULLUP | MUX_MODE4) /* (M24) */
>;
};
&epwmss2 {
status = "okay";
ecap2: ecap@48304100 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&myecap2_pins_default>;
};
};
The pin M24 control mode regisger offset is 99Ch, check the value is as follow:
pinmux:
root@am437x-evm:/sys/class/pwm# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins
pin 103 (PIN103) 44e1099c 08040007 pinctrl-single

dmesg:
root@am437x-evm:/sys/class/pwm# dmesg |grep ecap
[ 0.198887] pinctrl-single 44e10800.pinmux: could not add functions for myecap2_pins_default 4294965660x
Please help us analysis this issue, thanks a lot.

  • Hello,

    I would expect 0x44e1099c to have a signal mux value of 4 based on your device tree entry. However, your CAT says it has a value of 7. Do you set that pinmux address anywhere else in your device tree files, or the DTS/dtsi files that your device tree file includes?

    Regards,
    Nick
  • Hi Nick,
    Thanks for your reply.
    I checked the files which were included by DTS, it just includes am4372.dtsi, which has no change.
    I modified the register value as 0x08040004 in the UBOOT, and the function was OK, the voltage changed with duty cycle.
    But the ECAP load error still exists.

    DTS:
    #include "am4372.dtsi"
    #include <dt-bindings/pinctrl/am43xx.h>
    #include <dt-bindings/pwm/pwm.h>
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/input/input.h>

    dmesg:
    root@am437x-evm:~# dmesg |grep pinmux
    [ 0.176106] omap_i2c 4802a000.i2c: could not find pctldev for node /ocp@44000000/l4_wkup@44c00000/scm@210000/pinmux@800/my_i2c_1_pins_default, deferring probe
    [ 0.176160] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp@44000000/l4_wkup@44c00000/scm@210000/pinmux@800/my_i2c_2_pins_default, deferring probe
    [ 0.197382] pinctrl-single 44e10800.pinmux: 199 pins at pa f9e10800 size 796
    [ 0.198397] pinctrl-single 44e10800.pinmux: mux offset out of range: 0xfffff988 (0x31c)
    [ 0.198412] pinctrl-single 44e10800.pinmux: could not add functions for myecap2_pins_default 4294965640x
    [ 1.036705] pinctrl-single 44e10800.pinmux: mux offset out of range: 0xfffff950 (0x31c)
    [ 1.044918] pinctrl-single 44e10800.pinmux: could not add functions for my_spi_0_pins_default 4294965584x
    [ 1.065747] pinctrl-single 44e10800.pinmux: mux offset out of range: 0xfffff9b8 (0x31c)
    [ 1.073830] pinctrl-single 44e10800.pinmux: could not add functions for my_spi_2_pins_default 4294965688x
    [ 1.094483] pinctrl-single 44e10800.pinmux: mux offset out of range: 0xfffff8d0 (0x31c)
    [ 1.102560] pinctrl-single 44e10800.pinmux: could not add functions for my_spi_3_pins_default 4294965456x
    [ 1.123118] pinctrl-single 44e10800.pinmux: mux offset out of range: 0xfffffa50 (0x31c)
    [ 1.131186] pinctrl-single 44e10800.pinmux: could not add functions for my_spi_4_pins_default 4294965840x

  • I changed the pin setting 'AM4372_IOPAD(0x19c, PIN_OUTPUT_PULLUP | MUX_MODE4)' to 'AM4372_IOPAD(0x99c, PIN_OUTPUT_PULLUP | MUX_MODE4)' , PWM function was OK.Because the register address will minus 0x800 in the file of 'am43xx.h', included by DTS, which caused error of 'mux offset out of range'.
    This pin configuration was configured with PinMux Tool v4.0.1530, what can i do to avoid this problem.
  • To confirm, is your PWM working as expected now? If the PWM is fixed, I will pass the thread to a pinmux expert.

    Regards,
    Nick
  • Hi, Nick
    Yes, the PWM function works as expeted now, please help me to pass the thread to the pinmux expert.
    And thanks a lot for your support.

    Regards,
    Jason
  • Hello Jason,
    The 0x800 offset bug was introduced in PMT v4.0.1526 release. There is a release in progress where the bug will be fixed. It's pending publishing but it should be up in the next few days. I recommend using PMT v4.0.1522 to continue your project for now.

    Regards,
    Ahmad
  • Hi Ahmad,

    Thanks a lot for your support.