2010-06-21 11:20:06     LED's on BF537-STAMP Board

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

2010-06-21 11:20:06     LED's on BF537-STAMP Board

Sean Wiidward (UNITED KINGDOM)

Message: 90508   

 

Hi Guys,

 

I've spent the last few days searching the internet and the forums but have been unable to find the answer so thought I'd start a thread on here.

 

I'm trying to work out how to use the board and am starting as a complete beginner. So far I've managed to work out how to communicate with it via both serial and ethernet connection and mange to update both its version of uBoot and uClinux. I've also managed to write basic programs in C, compile them on my Linux machine, transfer them via tftp to the board and run them.

 

I'm now trying to take the next step and try to control the things on the board. I thought I'd start with something simple and try to make the buttons on the board control the LEDS also on the board. It sounds simple enough but I have no idea where to go from here.

 

Is there a tutorial I can follow somewhere online? I've read on some of the forums that people have been using a program called "blinky" to test the LEDs but I can't find this to download anywhere. Should I be writing a program to control the LEDs or can I do it from the uClinux terminal?

 

Sorry for the really beginner questions, I'm rather new to the whole thing. Any help would be much appreciated.

 

Thanks

 

Sean

QuoteReplyEditDelete

 

 

2010-06-21 11:30:04     Re: LED's on BF537-STAMP Board

Mike Frysinger (UNITED STATES)

Message: 90510   

 

blinky is a bare metal application and does not work under an OS

 

you can control any GPIO by using the gpio-sysfs interface:

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gpio-sysfs

 

so it should be easy to write an app that opens the GPIOs associated with the PBs and the GPIOs associated with the LEDs, then reads the values of the PBs and sets the LEDs accordingly

QuoteReplyEditDelete

 

 

2010-06-21 11:31:53     LED's on BF537-STAMP Board

Michael Hennerich (GERMANY)

Message: 90511    Buttons and LEDs are connected to GPIOs on Blackfin.

 

There are several ways to use them:

 

Buttons connected to GPIOs: (linux input driver)

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gpio-keys

 

Alternatively you can read the button state and control GPIOs also via the GPIO sysfs interface from user space:

 

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gpio-sysfs

 

There is also a LEDs-Class in Linux:

 

See /linux-2.6.x/Documentation/leds-class.txt

QuoteReplyEditDelete

 

 

2010-06-23 06:34:03     LED's on BF537-STAMP Board

Sean Wiidward (UNITED KINGDOM)

Message: 90560   

 

Thanks for your help guys.

 

I've now recompiled my uClinux kernal to include:

 

Device Drivers  --->

  [*] GPIO Support  --->

    [*]   /sys/class/gpio/... (sysfs interface)

 

and can now control the state of the LED's from the terminal. The image I'd downloaded off the internet apparently didn'd include these options as it wasn't until I recompiled the kernal that I could export gpio values.

 

Now I'm moving on to controlling them by pressing the buttons. I'm so much closer than I was before.

 

Thanks again

 

Sean

QuoteReplyEditDelete

Attachments

    Outcomes