Problem configuring duty cycle in devicetree
Hello,
I am trying to configure a PWM in the boot process. I followed the steps in the documentation https://wiki.st.com/stm32mpu/wiki/TIM_device_tree_configuration .
I configured the pwmleds node
pwmleds {
compatible = "pwm-leds";
example {
label = "stm32-pwm-leds-example";
/* Use pwm1 channel 0 (e.g. TIM1_CH1) */
/* period in nanoseconds (500000), normal polarity (0) */
pwms = <&pwm1 0 30518 0>;
max-brightness = <255>;
};
};/* 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"; }; };
I run the command cat /sys/kernel/debug/pwm
I see the next line
pwm-0 (example :( requested enabled period: 30518 ns duty: 0 ns polarity: normal
The period is OK, but the duty cycle is 0, so basically the signal is always low.
How can I configure the duty cycle in the devicetree if I want to have the pwm working well in the boot process?
I am in the 6.1 kernel version in the mickledore branch.
Regards, @obedPH
