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/AM5728: PWM configuration issue

Part Number: AM5728
Other Parts Discussed in Thread: TMDSEVM572X

Tool/software: Linux

we have LED's connected to ehrpwm1a,ehrpwm1b and ehrpwm3a, using pinmux tool generated files, updated the mux_data.h in the respective u boot folder to configure the padconf register, and enabled the corresponding pwm's in dts i.e

&epwmssx {
    status = "okay";
};
&ehrpwmx {
    status = "okay";
    };
where x - 1,2,3

upon boot up 3 folders pwmchip0,pwmchip2 and pwmchip4 were created under /sys/class/pwm

After exporting the corresponding pwm device, when I try to write to any of the files like duty_cycle, period, enable, getting error

-sh: echo: write error: Invalid argument, the backlight which is connected to ehrpwm2a is working without any issues,

how to debug further?

  • Hi Siva,

    Do you use AM572x TI board or custom board? Do you use AM57x TI PSDK? If yes, which version?

    Please check and align to below guidelines:

    downloads.ti.com/.../Foundational_Components_Kernel_Users_Guide.html
    downloads.ti.com/.../Foundational_Components_Kernel_Drivers.html

    processors.wiki.ti.com/.../Linux_Core_PWM_User's_Guide

    Regards,
    Pavel
  • we are using am57xx gp evm board.

    PSDK version 05_00_00_15

    Already in alignment with the guideline listed above

    checked the file /sys/kernel/debug/pinctrl/4a003400.pinmux/pins, which outputs

    pin 89 (PIN89) 4a003564 0001000a pinctrl-single, which indicates that the CTRL_CORE_PAD_VIN2A_VSYNC0 is configured for the pwm1a. 

    above described issue persists.

    Regards,

    Siva

  • Siva,

    From what I am able to understand, you are using TMDSEVM572X, but you have made HW and SW changes, is that correct?

    Can you attach your full DTS file (i.e. am57xx-evm-common.dtso) for review?

    What is the output of the below commands?
    $ cat /sys/class/pwm/pwmchip1/
    $ cat /sys/class/pwm/pwmchip2/

    $ cat /sys/class/pwm/pwmchip1/export
    $ cat /sys/class/pwm/pwmchip2/export

    $ cat /sys/class/pwm/pwmchip1/pwm1/
    $ cat /sys/class/pwm/pwmchip2/pwm2/

    I think that only enable ehrpwm2 is not enough, but you need to describe how this ehrpwm2 is connected to the LED. See for example how ehrpwm1 connection with LCD backlight is described:

    lcd_bl: backlight {
    compatible = "pwm-backlight";
    brightness-levels = <0 243 245 247 249 251 252 253 255>;
    default-brightness-level = <8>;
    pwms = <&ehrpwm1 0 50000 0>;
    };

    Make sure also you are aligned with below files:

    linux-4.14.40/Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt
    linux-4.14.40/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt

    Regards,
    Pavel