beaglebone GPIO3_13 (aka GPIO109) not exposed on P8 or P9? - beagleboneblack

I have run into some problem controlling usb1' power. as I investigated from
"https://e2e.ti.com/support/arm/sitara_arm/f/791/t/270060" It tells me that GPIO3_13 controls usb1_drvvbus pin, which controls the usb power.
I understand that there is software method to change the voltage of this pin.
My question is that where is GPIO3_13 located on P8 or P9 expansion bays? I cannot find it on any diagrams. Is it purposefully not exposed anywhere?

You can control USB1 power from software on the beaglebone, if you are using a recent elinux.org Debian image (the necessary device tree overlay was merged in June 2015). This uses a hack to expose the usb1_drvvbus signal as a fake LED, which can then be controlled using the files in /sys.
Firstly, load the dev-USB-PWR-CTL-00A1.dtbo device tree overlay. For recent setups (where all dtbos are loaded by uboot and then passed to the kernel at boot time), this could be done by adding dtb_overlay=/lib/firmware/dev-USB-PWR-CTL-00A1.dtbo to /boot/uEnv.txt and rebooting (older kernels/uboots will need to use the older config mechanisms as described in /boot/uEnv.txt).
You can then do this:
echo 'usb1' > /sys/bus/usb/drivers/usb/unbind
echo 0 > /sys/devices/platform/leds/leds/usb_hub_power/brightness
sleep 1
echo 255 > /sys/devices/platform/leds/leds/usb_hub_power/brightness
echo 'usb1' > /sys/bus/usb/drivers/usb/bind

Related

Can't locate Arduino AT-Tiny

I have 2 types of ARDUINO-cards. ATMEGA 2560 and ATMEGA 328P.
In my Delphi7 (XP64 sp2) I have modified the JvHidDeviceController Unit to show the PID/VID's of the abovementioned Cards. That works perfectly. And with the use of the TComPort unit I can communicate with the selected card. No problems here.
And here is the problem:
I connect my AVR MARK II (usb-tiny). System "says" OK.
(When I run the ARUINO program I have no problems communicating with the connected card.)
I run the Delphi program (JVHidDeviceController Unit), the 2560 and 328p PID/VID appear in a LIST-box but NOT the AVR-MARK II.
I Wonder why ? Please help.
After a search on the WWW I discovered, that the UNO (328P) could be turned into a ISP programmer. And by doing so I solve 2 (sub-)problems. I got the code ("bootloader") and the UNO Stills responds to the JVHidDeviceController requests. (Final solution in reach.. ) Kris

SPI on Beagleboard Black

I've been trying to make the serial communication work on my BBB for days now and I am running out of ideas.
When I use just the BBB and connect MISO/MOSI I get the signal transfer on MOSI, SCLK and CS (MISO is mainly at high level). However, when I connect the lines to my slave part it does not work. I checked the signals on the oscilloscope and they seem fine and the part which I am using as the slave is working well when I set it in parallel mode, so I believe some programming or configuration must be wrong.
This is basically what I do:
config-pin P9.17 spi_cs
config-pin P9.18 spi
config-pin P9.21 spi
config-pin P9.22 spi_sclk
python
from Adafruit_BBIO.SPI import SPI
spi = SPI(1,0) #I would expect SPI(0,0) here, but I get the signal on the above configured ports
Then I set the configurations (already tried in many ways):
spi.mode = 0
spi.cshigh = False
spi.msh = 10500000
spi.bpw = 16
spi.lsbfirst = False
After that I open it and try to send data:
spi.open(1,0)
spi.xfer2([1,254])
If anyone is interested, I am trying to program the LMH6517 as slave and I already tried to ask about this at the TI forum here:
https://e2e.ti.com/support/amplifiers/f/14/t/751415
Oscilloscope images:
CS and SCLK
MOSI and SCLK
MISO and SCLK
Thank you,
JPL

Beaglebone Black: How to turn pins on/off programatically?

I have a Beaglebone Black from which I use the some VCC pin. I need to programatically turn on/off VCC pins.
Say, the VCC pin number is #5, I am looking for some Linux command that will turn that particular pin on/off.
Is it possible via command line? or, there are some other way? is it possible at all?
please help.
What does you mean "VCC pin"?
You can't on/off VDD pins on connector P9 but tou can control GPIO pins (and switch power from VDD pins with an appropriate transistor).
From command line one can control GPIO via sysfs interface.
debian#beaglebone:$ cd /sys/class/gpio
debian#beaglebone:/sys/class/gpio$ ls
export gpio14 gpio26 gpio4 gpio48 gpio60 gpio68 gpiochip64
gpio112 gpio15 gpio27 gpio44 gpio49 gpio61 gpio69 gpiochip96
gpio114 gpio2 gpio3 gpio45 gpio5 gpio65 gpio7 unexport
gpio115 gpio22 gpio30 gpio46 gpio50 gpio66 gpiochip0
gpio116 gpio23 gpio31 gpio47 gpio51 gpio67 gpiochip32
You can see here directories for already exported GPIO pins and some additional files, see GPIO Sysfs Interface for Userspace
For example, I use GPIO49 (P9, pin 23) for LED control:
debian#beaglebone:/$ sudo su
root#beaglebone:/# cd /sys/class/gpio/gpio49
root#beaglebone:/sys/class/gpio/gpio49# cat direction
in
root#beaglebone:/sys/class/gpio/gpio49# echo out >direction
root#beaglebone:/sys/class/gpio/gpio49# echo 1 >value
root#beaglebone:/sys/class/gpio/gpio49# echo 0 >value
root#beaglebone:/sys/class/gpio/gpio49#
So that, you can control GPIO pins manually from command line, from bash script, and from any user-space program using file i/o.

Using GPIO3_13 (GPIO109) to disable USB VBUS

I found dev-USB-PWR-CTL-00A1.dtbo file. (I think this is source code for it).
Using this file I try to expose USB1_DRVVBUS pin as GPIO (GPIO3_13) with commands:
echo dev-USB-PWR-CTL > /sys/devices/platform/bone_capemgr/slots
echo 109 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio109/direction
I see new cape entry in slots and new gpio files tree.
But when I change value with command
echo 0 > /sys/class/gpio/gpio109/value
I see new value in this file but nothing happens with USB VBUS.
What am I missing?
(Before you ask do I really need this: let's leave the consequences on the side for a moment.)
Have you looked at this? question about exactly this on the Beagleboard Google Group
Please note that there are some differences to back then and current images, e.g. by default CapeManager is disabled and overlays are loaded once in U-Boot
If you are using a recent elinux.org Debian image (the necessary device tree overlay was merged in June 2015), it includes a device tree overlay (with the comment "Unless you know what you are doing, do not load this cape!!!"). This uses a hack to expose the usb1_drvvbus signal as a fictitious LED, which can then be controlled using the led interface in /sys.
Firstly, load the dev-USB-PWR-CTL-00A1.dtbo device tree overlay. For recent setups (where all dtbos are loaded by uboot and then passed to the kernel at boot time), this could be done by adding dtb_overlay=/lib/firmware/dev-USB-PWR-CTL-00A1.dtbo to /boot/uEnv.txt and rebooting (older kernels/uboots will need to use the older config mechanisms as described in /boot/uEnv.txt).
You can then do this:
echo 'usb1' > /sys/bus/usb/drivers/usb/unbind
echo 0 > /sys/devices/platform/leds/leds/usb_hub_power/brightness
sleep 1
echo 255 > /sys/devices/platform/leds/leds/usb_hub_power/brightness
echo 'usb1' > /sys/bus/usb/drivers/usb/bind
... to power-cycle the device attached to USB1.

Beaglebone Black – unload cape

I am using a Beaglebone Black with the most recent OS (Debian Jessie, kernel v4.1). I need to be able to use pin P9_19 as a GPIO pin, but pin 19 has already been assigned to I2C_2_SCL.
When I try to use it, I get the error (octalbonescript):
The pin P9_19 is not availble to write. Please make sure it is not used by another cape.
How can I unload the I2C cape to expose pin P9_19 for GPIO access?
There are many ways to do that.
Using device tree overlay: echo cape-universaln dtbo file to slots
or use this link to gernerate overlay file for gpio purpose, compile source dts file using
dtc -O dtb -o /lib/firmware/bspm_P9_19_17-00A0.dtbo -b 0 -# /lib/firmware/bspm_P9_19_17-00A0.dts
and then deploy output dtbo file to /lib/firmware and then echo it to slots.
Also I personally recommend you to use this amazing library Wirigbone for beaglebone, this is by far best for beaglbone.

Resources