LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-01-2013, 02:09 AM   #1
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Rep: Reputation: Disabled
How to on and off the leds which are connected on lpc3250 board


Hi,

I am working on kernel version 2.6.34 in ubuntu 11.10 with LPC3250 board.I loaded the boot loaders kickstart,stage1 and u-boot loaders in my board. In my board leds are connected to P2^0 and P2^1 pins and I have enabled the "LED Support for GPIO connected LEDs" in "LED SUPPORT" option of kernel menuconfiguration. Now i want to
make ON and OFF operations for these LEDS and is any application have to write to perform this operation?Please help me how to make that operation?

Thanks & Regards,
Md.biyabani.
 
Old 05-01-2013, 06:45 AM   #2
IamaHack
LQ Newbie
 
Registered: May 2012
Distribution: Currently doing embedded linux so.... Buildroot? ;-)
Posts: 8

Rep: Reputation: Disabled
If you have correctly enabled the LEDs, you can cd to /sys/class/leds/ where you should be able to see several directories. For instance, on a ThinkPad laptop, I can see several led directories that look like this:
/sys/class/leds/tpacpi\:thinklight, when I cd to that directory I see several files, one of which is called "brightness". To check the current setting I type: cat brightness which returns "0" indicating the led is off. To turn on the led I type: echo 100 > brightness and the led turns on.
 
Old 05-01-2013, 07:59 AM   #3
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Thanks for your reply.The sys directory not found in my application after kernel booted. It contains the directories as below


### Application running ...
~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var

Where i will get that sys dir?

Thanks & Regards,
Md.biyabani
 
Old 05-01-2013, 03:21 PM   #4
IamaHack
LQ Newbie
 
Registered: May 2012
Distribution: Currently doing embedded linux so.... Buildroot? ;-)
Posts: 8

Rep: Reputation: Disabled
I admit, you have confused me. The /sys filesystem is actually a pseudo file system that is part of the linux kernel from 2.6 on (as far as regular releases go). Wat version of the kernel are you running ? If you could execute the command : uname -a and include the output in your next reply it may help.
 
Old 05-01-2013, 11:46 PM   #5
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Thanks for your Reply. The output of you mentioned command in application after kernel booted is

~ # uname -a
Linux 192.168.1.19 2.6.34 #59 PREEMPT Wed May 1 14:35:51 IST 2013 armv5tejl unkn


After that i type the below command and got the output is

~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var

It is not showing any sys directory. I hope this information is useful to help me.

Thanks & Regards,
Md.biyabani.
 
Old 05-02-2013, 06:43 AM   #6
IamaHack
LQ Newbie
 
Registered: May 2012
Distribution: Currently doing embedded linux so.... Buildroot? ;-)
Posts: 8

Rep: Reputation: Disabled
Since I am not familiar with your LPC3250 evaluation board, I can't know for sure, but are there jumpers or control registers that need to be properly set to enable LED control via the GPIO pins? I am completely puzzled about the lack of a /sys filesystem since I have never worked on a system with a 2.6.x kernel where that was unavailable. Is it possible that you are mounting an NFS filesystem and the listing you have shown me is from that? I am sorry, but I am running out of ideas.

Regards
 
Old 05-02-2013, 06:46 AM   #7
IamaHack
LQ Newbie
 
Registered: May 2012
Distribution: Currently doing embedded linux so.... Buildroot? ;-)
Posts: 8

Rep: Reputation: Disabled
Another thought I just had. I noticed that the prompt you were showing: ~ # ls is NOT the filesystem root (the '~' means you are in the logged in user's home directory), so try this:
cd /
ls -l

Let me know if this works

Regards

Last edited by IamaHack; 05-02-2013 at 02:09 PM.
 
Old 05-02-2013, 07:24 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member Response

Hi,

@OP biyabani

You can always use 'pwd' on command line to show the working directory;
Quote:
excerpt from 'man pwd';

NAME
pwd - print name of current/working directory

SYNOPSIS
pwd [OPTION]...

DESCRIPTION
Print the full filename of the current working directory.

-L, --logical
use PWD from environment, even if it contains symlinks

-P, --physical
avoid all symlinks

--help display this help and exit

--version
output version information and exit

NOTE: your shell may have its own version of pwd, which usually supersedes the version described here. Please refer to your shell's documentation for
details about the options it supports.
Quote:
Just a few links to aid you to gaining some understanding;



Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Utimate Linux Newbie Guide
LinuxSelfHelp
Bash Beginners Guide
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Home Networking



The above links and others can be found at '
Slackware-Links'. More than just SlackwareŽ links!
Above links should help you to learn. Hope this helps.
 
Old 05-02-2013, 11:58 PM   #9
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Thanks for reply to all..

Previously posted directories are before mounting NFS and that is,
~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var

I tried this also

~ # cd /
~ # ls -l
drwxr-xr-x 2 1543 1543 3072 Nov 24 2008 bin
drwxr-xr-x 2 root root 3072 Nov 24 2008 dev
drwxr-xr-x 5 1543 1543 1024 Jan 1 00:00 etc
drwxr-xr-x 2 1543 1543 1024 Nov 24 2008 ftp
drwxr-xr-x 2 1543 1543 1024 Nov 24 2008 home
drwxr-xr-x 3 1543 1543 1024 Nov 24 2008 lib
lrwxrwxrwx 1 1543 1543 14 Nov 24 2008 linuxrc -> ../bin/busybx
dr-xr-xr-x 35 root root 0 Jan 1 00:00 proc
drwxr-xr-x 2 1543 1543 1024 Nov 24 2008 sbin
drwxr-xr-x 2 1543 1543 1024 Jan 1 00:00 tmp
drwxr-xr-x 4 1543 1543 1024 Nov 24 2008 usr
drwxr-xr-x 4 1543 1543 1024 Nov 24 2008 var

And after mounting the NFS

~ # mkdir nfs
~ # ls
bin etc home linuxrc proc tmp var
dev ftp lib nfs sbin usr
~ # mount -t nfs -o nolock 192.168.1.10:/home/mohan/nfs /nfs
~ # ls
bin etc home linuxrc proc tmp var
dev ftp lib nfs sbin usr

In the above procedure i didnot found any SYS dir. is there any other kernel version that may contains this Directory?

Please give reply if you get any idea about it.

Thanks & Regards,
Md.Biyabani.
 
Old 05-03-2013, 08:19 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member Response

Hi,

I spent a few minutes using these guides which are good references;

http://www.embeddedartists.com/sites...sers_Guide.pdf

http://embedded.lectoraat.org/uww/PD...BSP_Manual.pdf
If you followed the setup in above link then the root is: rootpath=/home/user/ltib/rootfs

Quote:
section 2.6 Load the Root File System and Linux Kernel
See page 11 of this link: http://embedded.lectoraat.org/uww/PD...BSP_Manual.pdf
Above section does show that a /proc & /sys are loaded via busybox. I did not look at the Fedora or Ubuntu loads but I think you use a VM Appliance for Ubuntu. Not having a physical board to verify/debug that indeed uboot is used to init & load Linux Kernel with the command: 'uboot> run mtdboot'. 'mtdboot' would be the image on your stick/sd that must be setup via tools;
Quote:
The Linux Target Image Builder (LTIB) system will be used to build the u-boot, Linux kernel and root file system. LTIB ease the build and deployment process of several components needed in a Linux system. Besides the bootloader and kernel a lot of needed utilities, modules and libraries are included and will be configured and built automatically by LTIB. For more information about LTIB, go to
http://ltib.org
Most ARM systems do use these techniques to utilize Linux on their boards.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enable all(7) uarts on lpc3250 board biyabani Linux - Embedded & Single-board computer 15 07-24-2013 01:08 AM
running ext2 file system on linux ported on lpc3250 board jsan Linux - Newbie 1 04-17-2013 07:00 PM
Mounting usb in lpc3250 board (ported with linux version 2.6.34) biyabani Linux - Newbie 8 04-09-2013 06:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration