cancel
Showing results for 
Search instead for 
Did you mean: 

Can't control a second PWM from sysfs (TIM4_CH4 / PD15), although I can control (TIM1_CH1 / PE9). (on stm32mp157c-dk2)

BJola.1
Associate II

Hello,

I try to make a simple PWM work on PD15 with TIM4_PWM4, wich normally output the PWM on D6, the 6th pin of CN14. I followed example of https://wiki.st.com/stm32mpu/wiki/PWM_overview as I only need two PWM controlled with sysfs (the first beeing PE9 like in the example).

For a reason I don't understand doing the same with TIM4CH4 don't work. Do someone have any idea what is laking in my configuration of TIM4CH4 ?

Here is my device tree :

stm32mp157c-dk2.dts

/* PWM DT provider on TIM1: "pwm1" */
&timers1 {
	status = "okay";
	/* spare all DMA channels since they are not needed for PWM output */
	/delete-property/dmas;
	/delete-property/dma-names;
	/* define pwm1 label */
	pwm1: pwm {
		/* configure PWM pins on TIM1_CH1 */
		pinctrl-0 = <&pwm1_pins_a>;
		pinctrl-1 = <&pwm1_sleep_pins_a>;
		pinctrl-names = "default", "sleep";
		/* enable PWM on TIM1 */
		status = "okay";
	};
};
 
&timers4 {
    status = "okay";
    pwm4: pwm {
		pinctrl-0 = <&pwm4_pins_a>;
		pinctrl-1 = <&pwm4_sleep_pins_a>;
		pinctrl-names = "default", "sleep";
        status = "okay";
    };
};

I also tried changing stm32mp15-pinctrl.dtsi but that didn't gave any result so I rolled back.

Did I forgot something ? Did I configured something on PE9 that I forgot to do with PD15 ?

I control PE9 with that kind of commands :

cd /sys/class/pwm
ls
cd pwmchip0/
echo 0 > export
cd pwm0/
echo 20000000 > period
echo 1500000 > duty_cycle
echo 1 > enable

A pwmchip4 appears but I don't obtain any signal in output when I configure things in it.

Thank you for any advice.

1 REPLY 1
BJola.1
Associate II

Up

(I know that the team is not complete with the holidays but I prefer to pull up the message so that it does not fall into oblivion while waiting for someone to have the time to look at it.

Because I still can't figure out why it don't work. If you need any other information on the problem I'll be happy to inform you.)

Have a nice day.