Greetings!!
I am running latest version of stable bookworm on a rock pi s board.
I need to enable PWM1. I tried enabling it using rsetup.
But, I don’t see any PWM1 option showing. How to resolve this? Please suggest. Thank you!
Enabling PWM1 on bookworm image running on a rock pi s
I used the rockpis_debian_buster_server_arm64_20210924_0412-gpt.img.gz
Install Libmraa
rock@rockpis:~$ export DISTRO=buster-stable # for Buster
rock@rockpis:~$ echo "deb http://apt.radxa.com/$DISTRO/ ${DISTRO%-*} main" | sudo tee -a /etc/apt/sources.list.d/apt-radxa-com.list
rock@rockpis:~$ wget -O - apt.radxa.com/buster-testing/public.key | sudo apt-key add -
rock@rockpis:~$ sudo apt-get update
rock@rockpis:~$ sudo apt-get install -y rockchip-overlay libmraa # libmraa version: >=0.4
rock@rockpis:~$ sudo apt-get install -y linux-4.4-rock-pi-s-latest # ROCK Pi S kernel version: >= 4.4.143-47
with /boot/uEnv.txt
verbosity=7
fdtfile=rockchip/rk3308-rock-pi-s.dtb
overlays=rk3308-pwm1 rk3308-pwm2 rk3308-pwm3
rootuuid=2a975457-7408-4fda-bd37-22b8d2df5b6f
initrdsize=0x5caa89
kernelversion=4.4.143-69-rockchip-g8ccef796d27d
initrdimg=initrd.img-4.4.143-69-rockchip-g8ccef796d27d
kernelimg=vmlinuz-4.4.143-69-rockchip-g8ccef796d27d
import mraa
import time
# initialise PWM
x = mraa.Pwm(2)
# set PWM period
x.period_us(700)
# enable PWM
x.enable(True)
value= 0.0
while True:
# write PWM value
x.write(value)
time.sleep(0.05)
value = value + 0.01
if value >= 1:
value = 0.0
and PWM2 Works
Thank you for a detailed response, @AdamHo.
Yes, PWM1 works with the older image that is based on kernel version 4.4.
However, I am trying to use the latest stable image that includes kernel version 6. With that version, PWM1 is not working. Although PWM2 and PWM3 are working fine.