Google-Apps
Hauptmenü

Post a Comment On: Ken Shirriff's blog

"The BeagleBone's I/O pins: inside the software stack that makes them work"

13 Comments -

1 – 13 of 13
Anonymous Anonymous said...

Wow, what a post. Thank you for this.

August 18, 2016 at 9:37 AM

Blogger Unknown said...

Great post!

August 19, 2016 at 6:29 AM

Blogger Unknown said...

Big thank you

August 19, 2016 at 1:03 PM

Anonymous Jez Weston said...

I was planning on dedicating all of today to finding this stuff out.

You've just done it all for me.

Thanks so much for an awesome article.

August 19, 2016 at 2:30 PM

Anonymous Anonymous said...

I'm surprised your code in [2] works. There definitely was a time when you had to write the first byte of the file to get the kernel to accept the new value. Many people used lseek(, 0, SEEK_SET) or reopened the file and I was proud to have thought of pwrite(,,, 0) to do both in one syscall.

August 19, 2016 at 11:30 PM

Blogger Malcolm said...

Note 1, PWMSS -- there seem to be some words missing at the end.

August 20, 2016 at 6:13 AM

Blogger Ken Shirriff said...

Anonymous: I verified that the code in [2] works as written (on the 3.8.13-bone79 kernel). Requiring lseek sounds like a bug in the driver, so it probably got fixed at some point. Nigel: Thanks, I fixed the text. I guess you're the first person to read the whole footnote :-)

August 25, 2016 at 9:05 AM

Blogger Unknown said...

A very practical article, thank you. I wish there was a similar article for the 4.4 kernel and universal capes, as they appear to change the working arrangement quite significantly. Especially if the pre-made device trees and universal capes don't fit your needs, and you need to roll your own :)

February 3, 2017 at 6:37 AM

Anonymous Anonymous said...

Many thanks for your post!
I tried the code in [2] and it worked fine.
Problems came up when I tried to go a little further, trying to read from a push button connected (properly!) on the same IO (set as direction:in).
I manage to catch the button's state by "cat /sys/class/gpio/gpio49/value" (I get 0 if not pushed and 1 if pushed).
Then I tried to use read() and I couldn't manage to catch the value with this code:
//----------------------------
int fd = open("/sys/class/gpio/gpio49/value",O_RDONLY);
printf("fd:%d\n",fd);
int* pbtn;
int btn;
int tmp;
// while(1)
{
tmp=read(fd,(void*)pbtn,1);
btn=*pbtn;
printf("%d\n",tmp);
printf("%x\n",btn);
if (btn==1)
{
printf("Button pressed!\n");
}
}
//----------------------------

All I have is:
fd:4
-1
4f0b00f0

Any idea? (at least I hope I didn't do any stupid thing in C...)
Thanks again!

June 29, 2017 at 3:08 PM

Blogger Unknown said...

I am a little bit confused here.

...pin 23 on header 9 is GPIO1_17, which is GPIO 49, which is pin entry 17 (unrelated to GPIO1_17)...

It is saying GPIO1_17 is unrelated to itself? Can someone explain it to me?

August 14, 2018 at 11:07 PM

Blogger Ken Shirriff said...

Not you: what I meant is that it's a coincidence that the number 17 appears in pin entry 17 and GPIO1_17.

November 28, 2018 at 6:47 PM

Anonymous GrayDaemon said...

Thanks man! I am working with the stuff for years, but you really sorted it out in my head! Really good job done, appreciating time you spent on it.

January 10, 2019 at 2:30 PM

Anonymous Anonymous said...

Thank you for the post .

I am trying to run this code on AM6546 . I am getting more delay than configured.

Instead of
while (!(__R31 & (1 << 30))) {} // Wait for timer compare interrupt

I am polling on ECAP Interrupt flag as ,
while((*ECAP_INTFLG & (1 << 8))){};

here ECAP_INTFLG is #define ECAP_INTFLG ((volatile uint16_t *)(ECAP + 0x2E))

can you please help here

August 14, 2019 at 1:09 AM

You can use some HTML tags, such as <b>, <i>, <a>

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot