'Beaglebone PRU default GPIO values
I am unable to set the default value of a GPIO for the PRU. I would like to have a “pull-down” default, but when I boot the signal is “high” > 3.3v.
My system:
Linux beaglebone 4.19.94-ti-r62 #1buster SMP PREEMPT Sat Apr 24 00:27:24 UTC 2021 armv7l GNU/Linux
Beaglebone Black Rev C
Booting with the UIO pruss
In /boot/uEnv.txt - uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
Steps I took:
-
Went to https://kilobaser.com/beaglebone-black-device-tree-overlay-generator/ to get a dts -
Selected P9_27, fast Slew, Output, Pulldown, Mode5: pr1_pru0_pru_r30_5 -
It generated:
/dts-v1/;
/plugin/;
/{
compatible = "ti,beaglebone", "ti,beaglebone-black";
part_number = "BS_PINMODE_P9_27_0x5";
exclusive-use =
"P9.27",
"pr1_pru0_pru_r30_5";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
bs_pinmode_P9_27_0x5: pinmux_bs_pinmode_P9_27_0x5 {
pinctrl-single,pins = <0x1a4 0x5>;
};
};
};
fragment@1 {
target = <&ocp>;
__overlay__ {
bs_pinmode_P9_27_0x5_pinmux {
compatible = "bone-pinmux-helper";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bs_pinmode_P9_27_0x5>;
};
};
};
};
-
Compiled and applied the device tree -
Reboot, on boot the o-scope on P9_27 goes high
I’ve tried on P9_25 as well, same result. (Update: I have tried ALL of the PRU gpios on P9 with the same result). I’ve configured it for Mode 7 (standard GPIO) and it works fine. Just Mode 5 does not seem to be responding as expected.
Can anyone verify my issue and offer a solution?
Additional clarification, the reason I believe I have configured P9_27 in the above example to be low on boot is this:
pinctrl-single,pins = <0x1a4 0x5>;
The 0x1a4 is the address offset for P9_27 0x5 = 0000 0101 - the top 5 bits are the mode in the table below. The 101 selects mode 5 (Bits 2-0) in table below. For a general GPIO, this functionality works perfectly, and there does not seem to be different rules for GPIOs associated with the PRUs
Bit Field Reset Description
6 conf_<module>_<pin>_slewctrl X Slew Control. Slew Rate: Fast is 0, Slow is 1
5 conf_<module>_<pin>_rxactive 1h Receiver Active. Input Enable: Receiver Disable 0, Receiver Enable 1
4 conf_<module>_<pin>_putypesel X Pad Pullup/Pulldown Type. Pulldown is 0, Pullup is 1
3 conf_<module>_<pin>_puden X Pad Pullup/Pulldown enable. Enabled is 0, Disabled is 1
2-0 conf_<module>_<pin>_mmode X Mode. Pad functional mux select. A number between 0 and 7 i.e. 000 and 111. This depends on which mode we require.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
