Heater
Posts: 7589
Joined: Tue Jul 17, 2012 3:02 pm

Re: Can we control the on-board leds

Sun Sep 11, 2016 6:32 pm

DougieLawson,
Yes they do, because the RPi3B hardware is just a little bit different to the RPi1B and code that works on a 3B won't run on a 1B.
Exactly. You are making my point for me. Somebody with this problem might google it and end up here. If the thread were dead because it's old they would get nowhere. BUT as it's not, they find you pointing out that things have changed. This is good, is it not?

Again, questions do not become invalid because they are old. In this case the question is still valid, even if the answers may have changed.

I like to think of it like Fermat's Last Theorem. First posed as problem in 1637. Finally proved by Andrew Wiles in 1995.

How would it be if today's mathematicians said "Go away Andrew, thread closed, that question is 358 years old"?

User avatar
DougieLawson
Posts: 29337
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Can we control the on-board leds

Sun Sep 11, 2016 6:35 pm

If I owned the forum every thread would be locked after six months of inactivity. Folks would be enocuraged to start a new thread with a back reference to the closed thread. That would stop the pointless necro of old crap.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
DavidS
Posts: 3009
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Can we control the on-board leds

Sun Sep 11, 2016 8:26 pm

DougieLawson wrote:If I owned the forum every thread would be locked after six months of inactivity. Folks would be enocuraged to start a new thread with a back reference to the closed thread. That would stop the pointless necro of old crap.
Then people would not learn, they would find an old thread that is no longer valid, and assume they were not able to do what they want because it did not work. Sounds like a good way to get rid of people that wish to learn, thought learning was the goal here.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

User avatar
DougieLawson
Posts: 29337
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Can we control the on-board leds

Sun Sep 11, 2016 9:58 pm

No.

It would stop the spammers, it would stop the pointless necroing of ancient expired crap, it would make folks stick to one question per thread, that would remove the off-topic late posts ("I've got the same problem" [as something from three years ago] which always solicits the response "Oh no, you do not, that was solved ... .").

For a Raspbian specific case it would stop folks shooting their network dead by applying Wheezy updates to Jessie's /etc/network/interfaces file.

Locking old threads (not deleting them) makes much more sense than the current model.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

Heater
Posts: 7589
Joined: Tue Jul 17, 2012 3:02 pm

Re: Can we control the on-board leds

Mon Sep 12, 2016 3:12 am

Dougie,

I do appreciate what you are driving at.

Problem is that the WEB is full of old, obsolete, expired information. Code snippets for Python 2 that won't work in Python 3, advice on configuring Linux things that no longer works on newer distros or kernels. It's endless and growing worse every day. It's not just about the Raspi or Linux, it's a problem in general.

Often when searching for solutions I have to remind myself to check the date on the page, if there is one, in an effort not to get sucked into old crap. Then of course it's good to know the exact versions of the OS and whatever software they are talking about.

I'm not sure how locking down old threads helps though. The problem is bigger than that. The old, now wrong, info is still there for people to find and screw themselves up with. Nobody is going back over the old stuff and checking it's current validity and marking it as "this no longer works".

But, if the question remains open there is some chance that someone will find it, try it, find it does not work, find a modern solution, then come back and update the threads solution.

User avatar
DavidS
Posts: 3009
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Can we control the on-board leds

Mon Sep 12, 2016 3:46 am

Back on topic. Here is one solution that should work on the RPi B+, RPi 2, and RPi 3 without any operating system, as to the nature of what I understand the original question to be. This solution should be of aid, as the old Hardware is no longer common, or even available in some cases. I also did not see an actual solution earlier in this thread.

I hope this helps those that find this old thread when looking for info.

The solution as posted earlier, to quote myself:
DavidS wrote:
simplesi wrote:Are any of the on-board LEDS controllable by us users?

Simon
You could try something like:

Code: Select all



.LedInit:
 LDR R1,GPIOBase
 LDR R0,#1 SHL #21
 STR R0,[R1,#16]
 MOV R15,R14

.LedOn
 LDR R1,GPIOBase
 LDR R0,#1 SHL #15    ;Turning on the GPIO controling the LED.
 STR R0,[R1,#32]      ;Write the GPIO Set Register.
 MOV R15,R14          ;Return to caller.

.LedOff
 LDR R1,GPIOBase
 LDR R0,#1 SHL #15    ;We are changing the the bit for the LED GPIO.
 STR R0,[R1,#44]      ;Write to the clear GPIO Clear location.
 MOV R15,R14          ;Return to caller.



.GPIOBase
 EQUW &3F200000
Assuming you are running on the ARM, and on a RPi B+/2B/3B. A bit different if you are running on the VideoCore IV, though same basic concept.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

Heater
Posts: 7589
Joined: Tue Jul 17, 2012 3:02 pm

Re: Can we control the on-board leds

Mon Sep 12, 2016 4:42 am

I believe the answer was in the first few posts. Yes it may not work any more.

Some times I think Dougie might be right! :) What on earth does one do with your solution? How do we build it? How do we run it? What tools do we need? What OS is it for?

User avatar
DavidS
Posts: 3009
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Can we control the on-board leds

Mon Sep 12, 2016 4:54 am

Heater wrote:I believe the answer was in the first few posts. Yes it may not work any more.
The only things I saw were some shell commands for a unix like system. I admit I just scanned the responces to see if there was a useful responce before replying.
Some times I think Dougie might be right! :) What on earth does one do with your solution? How do we build it? How do we run it? What tools do we need? What OS is it for?
The original post said:
Are any of the on-board LEDS controllable by us users?
Which implies no operating system. I leave what assembler to use up to the implementer.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

User avatar
ragnarjensen
Posts: 318
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden
Contact: Website

Re: Can we control the on-board leds

Mon Sep 12, 2016 7:01 am

rern wrote:@ragnarjensen
After hours of seacrhing for GPIO LED for USB drive, your code is the only one I've found that do exactly I want. Please advice how to make it works on ArchLinux.
I'm sorry, but I have never used ArchLinux.
--
Ragnar

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 2 guests