2024-05-30 08:52 AM
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,
2024-05-31 05:04 AM
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.
2024-05-31 07:25 AM
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.