Active PWM in VIM3 android

Hello,
I followed the steps below to enable PWM_F. But it didn’t work on my board.

echo 1 > /sys/class/pwm/pwmchip4/export
echo 1000000 >/sys/class/pwm/pwmchip4/pwm1/period
echo 500000 >/sys/class/pwm/pwmchip4/pwm1/duty_cycle
echo 1 > /sys/class/pwm/pwmchip4/pwm1/enable

refer to the link: https://docs.khadas.com/vim3/HowToUseHardwarePWM.html

Could someone tell me whether I missed anything

@ru719iz283 This Docs is use for Ubuntu , not in android . If you need to use it in android , @goenjoy @Terry and @jasonl will help you about it .

@Frank Thanks for your support. I tried it successfully in the Linux. But I still want to know how to active it in android.
@goenjoy @Terry @jasonl Could you help me on this?

@jasonl Please follow up this.

@jasonl Could you help me on this?
Or is this standard usage? Do I just need to follow the steps in the below link?
https://developer.android.com/things/sdk/pio/gpio

One more question. I want to connect the USB speaker to the VIM3 Android OS. Do I need to download the library for activing it? Or do I need to update kernel or somethings?

You can try to connect your usb speaker to the VIM3, and most usb speaker devices are supported.

@Terry Thanks for your reply.
And could you teach me how to use PWM in Android?

you can add dts cfg ,modify arch/arm/boot/dts/amlogic/kvim3.dts

 &pwm_ef {
                status = "okay";
+               pinctrl-names = "default";
+                pinctrl-0 = <&pwm_f_pins2>;
        };

then input command as follow
echo 1 > /sys/class/pwm/pwmchip4/export
echo 1000000 > /sys/class/pwm/pwmchip4/pwm1/period
echo 500000 > /sys/class/pwm/pwmchip4/pwm1/duty_cycle
echo 1 > /sys/class/pwm/pwmchip4/pwm1/enable
you will see the pwm input by oscilloscope