cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1 userspace GPIO control

lukaspohl86
Associate

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,

2 REPLIES 2
PatrickF
ST Employee

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.

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.

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.