Unable to get PWM output
Posted: 2025-05-22 21:27
Device: Luckfox Pico Pro Max
PWM Device: PWM5_M1, Pin 72
I am trying to get PWM to work on my device, but even though I am confident I have followed instructions correctly, I am not getting any PWM output.
I am able to export the PWM5 pin, which then gives me the additional PWM properties:
```
[root@luckfox ]# ls /sys/class/pwm/pwmchip5/pwm0
capture enable period power
duty_cycle output_type polarity uevent
```
I am sure it is enabled, and configured:
```
[root@luckfox ]# cat /sys/class/pwm/pwmchip5/pwm0/enable
1
[root@luckfox ]# cat /sys/class/pwm/pwmchip5/pwm0/period
1000000
[root@luckfox ]# cat /sys/class/pwm/pwmchip5/pwm0/duty_cycle
100000
```
However, when I put a multimeter probe (I know, not the best tool) on the pin, it seems to sit, unwavering, at the tri-state voltage of approx 0.7V. No matter what duty cycle or period I configure, nothing changes on the output. I have the output hooked up to an LCD screen backlight, and the backlight never changes.
As a sanity check, I manually implemented PWM using python-periphery and GPIO, and I am able to affect the brightness of the screen, and the multimeter reflected the change in duty cycle.
I am running a buildroot OS that I built myself, but I didn't modify any device trees. SPI and GPIO are working just fine. I've turned off all peripherals which might be affecting the output.
Please, can I get some help? Thank you.
/etc/luckfox.cfg
```
SPI0_M0_CS_ENABLE=1
SPI0_M0_MODE=1
SPI0_M0_STATUS=1
SPI0_M0_MISO_ENABLE=0
SPI0_M0_SPEED=40000000
CSI_ENABLE=1
UART4_M1_STATUS=0
PWM11_M1_STATUS=0
PWM10_M1_STATUS=0
PWM9_M1_STATUS=0
PWM8_M1_STATUS=0
PWM0_M1_STATUS=0
PWM11_M2_STATUS=0
I2C3_M1_STATUS=0
I2C3_M1_SPEED=0
I2C1_M1_STATUS=0
I2C1_M1_SPEED=0
PWM5_M1_STATUS=1
UART1_M1_STATUS=0
UART3_M1_STATUS=0
UART0_M1_STATUS=0
```
PWM Device: PWM5_M1, Pin 72
I am trying to get PWM to work on my device, but even though I am confident I have followed instructions correctly, I am not getting any PWM output.
I am able to export the PWM5 pin, which then gives me the additional PWM properties:
```
[root@luckfox ]# ls /sys/class/pwm/pwmchip5/pwm0
capture enable period power
duty_cycle output_type polarity uevent
```
I am sure it is enabled, and configured:
```
[root@luckfox ]# cat /sys/class/pwm/pwmchip5/pwm0/enable
1
[root@luckfox ]# cat /sys/class/pwm/pwmchip5/pwm0/period
1000000
[root@luckfox ]# cat /sys/class/pwm/pwmchip5/pwm0/duty_cycle
100000
```
However, when I put a multimeter probe (I know, not the best tool) on the pin, it seems to sit, unwavering, at the tri-state voltage of approx 0.7V. No matter what duty cycle or period I configure, nothing changes on the output. I have the output hooked up to an LCD screen backlight, and the backlight never changes.
As a sanity check, I manually implemented PWM using python-periphery and GPIO, and I am able to affect the brightness of the screen, and the multimeter reflected the change in duty cycle.
I am running a buildroot OS that I built myself, but I didn't modify any device trees. SPI and GPIO are working just fine. I've turned off all peripherals which might be affecting the output.
Please, can I get some help? Thank you.
/etc/luckfox.cfg
```
SPI0_M0_CS_ENABLE=1
SPI0_M0_MODE=1
SPI0_M0_STATUS=1
SPI0_M0_MISO_ENABLE=0
SPI0_M0_SPEED=40000000
CSI_ENABLE=1
UART4_M1_STATUS=0
PWM11_M1_STATUS=0
PWM10_M1_STATUS=0
PWM9_M1_STATUS=0
PWM8_M1_STATUS=0
PWM0_M1_STATUS=0
PWM11_M2_STATUS=0
I2C3_M1_STATUS=0
I2C3_M1_SPEED=0
I2C1_M1_STATUS=0
I2C1_M1_SPEED=0
PWM5_M1_STATUS=1
UART1_M1_STATUS=0
UART3_M1_STATUS=0
UART0_M1_STATUS=0
```