This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

User LEDs in AM335x starter kit Linux SDK

HI all,

I am trying to access the user leds in starter kit through following commands,

error getting as "resouce busy". when i try to export the pin 50 it works fine for  export, unexport, change value, direction.

I am not able to export the pins of LED for usr.

 there is no "value" file for thease LEDs.

Is it the case that i can not export them?

i was able to make the LED glow using Brightness file (brightness value other than 0).

Other thing how to set the super user in debug, when board is connected to pc thr ttyUSB1 interface.

error while setting the su mode.

please find the log file:

                                                                                
 _____                    _____           _         _                          
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_                        
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|                       
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|                         
              |___|                    |___|                                   
                                                                                
Arago Project http://arago-project.org am335x-evm ttyO0                        
                                                                               
Arago 2013.12 am335x-evm ttyO0                                                  
                                                                               
am335x-evm login: root                                                         
root@am335x-evm:~# echo 36 > /sys/class/gpio/export                             
-sh: echo: write error: Device or resource busy
                                
root@am335x-evm:~# echo 50  > /sys/class/gpio/export                           
root@am335x-evm:~# echo "out" > /sys/class/gpio/gpio50/direction               
root@am335x-evm:~# echo 1 > /sys/class/gpio/gpio50/value                       
root@am335x-evm:~# echo 0 > /sys/class/gpio/gpio50/value                       


root@am335x-evm:~# echo 37 > /sys/class/gpio/export                             
-sh: echo: write error: Device or resource busy                                
root@am335x-evm:~# echo 38 > /sys/class/gpio/export                            
-sh: echo: write error: Device or resource busy                                
root@am335x-evm:~# echo 39 > /sys/class/gpio/export                            
-sh: echo: write error: Device or resource busy                                


root@am335x-evm:~# echo 50  > /sys/class/gpio/unexport                         

root@am335x-evm:~# cd ..                                                       
root@am335x-evm:/home# cd ..                                                   
root@am335x-evm:/# echo 38 > /sys/class/gpio/export                            
-sh: echo: write error: Device or resource busy                                
root@am335x-evm:/# sudo echo 38 > /sys/class/gpio/export                       
-sh: sudo: command not found                                                   
root@am335x-evm:/# su echo 38 > /sys/class/gpio/export                         
Unknown id: echo                                                               
root@am335x-evm:/# su "echo 38 > /sys/class/gpio/export"                       
Unknown id: echo 38 > /sys/class/gpio/export                                    


root@am335x-evm:/# cd sys                                                      
root@am335x-evm:/sys# cd class                                                 
root@am335x-evm:/sys/class# cd gpio                                             
root@am335x-evm:/sys/class/gpio# echo 50  > /sys/class/gpio/export
root@am335x-evm:/sys/class/gpio# ls                                            
export      gpio50      gpiochip0   gpiochip32  gpiochip64  gpiochip96  unexport

root@am335x-evm:/sys/class/gpio# cd gpio50                                     
root@am335x-evm:/sys/class/gpio/gpio50# ls                                     
active_low  direction   edge        power       subsystem   uevent      value  
root@am335x-evm:/sys/class/gpio/gpio50# echo direction                         
direction                                                                      
root@am335x-evm:/sys/class/gpio/gpio50# cat direction                          
out                                                                             
root@am335x-evm:/sys/class/gpio/gpio50# cat value                              
0                                                                              
root@am335x-evm:/sys/class/gpio/gpio50# echo 1 > value                         
root@am335x-evm:/sys/class/gpio/gpio50# echo out > direction                   
root@am335x-evm:/sys/class/gpio/gpio50# cat direction                          
out                                                                             
root@am335x-evm:/sys/class/gpio/gpio50# echo 0 > value                         
root@am335x-evm:/sys/class/gpio/gpio50# cat value                              
0                                                                               
root@am335x-evm:/sys/class/gpio/gpio50# echo 1 > value                         
root@am335x-evm:/sys/class/gpio/gpio50# cat value                              
1                                                                              


root@am335x-evm:/sys/class/gpio/gpio50# cd ..                                  
root@am335x-evm:/sys/class/gpio# echo 36 > /sys/class/gpio/export              
-sh: echo: write error: Device or resource busy                                


root@am335x-evm:/sys/class/gpio# cd ..                                         

root@am335x-evm:/sys/class# cd leds/                                           
root@am335x-evm:/sys/class/leds# ls                                            
evmsk:green:heartbeat  evmsk:green:usr0                                        
evmsk:green:mmc0       evmsk:green:usr1                                        

root@am335x-evm:/sys/class/leds# cd evmsk\:green\:usr0                         

root@am335x-evm:/sys/class/leds/evmsk:green:usr0# ls                           
brightness      max_brightness  subsystem       uevent                         
device          power           trigger                                        

root@am335x-evm:/sys/class/leds/evmsk:green:usr0# cat max_brightness           
255                                                                            
root@am335x-evm:/sys/class/leds/evmsk:green:usr0# cat brightness               
0                                                                               

root@am335x-evm:/sys/class/leds/evmsk:green:usr0# echo 255 > brightness        
root@am335x-evm:/sys/class/leds/evmsk:green:usr0# echo 55 > brightness         
root@am335x-evm:/sys/class/leds/evmsk:green:usr0# echo 0 > brightness           
root@am335x-evm:/sys/class/leds/evmsk:green:usr0# cat trigger                  
[none] nand-disk timer oneshot heartbeat backlight gpio cpu0 default-on mmc0   

root@am335x-evm:/sys/class/leds/evmsk:green:usr0# cd ..                        

root@am335x-evm:/sys/class/leds# cd evmsk\:green\:usr1                         
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# ls                           
brightness      max_brightness  subsystem       uevent                         
device          power           trigger                                        
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# cat brightness               
0                                                                              
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# echo 20 > brightness         
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# echo 255 > brightness        
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# echo 0 > brightness          
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# cat trigger                  
[none] nand-disk timer oneshot heartbeat backlight gpio cpu0 default-on mmc0   


root@am335x-evm:/sys/class/leds/evmsk:green:usr1# cd ..                        
root@am335x-evm:/sys/class/leds# ls                                             
evmsk:green:heartbeat  evmsk:green:usr0                                        
evmsk:green:mmc0       evmsk:green:usr1                                        

root@am335x-evm:/sys/class/leds# cd evmsk\:green\:heartbeat                     
root@am335x-evm:/sys/class/leds/evmsk:green:heartbeat# ls                      
brightness      max_brightness  subsystem       uevent                         
device          power           trigger                                        
root@am335x-evm:/sys/class/leds/evmsk:green:heartbeat# cat trigger
none nand-disk timer oneshot [heartbeat] backlight gpio cpu0 default-on mmc0   

root@am335x-evm:/sys/class/leds/evmsk:green:heartbeat# cd ..                   
root@am335x-evm:/sys/class/leds# ls                                            
evmsk:green:heartbeat  evmsk:green:usr0                                        
evmsk:green:mmc0       evmsk:green:usr1                                        
root@am335x-evm:/sys/class/leds# cd evmsk\:green\:usr1                         
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# ls                           
brightness      max_brightness  subsystem       uevent                         
device          power           trigger                                         
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# cat trigger                  
[none] nand-disk timer oneshot heartbeat backlight gpio cpu0 default-on mmc0   
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# echo gpio > trigger          
root@am335x-evm:/sys/class/leds/evmsk:green:usr1# cat trigger                  
none nand-disk timer oneshot heartbeat backlight [gpio] cpu0 default-on mmc0   

                                                                            

root@am335x-evm:/sys/class/gpio# echo 37 > /sys/class/gpio/export              
-sh: echo: write error: Device or resource busy




 

  • Hi I read the following not :

    "Note: GPIO's which are used already in the drivers can not be control from sysfs, unless until driver export that
    particular pin.
    Run these commands for knowing what are the GPIO's already requested in the drivers."

    so, i am unable to export the pins because those are accessed through device driver.
    Then how to release/export the pins from device drivers???

    Please help

    Thanks in advance.