How do I change the pin mode to a new value even after rebooting? (Beaglebone Black)

I am trying to connect an OV7670 camera module to the board, but for it to work the module needs a clock signal. I am using a PWM pin (P9_42). But every time I reboot the device I need to config the pin again.

Is there anyway to make the pin configuration permanent so that it does not reset every time the device is restarted?

You can have the pins configured upon bootup with a custom device tree overlay.

Tools to make one: - overlay
If you follow the instructions listed in @RobertCNelson’s readme file then you should be able to get started making one. A little heads up, have a station you can load the SD card into to remodify the uENV.txt file if you happen to have boot issues.

A few sources to learn more about them:

Hope this helps.

Yes, you can specify the mux mode to connect the pin to the output of the eCAP module in a device tree blob. But can you configure the modules registers to generate a certain output?

I’d try a start script for systemd, ie. invoking a small libpruio prg to enable the desired output.


Yes you can. By creating the device tree binary overlay you can not only set the mux mode, but its output as well.

I’ll add another resource that explains this: (basically a walk-through on how to do it. However, its a bit outdated as “SLOTS” are obsolete).


This is good, but obsolete stuff. Nothing about PWM output from an eCAP module. Only about GPIO, using sysfs to manipulate the settings.

From a device tree blob you cannot manipulate the register settings unless the driver supports this. And the PWM driver has no such feature, yet,


When you figure it out, share with the rest of us.