AnsweredAssumed Answered

gpio on bf537 stamp

Question asked by feucom on Mar 23, 2012
Latest reply on Mar 28, 2012 by Aaronwu

Hi all,

I need some help to maintain gpio on my bf537 stamp board.

I'm trying to enable/ access to gpio and I followed the instruction on http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gpio-sysfs&s[]=gpio&s[]=sys

entering:

root:~> echo 23 > /sys/class/gpio/export                                       
/sys/class/gpio/export: cannot create
root:~>

so I thought may be the kernel is not compiled in a way to support gpio. i checked the flags in the kernel settings:

[*] GPIO Support  --->
--- GPIO Support │ │ 
│ │ [ ]   Debug GPIO calls                                           │ │ 
│ │ [*]   /sys/class/gpio/... (sysfs interface)        

 

compiled it and loaded it to the stamp board, however still the same result.

 

the contend of the /sys/class directory is:

root:~> cd /sys/class                                                          
root:/sys/class> ls -la
drwxr-xr-x   11 root     root            0 Jan  1  2007 .                      
drwxr-xr-x   11 root     root            0 Jan  1  2007 ..                     
drwxr-xr-x    2 root     root            0 Jan  1  2007 hwmon                  
drwxr-xr-x    2 root     root            0 Jan  1  2007 input                  
drwxr-xr-x   11 root     root            0 Jan  1  2007 mem                    
drwxr-xr-x    3 root     root            0 Jan  1  2007 misc                   
drwxr-xr-x    4 root     root            0 Jan  1  2007 net                    
drwxr-xr-x    3 root     root            0 Jan  1  2007 rtc                    
drwxr-xr-x    3 root     root            0 Jan  1  2007 rtc-dev                
drwxr-xr-x    3 root     root            0 Jan  1  2007 spi_master             
drwxr-xr-x    6 root     root            0 Jan  1  2007 tty                    
root:/sys/class>

 

even with the new kernel uImage no gpio directory

 

trying:

root:/sys/class> touch foo
touch: foo: Permission denied
root:/sys/class>

 

first question: I don't have permission to this directory, why and what should I do? I tried the test program (ppifcd-test/gpio.c)

-->error message no access

2nd question: after new compilation, i would expect a directory /sys/class/gpio at least. what goes wrong (any jumper on my board?)

 

might be due to the fact that the directory is busy...?  since i'm root anyway, i should have write-access everywhere.

 

can somebody tell me what I'm missed.

 

getting an answer would be nice

 

thanks in advance

 

 

ralph

Outcomes