BeagleBone Black - USB network interface

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

BeagleBone Black - USB network interface

Postby photomankc » Mon May 06, 2013 4:14 am

Is there a way to get the usb network adapter that is built into the mini-usb power connector working under Arch? I found that to be a pretty useful feature but I prefer Arch to Angstrom. I didn't figure out what in the Angstrom distribution was providing that interface and IP to the computer.
photomankc
 
Posts: 16
Joined: Mon Mar 04, 2013 10:00 pm

Re: BeagleBone Black - USB network interface

Postby kmihelich » Tue May 07, 2013 2:13 am

You need to load/use the USB gadget ethernet device.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1122
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinux-arm

Re: BeagleBone Black - USB network interface

Postby photomankc » Tue May 07, 2013 5:13 am

Thanks, found the kernel module so now just need to setup the IP address.
photomankc
 
Posts: 16
Joined: Mon Mar 04, 2013 10:00 pm

Re: BeagleBone Black - USB network interface

Postby photomankc » Wed May 08, 2013 5:54 am

So now with the module loading at boot and a netcfg profile for it, it all works beautiful if the USB is plugged in at boot time! So that's good news. Otherwise though I have to manually bring it up with netcfg if it was not plugged in durring the boot. Is it possible to tell netcfg to bring the interface up and configure it even if there is no carrier? The ideal here is to have that interface always there for debuging. The other interface will be wireless and there are times now and then when it just doesn't come up at boot time like it should.

I guess from reading the other option is ifplugd. I'd just prefer it to be an easy, always there static connection rather than have another service that needs to be running to bring it up dynamically.
photomankc
 
Posts: 16
Joined: Mon Mar 04, 2013 10:00 pm

Re: BeagleBone Black - USB network interface

Postby agongon » Sat May 25, 2013 5:03 pm

I had some problems with the USB 500 mA limit. Seems that alarm defaults to the "performance" governor on boot. Thus I couldnt boot my beaglebone black via USB if my ethernet cable was plugged in (to much power requirement).

In the end, following this thread I did this:

1. Enable "g_ether" module on boot.
Code: Select all
# echo g_ether > /etc/modules-load.d/g_ether.conf


2. Create a new netcfg profile
Code: Select all
# nano  /etc/network.d/ethernet-usb0

paste content so it looks like this for example. Choose any fixed IP you wish. I chose 192.168.10.2
## Change for static
CONNECTION='ethernet'
DESCRIPTION='Conection via USB'
INTERFACE='usb0'
IP='static'
ADDR='192.168.10.2'
##ROUTES=('192.168.0.0/24 via 192.168.1.2')
#GATEWAY='192.168.1.1'
#DNS=('192.168.1.1')


3. Enable new profile
Code: Select all
# nano /etc/conf.d/netcfg

Add the new usb0 profile to the "NETWORKS" line.
NETWORKS=(ethernet-eth0 ethernet-usb0)


Now, everytime you boot up with the USB cable conected to your PC, the beagle will via USB to it. Last step is to tell your PC what IP to use. (I use Arch on my desktop)

4. On your desktop check that the USB0 network has been recognized with "ifconfig -a" (after rebooting your beagle) and give it an ip. It should be called usb0, but can have other name depending on your PC.
Code: Select all
# ifconfig ifconfig usb0 192.168.10.1


5. Final check (run this on your desktop)
Code: Select all
ping -c 3 192.168.10.2


I hope this might be useful for someone

BTW: if you have problems with power limits, this might not be enough. Consider changing your cpu scaling governor to ondemand (which should be IMO default on bootup)
agongon
 
Posts: 5
Joined: Sat May 25, 2013 3:28 pm

Re: BeagleBone Black - USB network interface

Postby PLyttle » Mon Jun 10, 2013 7:29 am

The 500 mA limit is the default cut-off value programmed in the in the TPS65217C device. In the original Angstrom configuration it is set to 1300 mA, the Vanilla Arch leaves it at 500 mA

you can fix this as follows

insert "i2c mw 0x24 1 0x3e; " (without quotes, and mind the space at the end) as the first command in the uenvcmd= line of uEnv.txt in the first (FAT) partition

it should read

uenvcmd=i2c mw 0x24 1 0x3e; run findfdt; if test $board_name = A335BNLT; then ....

warning1: please use an editor that uses unix style linefeeds. the best way is to mount the first partition on the beaglebone and use nano to modify uEnv.txt.

warning2: please do not mistype or play with other settings. You can easily change critical settings in the power management chip and blow up your beaglebone. Read the datasheet first if you are unsure (or curious)

now reboot.

to check you can use i2cdump (install i2c-tools first)

Code: Select all
i2cdump -f 0 0x24

should read:

Code: Select all
I will probe file /dev/i2c-0, address 0x24, mode byte                         
Continue? [Y/n]                                                               
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef       
00: e2 3e 00 01 b1 80 b2 01 00 00 84 00 7f 0c 18 11    ?>.?????..?.????       
10: 08 06 09 38 26 3f 7f 00 03 15 5f 32 40 20 00 00    ???8&??.??_2@ ..


If address 01 reads 3d (e2 3d 00 01 b1 ) you are still at 500 mA

Hope this helps

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: BeagleBone Black - USB network interface

Postby kmihelich » Mon Jun 10, 2013 3:12 pm

Thanks for coming across this, I'll get it integrated into the bootloader tarball later today.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1122
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinux-arm

Re: BeagleBone Black - USB network interface

Postby PLyttle » Mon Jun 10, 2013 4:07 pm

One more thing...

no matter what you do, which buttons you press or however you apply power, when the internal eMMC contains a valid u-boot, the SD-card uEnv.txt WILL NOT BE READ. How this works with mixed distro's i don't know, but with Arch installed internally, modifying the uEnv on the card, and boot from it will not lead to the expected result.

I'm too lazy to figure out why this happens. I can live with it, but you need to know this in order to prevent frustration.

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: BeagleBone Black - USB network interface

Postby kmihelich » Mon Jun 10, 2013 4:18 pm

Using our bootloader package with our uEnv.txt, any attached SD card is always probed first for reading a uEnv.txt:

Code: Select all
bootcmd=run findfdt; if test $board_name = A335BNLT; then setenv mmcdev 1; mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;setenv mmcdev 0; mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loaduimage; then run loadfdt;run mmcboot;fi;else run nandboot;fi;
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1122
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinux-arm

Re: BeagleBone Black - USB network interface

Postby PLyttle » Mon Jun 10, 2013 4:39 pm

That I understand, but which uEnv.text gets read is different. (that is before your script is even available :-)
when there is one on the eMMC it gets preference, hence my comment.

EDIT
Ah, I see... I'll have to implement this bootloader before I comment any further. my remarks were based on the previous version
sorry for the confusion

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Next

Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 1 guest