Check HardwarePWM Pin
Hardware PWM had open at default dtb configuration.So you need to check which Physical pin is connect to it .
PWM_F
on VIM1 GPIO-OutPWM_D
on VIM2 GPIO-OutPWM_F
on VIM3 GPIO-Out
Switch to root user
Ordinary users cannot control GPIO, so they need to switch to the root user.
khadas@Khadas:~$ sudo -i |
Set Hardware PWM
Setup and enable PWM
VIM1/3:
root@Khadas:~# echo 1 > /sys/class/pwm/pwmchip4/export |
VIM2:
root@Khadas:~# echo 1 > /sys/class/pwm/pwmchip1/export |
If you sueccess to enable it , you can see it with oscilloscope.
Note: If you use an oscilloscope to view the waveform, remember that the board and the oscilloscope need to share the GND
Disable PWM
root@Khadas:~# echo 0 > /sys/class/pwm/pwmchip4/pwm1/enable |