Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Turn on Leds

Hi,

I have managed to introduce linux in target DE2. These last days I was able to control a port of leds with the archive "nios2.h", but when I rebuilted the kernel I saw an interesting option: "linux_kernel_configuration-->Device_Drivers-->Led Support"

I have tried to find information obout this option, some explanation about how to control,what things do...

If someone can explain or give me a link of a web that explain this. I suppose that with this device driver I will control the port as I do with the archive nios.h but I don't know how.

Thanks for the help.

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    I have follow the instructions of NiosWiki about Gpio, but something I have done wrong because when I write in the terminal the command --> "make" appears an error about na_gpio_0 undeclared.

    Before writing make, I have written make menu config Where I pointed-->

    customize kernel and customize application. Also in processor type and features-->gpio interface and finally device driver-->led support.

    I attached a picture about the error, if someone can give a hand

    Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Please check the hardware. The gpio instance in your sopc builder should be named as "gpio_0".

    - Hippo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for your answers Hippo.

    Doing in this manner I associated a Pio component(Sopc_Builder) with Gpio in linux.But what happens If I would like to insert another Pio component in Sopc_Builder and the two of them I would like to use with gpio. Then I would have two variables in Sopc_Builder for one gpio variable.

    The other question that I have is that in your first answer you said:" you can control led on/off with led sysfs class in /sys/class/leds."

    When I enter in /uClinux-dist/romfs/sys there aren't nothing , maby it is not the correct path? The drivers are installed(GPIO and LEDS), they appear in /uClinux-dist/linux-2.6.x/drivers

    Thanks a lot for your time