gpioset: error setting the GPIO line values: Device or resource busy

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

Gaston
Posts: 28
Joined: Fri May 10, 2019 12:21 pm

gpioset: error setting the GPIO line values: Device or resource busy

Fri Sep 06, 2019 1:06 pm

I am using Linux distribution on my SAMA5D27 embedded Board.I am also using LIBGPIOD library to manipulate GPIOS configurations of the board. First, I can list all the lines of specified gpiochips, their names, consumers, direction, active state with

Code: Select all

gpioinfo
command, and this shows me :

Code: Select all

gpiochip0 - 128 lines:
        line   0:        "PA0"       unused   input  active-high 
        line   1:        "PA1"       unused   input  active-high 
        line   2:        "PA2"       unused   input  active-high 
        line   3:        "PA3"       unused   input  active-high 
        line   4:        "PA4"       unused   input  active-high 
        line   5:        "PA5"       unused   input  active-high 
        line   6:        "PA6"       unused   input  active-high 
        line   7:        "PA7"       unused   input  active-high 
        line   8:        "PA8"       unused   input  active-high 
        line   9:        "PA9"       unused   input  active-high 
        line  10:       "PA10"        "red"  output  active-high [used]
        line  11:       "PA11"       unused   input  active-high 
...
For my work, I want to let "PA10" GPIO PIN for personal use, this pin referres to RED Led. But whatever command dedicated to manipulate "PA10" GPIO PIN it shows me :
error setting the GPIO line values: Device or resource busy
I Think that is beacause it's shown as [USED] in front of it's line.

Is there a way to make it UNUSED ? To make it free so i can manipulate it ?
blue_z
Location: USA
Posts: 1954
Joined: Thu Apr 19, 2007 10:15 pm

Re: gpioset: error setting the GPIO line values: Device or resource busy

Sat Sep 07, 2019 1:08 am

Your post makes no sense.

If there is actually a red LED connected to that GPIO on your board, then (that aspect of) the board configuration is correct, and the Linux preference is to use the sysfs interface to control that LED (instead of a generic gpio API). A link to that Linux LED API was provided to you several weeks ago.
The preference is based on using a device name (that abstracts yet identifies the HW and is portable) rather than a hardware-based identifier/number that is board-specific. (The entire /dev directory is an abstraction for the hardware, yet some people still want to revert back to primitive board and HW-specific references!)

If there is no red LED connected to that GPIO on your "SAMA5D27 embedded Board", then you are using an incorrect board configuration!

Regards
Gaston
Posts: 28
Joined: Fri May 10, 2019 12:21 pm

Re: gpioset: error setting the GPIO line values: Device or resource busy

Tue Sep 10, 2019 5:23 pm

For those who are maybe stuck as i was in this problem. The solution is to make a patch to the device tree so you can edit it. Put what you want to make it unused into comments and rebuild your kernel. :D

Return to “LINUX”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests