Skip to main content
Visitor II
May 30, 2024
Question

STM32MP1 userspace GPIO control

  • May 30, 2024
  • 1 reply
  • 1092 views

Hello everyone,

 

I was attempting to migrate my existing raspberry pi application for GPIO control to the STM32MP157 but I encountered a roadblock. I was using gpiod to drive the pins from the userspace app but the following guide:

https://wiki.stmicroelectronics.cn/stm32mpu/wiki/How_to_control_a_GPIO_in_userspace

doesn't mention gpiod C API at all in section 3. Is it possible to use gpiod instead of the character device? How do I add the gpiod library to the toolchain for cross compilation?

 

Thanks,

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    May 31, 2024

    Hi,

    did you have a look to https://wiki.st.com/stm32mpu/wiki/GPIOLib_overview ?

    I'm not expert on SW, but it seems you should migrate your C code to libgpiod.

    Regards.

    Visitor II
    May 31, 2024

    The GPIOLib overview that you provided states that libgpiod is supported so I investigated little further and here is what I found:

    My code was using libgpiod library version < 2, but newer distributions (like openstlinux-6.1) have updated to version > 2. The libgpiod2 API is completely different. I followed the examples to migrate to new version:

    https://github.com/warthog618/libgpiod/tree/master/examples

    But thanks for directions, it helped me to zero in on my problem.