WernherVonData Posted July 19, 2023 Posted July 19, 2023 (edited) Hi, Just started playing with BananaPi (I have M2Berry model) and installed Armbian from Armbian download page: Armbian_23.5.2_Bananapim2ultra_bookworm_current_6.1.30_minimal (connecting with board over UART/SSH - no need for desktop at this moment). Wanted to use GPIO, however using sysfs do not work as expected: root@bananapim2ultra:~# echo "24" > /sys/class/gpio/export -bash: echo: write error: Unknown error 517 root@bananapim2ultra:~# echo "24" > /sys/class/gpio/export -bash: echo: write error: Device or resource busy Went with lsmod to check modules but having only: root@bananapim2ultra:~# lsmod | grep gp gpu_sched 28672 1 lima Same for modprobe: root@bananapim2ultra:~# modprobe gpio modprobe: FATAL: Module gpio not found in directory /lib/modules/6.1.30-sunxi It looks like the kernel do not have gpio module, which is really strange since the GPIO is main feature for such boards. Running armbian-config - maybe I will find something. Can somebody help me out a little with it? Edited July 19, 2023 by WernherVonData 0 Quote
Solution WernherVonData Posted July 21, 2023 Author Solution Posted July 21, 2023 Never mind. Solved it. Went here: https://linux-sunxi.org/GPIO (this image is on sunxi kernel, probably for other kernels it might be different). Checked this file cat /sys/kernel/debug/pinctrl/*/pinmux-pins And there finally I was able to know which pin on the board is mapped to which port in the system. 24 is not on that list, thus it was raising an error. Then just went with the libgpiod library and the magic happened. 0 Quote
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.