Jump to content

Missing GPIO on Armbian for BananaPI M2B


WernherVonData
Go to solution Solved by WernherVonData,

Recommended Posts

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 by WernherVonData
Link to comment
Share on other sites

  • Solution

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines