I’m actually trying to fully remap and program the GPIO on the BeagleBone Black for an embedded system with TOR, ANA and other connection. Actually I’ve try to use the GPIO in user space and responce time is in ms, then I tied to use a kernel module with IRQ, now I can perform operation and toggle GPIO in 300us (which seem’s to be the the maximum due to sysfs use). I need to perform actions faster than that, so I’m actually looking for controlling the GPIO registers. But this can interfer with the linux system isn’t it ? What’s the proper way to do that ? Note that I can’t use the PRU.
I’ve remap the GPIO throught a Device Tree but I fear that this can create trouble when the board boot at pin init and get some pick, I think I need to modify this from the DTSI and compile a new kernel… Am I in the right way ?
Why can't you use PRU? It's the resource on the BBB that was designed
for fast GPIO access.
Discounting it from the start reminds me of the old joke:
someone claims that they'd do ANYTHING to lose weight.... 'except diet
The proper way to access the GPIO registers directly is the same way
you do it from the PRU: Use the set/clear registers to set/clear just
the bits you need rather than writing the full 32-bit data output
The GPIO pin setup (setting direction, pull-up/down, etc) should still
be done via sysfs (or internal kernel calls) to avoid possibly
corrupting these registers, but that's typically a one-time operation.
Note that I can’t use the PRU.
If it’s about learning PRU coding, instead you could use libpruio in a high level language.
now I can perform operation and toggle GPIO in 300us (which seem’s to be the the maximum due to sysfs use). I need to perform actions faster than that, so I’m actually looking for controlling the GPIO registers.
Toggling a GPIO pin in less than 5 us. (On a vanilla BBB: output 120 to 190 kHz with function Gpio->Value() and 140 to 310 kHz with direct GPIO control).