2008-08-17 10:12:13     simple drivers problem

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-08-17 10:12:13     simple drivers problem

Pafone Lee (CHINA)

Message: 60548   

 

hi

 

i follow this doc http://docs.blackfin.uclinux.org/doku.php?id=sample_gpio_driver

 

wrote a simple gpio driver, but i still don't know how to program a application to use the driver

 

****if i want to push a key hook with PF8 to control message output via terminal, ****

 

ie. key down,   screen printf  'key down'

 

     key release , screen printf 'key released'

 

 

 

****can anyone write this driver code and application code for me , i just don't know how to do it.*****

 

i see many docs in this site, but no *the whole* simple drivers with application code is present , they only the driver or

 

too complicate for newer to learn driver.

 

thanks.

TranslateQuoteReplyEditDelete

 

 

2008-08-17 10:36:21     Re: simple drivers problem

Mike Frysinger (UNITED STATES)

Message: 60549   

 

we do not write custom applications and/or drivers for people.  we provide documentation, references, and examples.  if you need that kind of support, there are plenty of 3rd parties you can hire to assist you.  see the front page of our website for a list of some.

QuoteReplyEditDelete

 

 

2008-08-18 14:20:44     Re: simple drivers problem

Robin Getz (UNITED STATES)

Message: 60584   

 

Pafone:

 

All the examples we have are in the documentation.

 

Did you see the uClinux-dist/user/blkfin-test/pfbuttons-test/pfbuttons_test.c ? Doesn't that do what you need?

 

-Robin

QuoteReplyEditDelete

 

 

2008-08-18 22:53:29     Re: simple drivers problem

Pafone Lee (CHINA)

Message: 60616   

 

thanks , Robin and for Mike's reply

 

i found the examples in blkfin-test/ very helpful, now i have some new quession

 

first is that i select the pflag drivers as a module and recompile the kernel, then downloaded it to the target board in the /pafone directory , but i couldn't install this module bfin_paflags.ko, the error msg show as below:

 

root:/bin> cd /pafone                                                         

root:/pafone> modprobe bfin_pflags.ko                                         

modprobe: module bfin_pflags.ko not found                                     

modprobe: failed to load module bfin_pflags.ko                                

root:/pafone> ls                                                              

bfin_pflags.ko    hello             pflags_test       sample_module.ko        

root:/pafone> modprobe sample_module.ko                                       

modprobe: module sample_module.ko not found                                   

modprobe: failed to load module sample_module.ko                              

root:/pafone> insmod bfin_pflags.ko                                           

bfin_pflags: Unknown symbol _class_create_file                                

bfin_pflags: Unknown symbol _class_create                                     

bfin_pflags: Unknown symbol _device_create                                    

insmod: cannot insert 'bfin_pflags.ko': Unknown symbol in module (-1): No such y

root:/pafone> lsmod                                                           

Module                  Size  Used by                                         

root:/pafone>

 

the driver file is attached also.

 

the second quession is that if i select a driver as an module , should i download it to the board manually , or it automactily comtain in the romfs somewhere.

 

bfin_pflags.c

TranslateQuoteReplyEditDelete

 

 

2008-08-19 00:35:14     Re: simple drivers problem

Mike Frysinger (UNITED STATES)

Message: 60624   

 

do not use the bfin pflags driver.  there is a simple gpio driver that is documented and should be used instead.

QuoteReplyEditDelete

 

 

2008-08-19 01:49:34     Re: simple drivers problem

Pafone Lee (CHINA)

Message: 60629   

 

sorry , but the linux kernel i am using is uClinux-dist-2008R1RC8 , and there is no simpe-gpio driver in the menuconfig.

 

and if i change the version of linux kernel , maybe i should change the uboot and the toolchain, somewhat of wasting time.   

 

if i want to add the simple-gpio driver referenced above as a module to the kernel now i am using , what should i do .

 

by the way , can you answer my second quession in my last post ? or anyone could answer.

TranslateQuoteReplyEditDelete

 

 

2008-08-19 10:23:14     Re: simple drivers problem

Robin Getz (UNITED STATES)

Message: 60646   

 

Pafone:

 

See:

 

https://docs.blackfin.uclinux.org/doku.php?id=introduction_to_modules#module_loading

QuoteReplyEditDelete

 

 

2008-08-19 11:05:53     Re: simple drivers problem

Mike Frysinger (UNITED STATES)

Message: 60653   

 

then upgrade to 2008R1.5

QuoteReplyEditDelete

 

 

2008-08-19 16:39:45     Re: simple drivers problem

Isaac Leung (CANADA)

Message: 60677   

 

I believe the module should be contained in the romfs, you'd just have to load it after. But for simplicity, I just made it built-in to the kernel permanently. I would modularize it after I have everything working.

 

By the way, if you install the simple gpio drivers and follow the sample simple-gpio-test and simple-gpio-game, it should be not too hard to make your own application to do what it wants. I followed simple-gpio-game since it already demonstrates input and output... (We are not using the BF537, but I just modified it for our own custom board based on the BF547).

 

The version we are using is 2008R1 from SVN branch version 6988. The only trick I found was that I had to make sure that menuconfig has the option to turn on/make deprecated sysfs (by default I believe it is).

QuoteReplyEditDelete

 

 

2008-08-21 04:36:55     re: Re: simple drivers problem

Pafone Lee (CHINA)

Message: 60812   

 

thank you all

 

i add the module lisence to the driver file and it work , and i would try the new gpio driver if necessarily.

Attachments

Outcomes