Go to menuconfig, and select following things to enable network over USB for beagleboard. You won't need a wireless adapter or USB to ethernet adapter more. All will be over USB cable.
Device Driver
-> USB Support [y]
-> Inventra Highspeed Dual Role Controller (TI, ADI, ...) [y]
-> Driver Mode (Both host and peripheral: USB OTG (On The Go) Device
-> USB Gadget Support [y]
-> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support) [y]
-> RNDIS support [y]
Showing posts with label beagleboard. Show all posts
Showing posts with label beagleboard. Show all posts
Feb 16, 2010
Jan 3, 2010
Setup Buildroot for Beagleboard Development
Currently, when development with Beagleboard we often use OE distribution. The OE is hard to maintain for
me, and it requires to open everything so that I use buildroot to develop on Beagleboard.
Here is how to setup one.
1) Download the buildroot from http://www.buildroot.org/
2) You might want to use external toolchain by downloading the ARM toolchain from CodeSourcery (http://www.codesourcery.com/) or build using crosstool-ng
3) You might also want to use the omap linux kernel by downloading it using git (git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git)
4) Extract the buildroot into a folder and type `make menuconfig` to configure it.
* Target Architecture: arm
* Target Architecture Variant: generic_arm
* Target ABI: EABI
* For my Beagleboard, I need to configure the Target Options > Generic serial port config (y) > and change Serial port to run a getty on to (ttyS2) instead of (ttyS0)
- If using ttyS0, the my board cannot boot and stuck at `ip: RTNETLINK answers: File exists` (http://forums.xilinx.com/xlnx/board/message?board.id=ELINUX&thread.id=1677)
* Go to Toolchain settings
- If you are using External Toolchain, select Toolchain type to External binary toolchain and set the External toolchain path to correct path of your toolchain (i.e. /usr/local/xtools/armunknownlinuxuclibcgnueabi. This is my crosstool-ng installed location)
- If you are using Internal Toolchain (the toolchain built by buildroot), select Toolchain type to Buildroot toolchain.
* Go to Target filesystem options and select the target fs to build.
- If you are building the u-boot, you need to enter the Das U-Boot Monitor and select
+ board name: omap3_beagle
* Go to kernel settings
- If you are using Internal Kernel, select Kernel type to linux (Advanced Configuration) and select the kernel version as well as the configuration file to use (in the Linux Kernel Configuration), I copied the omap3_beagle_defconfig from arch/arm/configs to a specified location and customized it.
- If you are using External Kernel, select Kernel type to none.
5) Save the configuration and type `make` to build the system. After finished, the image is located at binaries/[project_name]/
NOTE:
+ If using external kernel, you will need to copy the kernel module into the root filesystem at project_build_arm/[project_name]/root or into the NFS root folder. (in kernel folder: make ... INSTALL_MOD_PATH=...)
+ The crosstool-ng cannot compile the uboot because of some bugs (http://old.nabble.com/-U-Boot---PATCH-2-2--ARM:-fix-build-error-with-gcc-4.4.2-about-inline-function-declared-weak-p26188857.html)
TODO:
+ The internal kernel is getting from kernel.org and doesn't contain the patches for omap platform. Need to sync with omap git repository to create the patch and put it under the target/.../ folder inside the buildroot
+ The internal toolchain is generic arm, and does not have omap specified optimization, need to sync with OE repository to create the patch and put it under the toolchain/.../ folder inside the buildroot
+ The internal kernel cannot have USB Gadget Driver, maybe missing some patch for omap
+ Add _defconfig (or board specific into the buildroot)
me, and it requires to open everything so that I use buildroot to develop on Beagleboard.
Here is how to setup one.
1) Download the buildroot from http://www.buildroot.org/
2) You might want to use external toolchain by downloading the ARM toolchain from CodeSourcery (http://www.codesourcery.com/) or build using crosstool-ng
3) You might also want to use the omap linux kernel by downloading it using git (git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git)
4) Extract the buildroot into a folder and type `make menuconfig` to configure it.
* Target Architecture: arm
* Target Architecture Variant: generic_arm
* Target ABI: EABI
* For my Beagleboard, I need to configure the Target Options > Generic serial port config (y) > and change Serial port to run a getty on to (ttyS2) instead of (ttyS0)
- If using ttyS0, the my board cannot boot and stuck at `ip: RTNETLINK answers: File exists` (http://forums.xilinx.com/xlnx/board/message?board.id=ELINUX&thread.id=1677)
* Go to Toolchain settings
- If you are using External Toolchain, select Toolchain type to External binary toolchain and set the External toolchain path to correct path of your toolchain (i.e. /usr/local/xtools/armunknownlinuxuclibcgnueabi. This is my crosstool-ng installed location)
- If you are using Internal Toolchain (the toolchain built by buildroot), select Toolchain type to Buildroot toolchain.
* Go to Target filesystem options and select the target fs to build.
- If you are building the u-boot, you need to enter the Das U-Boot Monitor and select
+ board name: omap3_beagle
* Go to kernel settings
- If you are using Internal Kernel, select Kernel type to linux (Advanced Configuration) and select the kernel version as well as the configuration file to use (in the Linux Kernel Configuration), I copied the omap3_beagle_defconfig from arch/arm/configs to a specified location and customized it.
- If you are using External Kernel, select Kernel type to none.
5) Save the configuration and type `make` to build the system. After finished, the image is located at binaries/[project_name]/
NOTE:
+ If using external kernel, you will need to copy the kernel module into the root filesystem at project_build_arm/[project_name]/root or into the NFS root folder. (in kernel folder: make ... INSTALL_MOD_PATH=...)
+ The crosstool-ng cannot compile the uboot because of some bugs (http://old.nabble.com/-U-Boot---PATCH-2-2--ARM:-fix-build-error-with-gcc-4.4.2-about-inline-function-declared-weak-p26188857.html)
TODO:
+ The internal kernel is getting from kernel.org and doesn't contain the patches for omap platform. Need to sync with omap git repository to create the patch and put it under the target/.../ folder inside the buildroot
+ The internal toolchain is generic arm, and does not have omap specified optimization, need to sync with OE repository to create the patch and put it under the toolchain/.../ folder inside the buildroot
+ The internal kernel cannot have USB Gadget Driver, maybe missing some patch for omap
+ Add _defconfig (or board specific into the buildroot)
Sep 8, 2009
How to build Valgrind for Beagleboard
1) Get Valgrind source code from SVN using revision 9648 and 1888 for VEX
svn co -r 9648 svn://svn.valgrind.org/valgrind/trunk
cd VEX
svn update -r 1888
2) Download the patch here http://bugsfiles.kde.org/attachment.cgi?id=32348
3) Apply the patch into the source code
cd valgrind
patch -p1 < [path to the patch]
4) Run autogen.sh to run autotools
5) Configure the source code
./configure --host=arm-angstrom-linux-gnueabi
The patch still has some bugs such as CPU instruction alignment you can 'cat /proc/cpu/alignment' to find out if the kernel is configured to fix unaligned accesses, and you can enable it by executing 'echo 2 > /proc/cpu/alignment' but it's enough to use for simple application.
Have fun with Valgrind :-)
Sep 4, 2009
How to build Clutter for Beagleboard
The Clutter need to be configured with =flavour=eglnative= so that it can work with SGX driver
The following is the configure command
with
The following is the configure command
./configure --with-flavour=eglnative --host=arm-angstrom-linux-gnueabi PKG_CONFIG=/data/workspace/OE/tmp/staging/i686-linux/usr/bin/pkg-config PKG_CONFIG_PATH=/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/lib/pkgconfig CFLAGS="--sysroot=/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/ -I/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/include" --with-x=no --with-gles=1.1 --with-imagebackend=internal
with
- --host: set the target for the build, need to be arm-angstrom-linux-gnueabi
- PKG_CONFIG: use the pgk-config command from OE distribution
- PKG_CONFIG_PATH: the path to search for *.pc file, need to be pointed to OE distribution
- --with-x: not using X
- --with-imagebackend: specific the image backend to use
- --with-gles: specific the GLES version to use (1.1 or 2.0)
- CFLAGS: override some C compiler flags
- --sysroot: the root directory to search for library and header files
- -I[include_dir]: some optional include directories to search for
Aug 10, 2009
Boot beagleboard with S-Video output
Boot beagleboard with S-Video output
setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait omapfb.mode=tv:1024x768-16@60 omapdss.def_disp=tv
mmcinit
fatload mmc 0:1 0x80300000
uImage-2.6.29 bootm 0x80300000
setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait omapfb.mode=tv:1024x768-16@60 omapdss.def_disp=tv
mmcinit
fatload mmc 0:1 0x80300000
uImage-2.6.29 bootm 0x80300000
Aug 8, 2009
How To Share Network with Beagleboard through USB
1) Follow this link to setup network connection between Beagleboard and Host
2) Setup ip forwarding in the Host (linux)
echo "Remove any previous NAT setup"
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
echo "Setup NAT to forward packets from usb0 <---> eth0"
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface usb0 -j ACCEPT
echo "Enable packet forwarding in the kernel"
echo 1 >> /proc/sys/net/ipv4/ip_forward
3) In the board add route to the host
route add default gw 192.168.99.100
4) In the board set the DNS search to be same as the host so that it can resolve host to name
cat /etc/resolve.conf
nameserver 192.168.1.1
That's all :-)
2) Setup ip forwarding in the Host (linux)
echo "Remove any previous NAT setup"
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
echo "Setup NAT to forward packets from usb0 <---> eth0"
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface usb0 -j ACCEPT
echo "Enable packet forwarding in the kernel"
echo 1 >> /proc/sys/net/ipv4/ip_forward
3) In the board add route to the host
route add default gw 192.168.99.100
4) In the board set the DNS search to be same as the host so that it can resolve host to name
cat /etc/resolve.conf
nameserver 192.168.1.1
That's all :-)
How To Setup Beagleboard Network through USB
1) Boot up the board
2) In the board type
ifconfig usb0 [ip_here] netmask [mask here] up
i.e. ifconfig usb0 192.168.99.100 netmask 255.255.255.0 up
3) In the host environment (linux) type
ifconfig usb0 [ip_here] netmask [netmask here] up
ifconfig usb0 192.168.99.101 netmask 255.255.255.0 up
Then you can ssh to the board with `ssh root@192.168.99.100
2) In the board type
ifconfig usb0 [ip_here] netmask [mask here] up
i.e. ifconfig usb0 192.168.99.100 netmask 255.255.255.0 up
3) In the host environment (linux) type
ifconfig usb0 [ip_here] netmask [netmask here] up
ifconfig usb0 192.168.99.101 netmask 255.255.255.0 up
Then you can ssh to the board with `ssh root@192.168.99.100
Aug 1, 2009
Boot the Beagleboard with NFS through USB
You need a USB cable and serial cable to connect from Beagleboard to your Linux host
Install
- NFS
- bridge-utils
1) Add file ifcfg-usb0 into /etc/sysconfig/network-scripts/
DEVICE=usb0
IPADDR=192.168.99.100 # Replace with your Linux host's IP address
NETMASK=255.255.255.0
ONBOOT=no
TYPE=USB
BOOTPROTO=none
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NM_CONTROLLED=no
TYPE=Ethernet
2) Add the ifcfg-br0 into /etc/sysconfig/network-script
4) Add br0 into /etc/init.d
3) Setup NFS: add following line to /etc/exports
/data/nfs *(rw,no_root_squash,no_all_squash,async)
4) Create directory /data/nfs and tar your root filesystem to /data/nfs
5) Type following commands to restart the NFS service
#service rpcbind restart
#service nfs restart
6) On BeagleBoard console type following command.
OMAP3 beagleboard.org # setenv bootargs console=ttyS2,115200n8 root=/dev/nfs rw nfsroot=192.168.99.100:/data/nfs ip=192.168.99.101::255.255.255.0 nolock,rsize=1024,wsize=1024 rootdelay=2
7) OMAP3 beagleboard.org # saveenv
8) OMAP3 beagleboard.org # mmcinit
9) OMAP3 beagleboard.org # fatload mmc 0 0x80300000 uImage
10) OMAP3 beagleboard.org # bootm 0x80300000
11) While the board is booting up, type ifconfig until you see the usb0 device is up. Then type `brctl addif br0 usb0`.
And enjoy the filesystem over NFS
Reference from http://elinux.org/Mount_BeagleBoard_Root_Filesystem_over_NFS_via_USB
Install
- NFS
- bridge-utils
1) Add file ifcfg-usb0 into /etc/sysconfig/network-scripts/
DEVICE=usb0
IPADDR=192.168.99.100 # Replace with your Linux host's IP address
NETMASK=255.255.255.0
ONBOOT=no
TYPE=USB
BOOTPROTO=none
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NM_CONTROLLED=no
TYPE=Ethernet
2) Add the ifcfg-br0 into /etc/sysconfig/network-script
# Ethernet Bridge DEVICE=br0 ONBOOT=no SEARCH="localhost" # Replace with your search domains BOOTPROTO=none NETMASK=255.255.255.0 # Replace with your subnet's netmask IPADDR=192.168.99.100 # Replace with your Linux host's IP address USERCTL=no PEERDNS=yes IPV6INIT=no GATEWAY=192.168.1.1 # Replace with your subnet's gateway TYPE=Ethernet DNS1=192.168.1.1 # Replace with your subnet's DNS DOMAIN='localhost' # Replace with your Linux host's domain(s) NM_CONTROLLED=no
4) Add br0 into /etc/init.d
#!/bin/bash # Source function library. . /etc/rc.d/init.d/functions RETVAL=0 # Check if all what named needs running start() { /usr/sbin/brctl addbr br0 /usr/sbin/brctl addif br0 eth0 /sbin/ifup eth0 /sbin/ifup br0 return 0; } stop() { /sbin/ifdown br0 /sbin/ifdown eth0 /usr/sbin/brctl delbr br0 } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage: $0 {start|stop|restart}" exit 3 esac exit $RETVAL
3) Setup NFS: add following line to /etc/exports
/data/nfs *(rw,no_root_squash,no_all_squash,async)
4) Create directory /data/nfs and tar your root filesystem to /data/nfs
5) Type following commands to restart the NFS service
#service rpcbind restart
#service nfs restart
6) On BeagleBoard console type following command.
OMAP3 beagleboard.org # setenv bootargs console=ttyS2,115200n8 root=/dev/nfs rw nfsroot=192.168.99.100:/data/nfs ip=192.168.99.101::255.255.255.0 nolock,rsize=1024,wsize=1024 rootdelay=2
7) OMAP3 beagleboard.org # saveenv
8) OMAP3 beagleboard.org # mmcinit
9) OMAP3 beagleboard.org # fatload mmc 0 0x80300000 uImage
10) OMAP3 beagleboard.org # bootm 0x80300000
11) While the board is booting up, type ifconfig until you see the usb0 device is up. Then type `brctl addif br0 usb0`.
And enjoy the filesystem over NFS
Reference from http://elinux.org/Mount_BeagleBoard_Root_Filesystem_over_NFS_via_USB
Subscribe to:
Posts (Atom)