SuperMaximus Posted October 7 Share Posted October 7 (edited) Armbianmonitor: https://paste.armbian.com/obihohuzuf Hi! When I try to access PWM via procedure described here https://tinker-board.asus.com/forum/index.php?/topic/15132-direct-gpio-access/ I see that Quote pwmchip2 & Quote pwmchip3 are not present (although they should be) I can see pwmchip0, but I don't understand what GPIO it is. Following ASUS docs from GitHub https://github.com/TinkerBoard/TinkerBoard/wiki/User-Guide#gpio-config-table-for-tinker-board-s--tinker-board-s-r20 GPIO32 and GPIO33 should be here: PWM:/sys/class/pwm/pwmchip3 and PWM:/sys/class/pwm/pwmchip2 But those directories are not present. root@tinkerboard:~# ls -la /sys/class/pwm/ total 0 drwxr-xr-x 2 root root 0 Oct 7 11:47 . drwxr-xr-x 65 root root 0 Jan 1 1970 .. lrwxrwxrwx 1 root root 0 Oct 7 11:47 pwmchip0 -> ../../devices/platform/ff680000.pwm/pwm/pwmchip0 My Armbian Env is: verbosity=0 bootlogo=true console=serial overlay_prefix=rockchip overlays=i2c1 i2c4 spi2 spidev2 uart1 uart2 rootdev=UUID=7a71009a-a5f6-439f-a2d3-38574c1ea09b rootfstype=ext4 extraargs=vt.global_cursor_default=0 quiet splash plymouth.ignore-serial-consoles systemd.unified_cgroup_hierarchy=0 stdout=serial usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u Edited October 7 by SuperMaximus Added info 0 Quote Link to comment Share on other sites More sharing options...
jock Posted October 13 Share Posted October 13 Unfortunately I don't have a Tinkerboard S R2.0 but a Tinkerboard S R1.0. I took a look into the device trees and in fact I have the confirmation: for the Tinkerboard (all versions) only the pwm0 is enabled. pwm1, 2 and 3 are disabled. If you're still interested, I can provide the necessary device tree overlays to enable them selectively. 0 Quote Link to comment Share on other sites More sharing options...
SuperMaximus Posted October 13 Author Share Posted October 13 @jock I would be grateful for your help! I want to control the Waveshare 7" HDMI LCD screen brightness via this PWM. 0 Quote Link to comment Share on other sites More sharing options...
jock Posted October 13 Share Posted October 13 Here you get the pwm1, 2 and 3 overlays. Put them in /boot/dtb/rockchip/overlay directory and enable those you need in /boot/armbianEnv.txt or via armbian-config and you should get the pwm devices. rockchip-pwm1.dtbo rockchip-pwm2.dtbo rockchip-pwm3.dtbo 0 Quote Link to comment Share on other sites More sharing options...
SuperMaximus Posted October 13 Author Share Posted October 13 Thanks for your recommendation. I followed it and added pwm1, pwm2, pwm3 to my armbianEnv verbosity=0 bootlogo=true console=serial overlay_prefix=rockchip overlays=i2c1 i2c4 spi2 spidev2 uart1 uart2 pwm1 pwm2 pwm3 rootdev=UUID=7a71009a-a5f6-439f-a2d3-38574c1ea09b rootfstype=ext4 extraargs=vt.global_cursor_default=0 quiet splash plymouth.ignore-serial-consoles systemd.unified_cgroup_hierarchy=0 stdout=serial usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u And now my Tinkerboard can't boot at all. I can't even connect via SSH. Is there any way out of it? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
jock Posted October 13 Share Posted October 13 @SuperMaximus oh, that's weird, sorry for the inconvenience! You should be able to attach an usb cable to the USB micro OTG port and then to a computer: the tinkerboard will appear as a mass storage device and you should be able to revert the changes. By the way, always enable only the overlay you need. I double checked and to use pwm2 or pwm3 ,you need to disable uart2 because some pins are muxed. Anyway I see something wrong in the device tree for the tinkerboard: all 4 uarts are enabled in the base device tree, thus having the overlays to enable is not useful and, moreover, uart2 should be the debug uart which is not a good idea to disable. I need to investigate a bit in this, but I hope you will be able at least to restore functionality of the board. 0 Quote Link to comment Share on other sites More sharing options...
jock Posted October 14 Share Posted October 14 @SuperMaximus I just double checked on a pristine armbian installation on my tinkerboard and enabling pwm1, pwm2 and pwm3 does not incur in any inconvenience. All the 4 pwms are available in my case: root@tinkerboard:/sys/class/pwm# ls -lah total 0 drwxr-xr-x 2 root root 0 Oct 14 12:26 . drwxr-xr-x 66 root root 0 Oct 14 12:26 .. lrwxrwxrwx 1 root root 0 Oct 14 12:26 pwmchip0 -> ../../devices/platform/ff680000.pwm/pwm/pwmchip0 lrwxrwxrwx 1 root root 0 Oct 14 12:26 pwmchip1 -> ../../devices/platform/ff680010.pwm/pwm/pwmchip1 lrwxrwxrwx 1 root root 0 Oct 14 12:26 pwmchip2 -> ../../devices/platform/ff680020.pwm/pwm/pwmchip2 lrwxrwxrwx 1 root root 0 Oct 14 12:26 pwmchip3 -> ../../devices/platform/ff680030.pwm/pwm/pwmchip3 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.