Reputation: 1863
I can control P8_3, P8_4, but P8_5 stays stuck at 3V3.
I've booted the BB with this configuration to disable HDMI:
# cat /proc/cmdline
optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
Then I enabled GPIO 34+38+39 (P8_{5,3,4}):
# echo 34 > /sys/class/gpio/export
# echo 38 > /sys/class/gpio/export
# echo 39 > /sys/class/gpio/export
And set them as outputs:
# echo out > /sys/class/gpio/gpio34/direction
# echo out > /sys/class/gpio/gpio38/direction
# echo out > /sys/class/gpio/gpio39/direction
Then I'm setting them to alternate between HIGH/LOW at 1Hz using a script which writes as so:
# value is 0/1, pin is 34/38/39
# echo $value > /sys/class/gpio/gpio$pin/value
I measure P8_{3,4} alternating between 0V and 3V3, but P8_5 is stuck at 3V3.
I've tried compiling the devicetree overlay for gpio-P8.5 from here and adding it, but with the same result.
I'm aware that these pins are used by HDMI, but I thought I'd disabled HDMI with that kernel command-line, and I ideally need to use those specific pins due to the board I'm connecting the BBB to.
A colleague using my SD image also had the same issue on a BB green (which I believe doesn't have HDMI).
Upvotes: 1
Views: 260
Reputation: 1863
It seems the device tree files provided with the BBB were trying to configure GPIO#2 instead of GPIO#34 (gpio0_2 instead of gpio1_2).
I generated a new device-tree overlay for P8_5 (gpio1_2 / gpio34) with this and it all works now.
Upvotes: 1