Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-27 Thread John Allwine
> Dynamic pinmux changes on AM5x have issues specific to AM5x. > > For GPIO, accessing via register writes in userspace (/dev/mem) has no > more negative consequences than on AM3x or on any system running Linux for > that matter. Standard caveats apply. > > Ideally, we’d create a kernel

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-27 Thread Jason Kridner
Dynamic pinmux changes on AM5x have issues specific to AM5x. For GPIO, accessing via register writes in userspace (/dev/mem) has no more negative consequences than on AM3x or on any system running Linux for that matter. Standard caveats apply. Ideally, we’d create a kernel module to avoid

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-27 Thread Drew Fustini
You my want to consider using libgpiod with the /dev/gpiochipN character device. You can get and set multiple lines in one syscall. The libgpiod tools are installed on the Debian image. More info:

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-27 Thread Stephan Böck
Hello Robert, if I get this correctly, setting the direction of a gpio via the corresponding register (e.g. let's say gpio4 base_addr + 0x134) should be avoided? We use the BBB in combination with a carrier-board to have some industrial in- and outputs. Therefore, some pins enable some

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread John Allwine
How bad is bad? That other driver/device has stale data? The chip gets fried? Somewhere in between? If I'm certain that my application is the only user space application accessing a particular pin, can I safely use /dev/mem for the speed increase? On Thursday, March 26, 2020 at 11:19:48 AM

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread William Hermans
On Thu, Mar 26, 2020 at 10:59 AM John Allwine wrote: > I'm happy to leave the pinmux alone, but if all I'm doing is reading or > writing to the GPIO can I do so from /dev/mem? > > According to this post, it's about 1000x faster: > http://chiragnagpal.com/examples.html > > It's also how

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread John Allwine
I'm happy to leave the pinmux alone, but if all I'm doing is reading or writing to the GPIO can I do so from /dev/mem? According to this post, it's about 1000x faster: http://chiragnagpal.com/examples.html It's also how hal_bb_gpio is implemented:

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread Robert Nelson
On Thu, Mar 26, 2020 at 9:32 AM John Allwine wrote: > > Thanks Robert! > > Can you clarify why it's a bad idea on the am57xx when it seems to be the > fastest way to do it on the am335x? I'm still waiting for an official Application Note from TI for the am57xx, but the short answer, don't touch

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread John Allwine
Thanks Robert! Can you clarify why it's a bad idea on the am57xx when it seems to be the fastest way to do it on the am335x? What is the fastest way to read/write to the GPIO on the am57xx? On Thursday, March 26, 2020 at 8:26:56 AM UTC-6, RobertCNelson wrote: > > On Thu, Mar 26, 2020 at 9:20

Re: [beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread Robert Nelson
On Thu, Mar 26, 2020 at 9:20 AM John Allwine wrote: > > Is it possible to access the GPIO on the Beaglebone AI via /dev/mem similar > to how it is done in this stackoverflow question on the Beaglebone Black? If > so, how would I find what the offsets are? Hi John, dynamic changes to the

[beagleboard] how to access GPIO on Beaglebone AI via /dev/mem

2020-03-26 Thread John Allwine
Is it possible to access the GPIO on the Beaglebone AI via /dev/mem similar to how it is done in this stackoverflow question on the Beaglebone Black? If so, how would I find what the offsets are? -- For