Skip to main content
zqizh.1
Associate III
June 11, 2021
Solved

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

  • June 11, 2021
  • 1 reply
  • 1080 views

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

This topic has been closed for replies.
Best answer by Olivier GALLIEN

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

1 reply

Olivier GALLIEN
Olivier GALLIENBest answer
Technical Moderator
June 14, 2021

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.