GPIOs not working


I have two Rock Pi S v13 boards. I am using: Armbian_22.05.0-trunk_Rockpi-s_bullseye_current_5.15.32_minimal image. My application requires higher number of GPIOs.

In armbian I am using libgpiod to control the GPIO. The issue is I can not control the following GPIOs on Header 2:
GPIO2_B5 (Always High)

This problem is also present for few Header 1 pins which includes:

The GPIOs are not controllable through sysfs also.
In shell I execute following commands as root:

cd /sys/class/gpio
echo 77 > ./export       #GPIO2_B5 Pin number
cd ./gpio77
echo out > direction
echo 1 > value

Command completes without any error, but GPIO hardware state doesn’t change. It happens in both boards so it is not a hardware issue. (GPIO2_B5 is always high after boot)

Are these pins muxed with any other driver or used by system? If so please provide Device tree overlays to disable the pin muxing and use them as GPIO.

Please provide guidance.

Please retest with our debos image first, as the Armbian image we provided is only because there is no downloadable official Armbian image for ROCK S. We don’t provide support to Armbian directly, although if an issue is confirmed to be Armbian-only and not present in our image, we might create PR for them.

Please read the release note on the download page to find out which image you should use.

Hello @RadxaYuntian ,

As suggested I tried debian image: rockpi-s-debian-buster-server-arm64-20220801-0112-gpt.img.xz

Same issue, can not control mentioned GPIOs. Although GPIO2_B5 is low by default in this image.

We will check if we can reproduce this issue.

The four pins are named as below :

@Nasca Yes, I am referring to those pins.

Can you send a picture of your board to me ?

@Nasca I think there’s some confusion on the numbering. I am considering the pins marked with the oval as the problematic mentioned pins, I just noticed the difference right now.

I consider pin numbering starting from the USB side just like Header 1 and as portrayed on GPIO Pinout page of Rock pi s. Can you please clarify the numbering convention on the headers, where we need to count pin 28?

Can you mark pin 28 for me in the pic?

Please see these two pictures as below:

Let me just check. I think I have been considering the Header 2 orientation to be same as Header 1. This is quite confusing even from official documentation. @Nasca I think these images should be included in the Pinout documentation so that people don’t get confused about orientations of Headers. The documentation specifies the header pin numbers but does not specify how headers are oriented on the board.

I will once again check GPIOs as per this orientation and let you know if I can control the GPIOs or not.

Thank you for your valuable advice, we will update wiki later.

@Nasca, I have checked the GPIO as per header 2 orientation. The pins can be controlled as intended.
Thanks for the support. I wish wiki will be updated to save trouble to other users.