How to Disable HDMI, Use SPI1 pins as GPIOs and still keep wifi working on BBGW.

Hi,

I want to use connector P9 pins 28,29,30 and 31 as normal GPIO pins on BBGW. As they are used by HDMI by default so I tried disabling overlays by editing uEnv.txt :

  1. Un-commenting line

dtb=am335x-boneblack-emmc-overlay.dtb

  1. adding “a” to universal in line:
    cmdline=coherent_pool=1M quiet cape_universal=enable → cmdline=coherent_pool=1M quiet cape_universala=enable

This makes P9.28, P9.29, P9.30, and P9.31 pins available as GPIO for my SPI BitBang code (Yes it has to be Bit banging). But, Wifi and Bluetooth stops working with these changes.

I also tried other solution by adding two lines in uEnv.txt :

enable_uboot_overlays=1
disable_uboot_overlay_video=1

With this , Wifi works , I can also see SpiDev listed in /dev/ … But still cant use those pins as GPIOs.

I saw many related posts and some have got SPI working … but not able to see solution to get these Pins GPIO pins.

Please help me here if you know the solution.

Thanks.

Please run:

sudo /opt/scripts/tools/version.sh

Regards,

Hi Robert,

Thanks for the reply. I didnt have version.sh so I took it from : https://github.com/RobertCNelson/boot-scripts/blob/master/tools/version.sh

Ran, and following is the output.

root@beaglebone:/opt/scripts/tools# ./version.sh

git:/opt/scripts/:[b71b6d7027178ee430a0d10b1b4dbb4257400361]
eeprom:[A335BNLTGW1ABBGW16063634]
model:[TI_AM335x_BeagleBone_Green_Wireless]
dogtag:[BeagleBoard.org Debian Image 2016-06-14]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2016.03-00002-g30051ac]:[location: dd MBR]
kernel:[4.4.9-ti-r25]
nodejs:[v0.12.13]
uboot_overlay_options:[enable_uboot_overlays=1 ]
uboot_overlay_options:[disable_uboot_overlay_video=1]
pkg:[bb-cape-overlays]:[4.1.20160610-0rcnee1~bpo80+20160610+1]
pkg:[bb-wl18xx-firmware]:[1.20160602-0rcnee1~bpo80+20160602+1]
pkg:[kmod]:[18-3]
WARNING:pkg:[roboticscape]:[NOT_INSTALLED]
WARNING:pkg:[firmware-ti-connectivity]:[NOT_INSTALLED]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal netdev i2c admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=UUID=3b35d211-8feb-4efb-96e4-a2e18824a0a4 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 2.000291] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper

Let me know if this helps.

Regards,
Pooja

Yeah, we could get that old 2016-06-14 image updated to support what
you want to, but it would just be faster to grab:

https://rcn-ee.net/rootfs/bb.org/testing/2018-06-03/stretch-iot/bone-debian-9.4-iot-armhf-2018-06-03-4gb.img.xz

Use etcher.io to flash it to a microsd, then once you bootup the first
time, just go into /boot/uEnv.txt and enable this line:

disable_uboot_overlay_video=1

and spi will be available to you by default, just need to use
config-pin to correctly mux the pins..

Regards,

Okay, thanks for sharing the link I will burn that on uSD now. Please confirm once again that with this new image I will be able to use SPi1 pins as GPIO pins by default or I will have to change any settings further?.

Regards

Just make that one /boot/uEnv.txt change i mentioned,

then if it still doesn't work, run version.sh again.

Regards,

I upgraded the image and added disable_uboot_overlay_video=1 in uEnv.txt. version.sh output is as follows:

root@beaglebone:~# /opt/scripts/tools/version.sh
git:/opt/scripts/:[607c2f08e25c061f61ec78d15be3fe9b9999a3b7]
eeprom:[A335BNLTGW1ABBGW16063634]
model:[TI_AM335x_BeagleBone_Green_Wireless]
dogtag:[BeagleBoard.org Debian Image 2018-06-03]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2016.03-00002-g30051ac]:[location: dd MBR]
kernel:[4.14.44-ti-r51]
nodejs:[v6.14.2]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
pkg:[bb-cape-overlays]:[4.4.20180424.0-0rcnee0~stretch+20180424]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
pkg:[roboticscape]:[0.4.4-git20180530.0-0rcnee0~stretch+20180530]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.027327] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.028831] gpio-of-helper ocp:cape-universal: ready
END

Previously I was using MRAA uitility to toggle GPIOs n check , but with this build MRAA is not already installed. So i checked in class:

root@beaglebone:/sys/class/gpio# ls
export gpio13 gpiochip0 gpiochip64 unexport
gpio12 gpio60 gpiochip32 gpiochip96

Only these many GPIOs are listed, I can toggle them. But I need GPIO 74 to 77. Can you please let me know how to check them (I am at beginner level in linux).
Also, I cant see any SPIdev in ls /dev/ .

Thanks,
Pooja

I upgraded the image and added disable_uboot_overlay_video=1 in uEnv.txt.
version.sh output is as follows:

root@beaglebone:~# /opt/scripts/tools/version.sh
git:/opt/scripts/:[607c2f08e25c061f61ec78d15be3fe9b9999a3b7]
eeprom:[A335BNLTGW1ABBGW16063634]
model:[TI_AM335x_BeagleBone_Green_Wireless]
dogtag:[BeagleBoard.org Debian Image 2018-06-03]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot
2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot
2016.03-00002-g30051ac]:[location: dd MBR]

Weird, this one didn't show up in your last version.sh, that's
blocking things from working..

Run this to remove the conflicting u-boot.

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10

kernel:[4.14.44-ti-r51]
nodejs:[v6.14.2]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
pkg:[bb-cape-overlays]:[4.4.20180424.0-0rcnee0~stretch+20180424]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video
plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep
admin spi tisdk weston-launch xenomai]
pkg:[roboticscape]:[0.4.4-git20180530.0-0rcnee0~stretch+20180530]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4
rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.027327] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size
568
dmesg | grep gpio-of-helper
[ 1.028831] gpio-of-helper ocp:cape-universal: ready
END

Previously I was using MRAA uitility to toggle GPIOs n check , but with this
build MRAA is not already installed. So i checked in class:

Yeah, we don't ship MRAA any more..

root@beaglebone:/sys/class/gpio# ls
export gpio13 gpiochip0 gpiochip64 unexport
gpio12 gpio60 gpiochip32 gpiochip96

Only these many GPIOs are listed, I can toggle them. But I need GPIO 74 to
77. Can you please let me know how to check them (I am at beginner level in
linux).
Also, I cant see any SPIdev in ls /dev/ .

Remove the old conflicting u-boot in eMMC..

Regards,

Hi Robert,

I executed that command and again sending version.sh output

root@beaglebone:~# /opt/scripts/tools/version.sh
git:/opt/scripts/:[b71b6d7027178ee430a0d10b1b4dbb4257400361]
eeprom:[A335BNLTGW1ABBGW16063634]
model:[TI_AM335x_BeagleBone_Green_Wireless]
dogtag:[BeagleBoard.org Debian Image 2016-06-14]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2016.03-00002-g30051ac]:[location: dd MBR]
kernel:[4.4.9-ti-r25]
nodejs:[v0.12.13]
uboot_overlay_options:[enable_uboot_overlays=1 ]
uboot_overlay_options:[disable_uboot_overlay_video=1]
pkg:[bb-cape-overlays]:[4.1.20160610-0rcnee1~bpo80+20160610+1]
pkg:[bb-wl18xx-firmware]:[1.20160602-0rcnee1~bpo80+20160602+1]
pkg:[kmod]:[18-3]
WARNING:pkg:[roboticscape]:[NOT_INSTALLED]
WARNING:pkg:[firmware-ti-connectivity]:[NOT_INSTALLED]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal netdev i2c admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=UUID=3b35d211-8feb-4efb-96e4-a2e18824a0a4 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 2.000410] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper

I was hoping to see more gpios in the class folder, still its following

root@beaglebone:~# ls /sys/class/gpio/
export gpiochip0 gpiochip32 gpiochip64 gpiochip96 unexport

is there anything else missing.

Thanks,
Pooja

Wrong microSD, switch back to the other one..

dogtag:[BeagleBoard.org Debian Image 2018-06-03]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot
2018.03-00002-gac9cce7c6a]:[location: dd MBR]

Regards,