As an example, to turn on one of the on-board LED's you need to update the text file "/sys/class/leds/beaglebone:green:usr0"

In writing some tests just turning on and off lights, it's very slow. I believe this is because it uses the file system instead of directly interfacing with the hardware via an API or memory addressing.

Just wondering if there is any other way other than the file system. I don't know if this is a Linux thing or a BeagleBone Black thing.

  • \$\begingroup\$ Of course there is. Write a kernel module. \$\endgroup\$ Nov 23, 2017 at 3:05
  • \$\begingroup\$ @IgnacioVazquez-Abrams Thanks Ignacio. Do you have any references specific to the BBB? Also, why would they not provide this from the manufacturer? \$\endgroup\$ Nov 23, 2017 at 3:08
  • \$\begingroup\$ No clue what pins the LEDs are connected to. See the documentation and kernel source. \$\endgroup\$ Nov 23, 2017 at 3:09

1 Answer 1


An option is to use mmap (memory map) and then by utilizing GPIO registers, you can control GPIO pins with higher speed. However, PRU(Programmable Real-time Unit) may result in higher speeds even more than mmap method, but this high-speed control costs for assembly programming (However in Starterware you can write code for PRU in C). For more information about PRU you can refer to Technical Reference Manual of AM335x.

Take a look at this address for mmap example.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.