Assistance please: dtb-rebuilder reconfiguration of GPIO

Greetings,

Thank you for any assistance you can provide on topic.

Since the last post went way off topic and appears it turned into a pissing match…

I am looking for assistance in understanding how to reconfigure GPIO’s on the BBB using RCN’s dtb-rebuilder.

I am working on developing a new piece of equipment using the BBB as the controller.

One aspect of the project is control of an inlet and outlet pump from a tank. Time sensitivity is not critical.

For clarity, PWN will be used for a separate function that is not discussed here.

I am looking to use
P8-11 (GPIO 45) as pulldown input - Program man/auto
P8-12 (GPIO 44) as pulldown input - Pump 1 - man on/off
P8-14 (GPIO 26) as pulldown input - Pump 2 - man on/off
P8-15 (GPIO 47) as pulldown input - Pump 2 start switch
P8-16 (GPIO 46) as pulldown input - Pump 1 Stop switch
P8-17 (GPIO 27) as pulldown input - Pump 2 Stop switch
P8-18 (GPIO 65) as pulldown input - Pump 1 Start switch

Fortunately, pulldown input is the default state of each of those pins.

Unfortunately, I also want
P9-12 (GPIO 60) as pulldown output to turn on pump 1 using a relay, where P9-12’s default state is pullup input, and
P9-15 (GPIO 48) as pulldown output to turn on pump 2 using a relay, where P9-15’s default state is pulldown input.

I have been trying to work through RCN’s dtb-rebuilder with Derek Molloy’s book to accomplish this.

But I have not impacted this default state.

I am using Kenerl r.19.94-ti-r42.

I have captured my boot sequence using a serial cable through putty:

uboot_overlays: [uboot-base-dtb = am335x-boneblack-uboot-univ.dtb]…
the seqeunce confirms it switched to the above, then loads with 162266 bytes read

am335x-boneblack-uboot-univ.dtb includes

  1. am33xx.dtsi, which appears to set on chip GPIO’s,
  2. am335x-bone-common.dtsi, which appears to only interact with P9-19 & P9-20 in terms of GPIO, and
  3. am335x-bone-common-univ.dtsi

So looking at P9-12 in am335x-bone-common-univ.dtsi:

Line 713 of am335x-bone-common-univ.dtsi begins the definitions of Gpio on P9-12
/* P9_12 (ZCZ ball U18) gpio1_28 /
P9_12_default_pin: pinmux_P9_12_default_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; }; /
gpmc_be1n.gpio1_28 /
P9_12_gpio_pin: pinmux_P9_12_gpio_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT | INPUT_EN | MUX_MODE7) >; }; /
gpmc_be1n.gpio1_28 /
P9_12_gpio_pu_pin: pinmux_P9_12_gpio_pu_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; }; /
gpmc_be1n.gpio1_28 /
P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; }; /
gpmc_be1n.gpio1_28 /
P9_12_gpio_input_pin: pinmux_P9_12_gpio_input_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_INPUT | MUX_MODE7) >; }; /
gpmc_be1n.gpio1_28 */

I have tried modifying the lines above with no success
1)
P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN_EN | INPUT | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */

and

P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN_EN | MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */

and
3)
P9_12_gpio_pd_pin: pinmux_P9_12_gpio_pd_pin { pinctrl-single,pins = <
AM33XX_IOPAD(0x0878, PIN_OUTPUT_PULLDOWN| MUX_MODE7) >; }; /* gpmc_be1n.gpio1_28 */

Line 2049 starts the next section which appears to only define the pinctrl states
/* P9_12 (ZCZ ball U18) */
P9_12_pinmux {
compatible = “bone-pinmux-helper”;
status = “okay”;
pinctrl-names = “default”, “gpio”, “gpio_pu”, “gpio_pd”, “gpio_input”;
pinctrl-0 = <&P9_12_default_pin>;
pinctrl-1 = <&P9_12_gpio_pin>;
pinctrl-2 = <&P9_12_gpio_pu_pin>;
pinctrl-3 = <&P9_12_gpio_pd_pin>;
pinctrl-4 = <&P9_12_gpio_input_pin>;
};

I have not played with these.

Finally, the last place it appears to configure P9-15 starts on Line 2777
P9_12 {
gpio-name = “P9_12”;
gpio = <&gpio1 28 0>;
input;
dir-changeable;
};

I have tried a few modification here with no success such as

P9_12 {
gpio-name = “P9_12”;
gpio = <&gpio1 28 3>;
output;
pulldown;
};

I nano’ed, modified and saved the am335x-bone-common-univ.dtsi file, used the dtb-rebuilder make all command, backed up the old binary file am335x-boneblack-uboot-univ.dtb_BACKUP and replaced it with the new am335x-boneblack-uboot-univ.dtb.

And yes I messed it up a couple times and had to completely rebuild the BBB’s loaded image, updates, upgrades, etc… Lots of fun.

I have not seen any change in the default state of P9-12 from pullup input as checked using config-pin query.

Can anyone redirect me to some examples, or provide a some tips, or simply tell me I’m off my rocker and nowhere close to where I need to be?

I’m a little stuck here.