cancel
Showing results for 
Search instead for 
Did you mean: 

Why the "/sys/class/gpio" can't work on STM32MP157C-DK2?

zqizh.1
Associate II

Hi,

I test commands

"

echo 97 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio97/direction

echo 1 > /sys/class/gpio/gpio97/value

echo 0 > /sys/class/gpio/gpio97/value

", the value on the pin PD.1 can't change.

Test command:

"

 gpioset gpiochip3 1=1

 gpioset gpiochip3 1=0

" the value on the pin PD.1 can change.

Please advise how to solve the issue on "/sys/class/gpio".

Thanks,

QiZhang

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

Hi @zqizh.1​ ,

OpenSTLinux is not supporting /sys/class/gpio but only the /dev/gpiochip* devices together with libgpiod.

See https://wiki.st.com/stm32mpu/wiki/How_to_control_a_GPIO_in_userspace

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Olivier GALLIEN
ST Employee

Hi @zqizh.1​ ,

OpenSTLinux is not supporting /sys/class/gpio but only the /dev/gpiochip* devices together with libgpiod.

See https://wiki.st.com/stm32mpu/wiki/How_to_control_a_GPIO_in_userspace

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.