QtCreator cross-compilation sysfs GPIO permissions



  • G'day,

    I've successfully built a cross-compiled Qt platform, with QtCreator deploying directly to my target Linux device (Raspberry Pi in this case).

    I'm trying to interact with GPIOs on the target device, and am having permissions issues with the SYSFS direction directory. I've read that this directory is linked to the kernel itself, which may be why I'm having issues. I've tried changing ownership of the /sys/class/gpio directory (chown -R pi:pi /sys/class/gpio), which allows me to export GPIOs when running the application from QtCreator, but I always received 'permission denied' when the application tries to set the direction of the exported GPIO(s).

    Can anyone suggest a solution to this issue?



  • I've just added a usleep(100000) line prior to setting the direction of the GPIO, and I'm no longer receiving the permission denied error (but my application is now running very slowly!). As such I don't believe I have a particular issue with QtCreator itself.

    I'll leave this up in case anyone else has a similar issue. I'll be posting on SO now to try and resolve this permission/timing issue.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.