I'm having a heck of a time getting overlays working on the BBB with
RCN's 2018-02 MK image. I'm weak on the concepts to begin with, and
here's what I've done.
With the stock `/boot/uEnv.txt`, most pins aren't already assigned to
any cape:
machinekit@beaglebone:~$ config-pin P9.18 lo
P9_18 pinmux file not found!
Pin has no cape: P9_18
machinekit@beaglebone:~$ ls -d /sys/devices/platform/ocp/ocp:P*
/sys/devices/platform/ocp/ocp:P9_19_pinmux
/sys/devices/platform/ocp/ocp:P9_20_pinmux
Trying to load the universal cape with `config-pin overlay
cape-universal` dumps a huge list of errors to the console and kernel
oopses on the 4.14 kernel. On the 4.4 kernel, the pins seem to appear
in `/sys/devices/platform/ocp/ocp:P*`, but `config-pin P9.18 lo` says
"WARNING: GPIO pin not exported, cannot set direction or value!". So I
don't do that.
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
Compiling produces no unexpected errors:
> machinekit@beaglebone:~$ sudo dtc -O dtb -o /lib/firmware/bb_autoclave-00A0.dtbo -b 0 -@ etc/bb_autoclave.dts
> /lib/firmware/bb_autoclave-00A0.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
Maybe this is meaningful; the Linux 4.14 version:
> machinekit@beaglebone:~$ sudo /opt/scripts/tools/version.sh
> git:/opt/scripts/:[ad016da40de5805f1a6f981cbb6c454b1a7f244b]
> eeprom:[A335BNLT0A5A1513BBBK3416]
> model:[TI_AM335x_BeagleBone_Black]
> dogtag:[Machinekit Debian Image 2018-02-04]
> bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.01-00002-g9aa111a004]
> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2015.01-00001-gb2412df]
> kernel:[4.14.16-ti-rt-r30]
> uboot_overlay_options:[enable_uboot_overlays=1]
> uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/bb_autoclave-00A0.dtbo]
> uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
> uboot_overlay_options:[enable_uboot_cape_universal=1]
> pkg:[bb-cape-overlays]:[4.4.20180126.0-0rcnee0~stretch+20180126]
> pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
> pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
> groups: �‘debian�’: no such user
> groups:[]
> dmesg | grep pinctrl-single
> [ 1.409569] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
> dmesg | grep gpio-of-helper
> [ 1.411448] gpio-of-helper ocp:cape-universal: ready
> END
The Linux 4.4 version, slightly different:
> root@beaglebone:/home/machinekit# sudo /opt/scripts/tools/version.sh
> [...]
> kernel:[4.4.113-ti-rt-r147]
> [...]
> dmesg | grep gpio-of-helper
> [ 1.511377] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0
> [ 1.511589] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1
> [ 1.511604] gpio-of-helper ocp:cape-universal: ready
> END
So who knows what dumb thing I'm missing? Thanks!
John