On 3/3/2018 10:59 PM, John Morris wrote:
> 
> Instead, I compile and install a .dts file with just the wanted pins,
> and add the line
> `uboot_overlay_addr0=/lib/firmware/bb_autoclave-00A0.dtbo` to
> `/boot/uEnv.txt`.  This doesn't seem to assign any pins, but I'm
> unclear whether it's a bad file or something else.
> 
> https://github.com/zultron/autoclave_control/blob/master/etc/bb_autoclave.dts

That snippit of a device tree overlay is incomplete.  I suggest you
start with one of the unviersal overlays and chop out everything you
don't need.  Alternately, add some more stuff to your minimal overlay
file.  Using your first pin (P9_18) as an example:

You first need to define some pin mux settings (note you only need to
define the ones you want to use):

target = <&am33xx_pinmux>;

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L479-L495

...then you can setup the pinmux helper:

target = <&ocp>;
compatible = "bone-pinmux-helper";

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L1040-L1052

These two bits are the "magic" that lets you play with pinmux settings
from user space.  To change the default pin settings, either edit the
default value directly (ie: P9_18_default_pin) or change the first
entry in the pinmux-helper stanza, ie:

    // pinctrl-0 = <&P9_18_default_pin>;
    pinctrl-0 = <&P9_18_gpio_pd_pin>;

Finally, export the gpio pins, this is what makes them visible in
sysfs and is basically the same as:
  "cat $pin > /sys/class/gpio/export":

target = <&ocp>;
compatible = "gpio-of-helper";

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L1408-L1413

Or as mentioned previously, if you don't need to mess with the pinmux
settings you can just export the GPIO pins you need via the sysfs
interface.

-- 
Charles Steinkuehler
[email protected]

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to