Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I have a PXA270 based hardware in which I have LED connected to GPIO X. I have ported uboot 1.1.4 and kernel 2.6.19 on that. I need to write ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56

    Program to Blink LED


    Hi,

    I have a PXA270 based hardware in which I have LED connected to GPIO X.
    I have ported uboot 1.1.4 and kernel 2.6.19 on that.

    I need to write a program that blinks this LED (by toggling GPIO X) as soon as the hardware is booted up. I need to have this LED blinking till I load kernel, filesystem. When it loads the filesystem, I have one user application that should make this LED solid ON.

    In short I need to blink LED as soon as hardware is powered on till my user level application gets loaded.

    How should I achieve this through bootloader/kernel? Are there any timers available that can be started through bootloader (may be using assembly code) and tuned off through user application?

    Thanks.

    Regards,
    Sumit

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,158
    I presume this is part of your job? You want us to do your job? There are many means to accomplish this, and they all depend upon hardware peculiarities. You really need to understand kernel-level programming better so you can deal with such stuff. Many people who contribute to these forums (myself included) are professionals who are paid well to do this in real life. We enjoy helping people to get up to speed, but we (at least I do) REALLY resent it when a fellow professional wants us to do their work for them...

    I'm sorry if it seems like I'm flaming at you - I'm not, really. But this sort of question makes me question your competence for this work. After 30 years in this field, I still have to dig into the details to work out this sort of problems, and my clients pay me upwards of $200 USD per hour to do it for them, so you might understand my attitude.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56

    Re

    I salute to your attitude. Thanks for encouraging me.

    As I am application programmer, I am slightly unknown towards means of accomplishing this. Now you have mentioned, it is possible then I will definietely look into kernel programming.

    Again, thanks for encouraging me.

    Regards,
    Sumit

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,158
    I do apologize for my "flame". I do encourage you to look into kernel programming. If your English language skills are up to it, check these sites for documentation and help to get started:

    The Linux Kernel Archives
    The Linux Documentation Project
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Nov 2011
    Posts
    1
    Hi,sumitv

    found solution for this??
    I also have requirement like this..
    and @rubberman yes this is part of my job

    I am working on netgear ap software development.
    I want that leds on the panel should blink while transferring data, but they are ON only

    there are 5 leds on panel
    1 for 2.4 GHz data transfer
    1 for 5 GHz data transfer
    1 for Ethernet input
    1 for I don't know some recycle symbol is there
    1 for power

    so I need a patch which includes code for led blinking
    m using kernel v2.6.36


    I am interested in ethernet led
    I found out that it is conected to gpio pin 9..so I added an entry for pin9 in .dts(device tree structure) file of device. I have a clue that I need to add some function in drivers/led/leds-gpio.c file and export the symbol.
    so when ethernet link is up ethernet module will call this fuction to switch on led(currently it is ON)
    when ethernet link is down ethernet module will call this fuction to switch OFF led
    and when there is data transfer through ethernet port then led should blink

  6. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Hello, nachiket_linux

    This thread is nearly 2 years old so I'm going to lock it, but don't hesitate to start a new thread of your own if you are having any issues with Linux.

    Thanks.
    oz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •