Quantcast

I want to blink the LED in booting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

I want to blink the LED in booting

fantajista
I wrote a boot script which blink the LED and placed it in "/etc/rcS.d/".

In the script, I controll the gpio to blink the LED.

while ( 1 ){
  system("echo 1 > /sys/class/gpio/gpio78/value");
  sleep(1);
  system("echo 0 > /sys/class/gpio/gpio78/value");
  sleep(1);
}

But, this script is executed after about 16 seconds from power on Gumstix.

I want to start blinking the led earlier phase.

How to implement this function ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I want to blink the LED in booting

Chris Whittenburg

On Wed, Jan 23, 2013 at 10:32 PM, fantajista <[hidden email]> wrote:
I wrote a boot script which blink the LED and placed it in "/etc/rcS.d/".

In the script, I controll the gpio to blink the LED.

while ( 1 ){
  system("echo 1 > /sys/class/gpio/gpio78/value");
  sleep(1);
  system("echo 0 > /sys/class/gpio/gpio78/value");
  sleep(1);
}

But, this script is executed after about 16 seconds from power on Gumstix.

I want to start blinking the led earlier phase.

How to implement this function ?


You might be able to get it to start earlier if you modify your board file, which is arch/arm/mach-omap2/board-overo.c for the overo.

Look for the gpio_leds[] definition, and add something like:

 	{
		.name			= "overo:red:gpio78",
		.default_trigger	= "heartbeat",
		.gpio			= 78,
		.active_low		= true,
	},


 

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I want to blink the LED in booting

Akram Hameed
In addition to Chris' suggestion, look up the source for the 'heartbeat' functionality - you can write kernel code to define your own triggers for the leds subsystem which would allow you to do whatever type of blinking you desire.  Also, you can change the type of trigger at runtime if you desire by writing a valid trigger type in to the sys device (/sys/devices/platform/leds-gpio/leds/overo:red:gpio78/trigger).

If you do a cat of that trigger file it will show you valid triggers you can use.

Cheers,

Akram

On Fri, Jan 25, 2013 at 5:03 AM, Chris Whittenburg <[hidden email]> wrote:

On Wed, Jan 23, 2013 at 10:32 PM, fantajista <[hidden email]> wrote:
I wrote a boot script which blink the LED and placed it in "/etc/rcS.d/".

In the script, I controll the gpio to blink the LED.

while ( 1 ){
  system("echo 1 > /sys/class/gpio/gpio78/value");
  sleep(1);
  system("echo 0 > /sys/class/gpio/gpio78/value");
  sleep(1);
}

But, this script is executed after about 16 seconds from power on Gumstix.

I want to start blinking the led earlier phase.

How to implement this function ?


You might be able to get it to start earlier if you modify your board file, which is arch/arm/mach-omap2/board-overo.c for the overo.

Look for the gpio_leds[] definition, and add something like:

 	{
		.name			= "overo:red:gpio78",
		.default_trigger	= "heartbeat",
		.gpio			= 78,
		.active_low		= true,
	},


 

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Loading...