2024-08-09 03:07 AM - edited 2024-08-09 06:14 AM
An simple RGB LCD panel does not show any screen or backlight.
Trying to solve that to enable the PWM backlight timer for it.
Some post followed:
https://www.kernel.org/doc/Documentation/devicetree/bindings/display/st%2Cstm32-ltdc.txt
https://community.st.com/t5/stm32-mpus-products/how-to-add-pwm-backlight-to-timer-block/td-p/213372
https://community.st.com/t5/stm32-mpus-embedded-software/pwm-backlight-not-working-can-you-please-check-my-device-tree/td-p/202199
https://community.st.com/t5/stm32-mpus-embedded-software/how-to-use-timers2-as-pwm-backlight/td-p/357071
cat /sys/kernel/debug/pinctrl/soc\:pinctrl@50002000/pinconf-pins | grep PA5
pin 5 (PA5): alternate 1 (TIM2_CH1 TIM2_ETR) - push pull - pull down - low speed
root@stm32mp1:~# cat /sys/kernel/debug/pwm
platform/40000000.timer:pwm, 4 PWM devices
pwm-0 (backlight requested enabled period: 5000000 ns duty: 5000000 ns polarity: normal
pwm-1 ((null) period: 0 ns duty: 0 ns polarity: normal
pwm-2 ((null) period: 0 ns duty: 0 ns polarity: normal
pwm-3 ((null) period: 0 ns duty: 0 ns polarity: normal
root@stm32mp1:/sys/class/pwm# ls -l
lrwxrwxrwx 1 root root 0 Aug 9 09:58 pwmchip0 -> ../../devices/platform/soc/5c007000.etzpc/40000000.timer/40000000.timer:pwm/pwm/pwmchip0
cd /sys/class/pwm/pwmchip0 (timer 1)
# select channel 1
echo 0 > export
sh: write error: Device or resource busy
DTS:
&timers2 {
status = "okay";
/* spare dmas for other usage */
/delete-property/dmas;
/delete-property/dma-names;
counter {
status = "okay";
};
pwm2: pwm {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pwm2_pins_b>;
pinctrl-1 = <&pwm2_sleep_pins_b>;
#pwm-cells = <2>;
status = "okay";
};
timer@1 {
status = "disabled";
};
};
after a reboot (p.s none of values worked, from 0 ... n
root@stm32mp1:/sys/class/pwm/pwmchip0# echo 1 > unexport
root@stm32mp1:/sys/class/pwm/pwmchip0# echo 1 > export
root@stm32mp1:/sys/class/pwm/pwmchip0/pwm1# cat enable
0
root@stm32mp1:/sys/class/pwm/pwmchip0/pwm1# echo 10000 > period
sh: write error: Device or resource busy
root@stm32mp1:/sys/class/pwm/pwmchip0/pwm1# echo 10000 > duty_cycle
sh: write error: Invalid argument
not enabled, but busy ?
Solved! Go to Solution.
2024-08-11 07:46 AM
Backlight did work, Issue was caused by a LCD pin keeping LCD backlight/PWM regulators disabled.
2024-08-11 07:46 AM
Backlight did work, Issue was caused by a LCD pin keeping LCD backlight/PWM regulators disabled.