Difference between revisions of "Compiling Yantrr Vayu Drivers on Debian Wheezy"

From Yantrr Wiki
Jump to: navigation, search
(USB Gadget (http access to beaglebone black over usb))
 
(36 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Note : All steps are executed on a Ubuntu System and as a root user. We used Ubuntu 12.04 LTS. Most of the steps are exactly same as described in the
+
Note : All steps are executed on the Ubuntu 12.04 LTS and as a root user. Most of the steps are similar Robert C Nelson BBB [http://eewiki.net/display/linuxonarm/BeagleBone+Black Wiki].
[http://eewiki.net/display/linuxonarm/BeagleBone+Black BBB-RobertCNelson-Main Wiki].
+
  
=== Basic Requirements ===
+
== Basic Requirements ==
 
* ARM Cross Compiler : Linaro: https://launchpad.net/linaro-toolchain-binaries
 
* ARM Cross Compiler : Linaro: https://launchpad.net/linaro-toolchain-binaries
* Bootloader Das U-Boot – the Universal Boot Loader http://www.denx.de/wiki/U-Boot
+
* Bootloader Das U-Boot : The Universal Boot Loader http://www.denx.de/wiki/U-Boot
** Source http://git.denx.de/?p=u-boot.git;a=summary
+
** Source : http://git.denx.de/?p=u-boot.git;a=summary
 
* Linux Kernel  
 
* Linux Kernel  
 
** Linus's Mainline tree: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary  
 
** Linus's Mainline tree: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary  
Line 13: Line 12:
 
* Debian Squeeze: http://www.debian.org/
 
* Debian Squeeze: http://www.debian.org/
  
== 1 ARM cross compiler linaro gcc (~/) ==
+
== ARM cross compiler linaro gcc (~/) ==
 
Download  and extract the ARM Cross compiler linaro gcc . Supposedly we mark that directory as root (~/)
 
Download  and extract the ARM Cross compiler linaro gcc . Supposedly we mark that directory as root (~/)
 
<pre>
 
<pre>
Line 20: Line 19:
 
export CC='pwd'/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-
 
export CC='pwd'/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-
 
</pre>
 
</pre>
test the version of the gcc path set above to verify it will work
+
Test the version of the gcc path set above to verify it will work
 
<pre>
 
<pre>
 
${CC}gcc –version
 
${CC}gcc –version
Line 35: Line 34:
 
</pre>
 
</pre>
  
== 2. bootloader U-boot  (~/) ==
+
== Bootloader U-boot  (~/) ==
 
Bootloader used is Das U-Boot, and its works like charm. Das U-Boot -- the Universal Boot Loader http://www.denx.de/wiki/U-Boot
 
Bootloader used is Das U-Boot, and its works like charm. Das U-Boot -- the Universal Boot Loader http://www.denx.de/wiki/U-Boot
  
Line 60: Line 59:
 
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config
 
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config
 
make ARCH=arm CROSS_COMPILE=${CC}
 
make ARCH=arm CROSS_COMPILE=${CC}
<pre>
+
</pre>
  
== 3. Upgrade distro "device-tree-compiler" package ==
+
== Upgrade distro "device-tree-compiler" package ==
 
<pre>
 
<pre>
 
  (~/) {In the working directory}
 
  (~/) {In the working directory}
Line 70: Line 69:
 
</pre>
 
</pre>
  
== 4. linux kernel (~/) ==  
+
== Linux kernel (~/) ==  
We follow RobertCNelson branch of the kernel for more detail go to <big>[http://eewiki.net/display/linuxonarm/BeagleBone+Black BBB-RobertCNelson-Main Wiki]</big>
+
We follow RobertCNelson branch of the kernel. For more details, please go to [http://eewiki.net/display/linuxonarm/BeagleBone+Black BBB-RobertCNelson-Main Wiki]
 +
=== Git setup and Kernel Compile ===
 
<pre>
 
<pre>
 
git clone git://github.com/RobertCNelson/linux-dev.git
 
git clone git://github.com/RobertCNelson/linux-dev.git
Line 77: Line 77:
 
</pre>
 
</pre>
  
'''checkout v3.8.xbranch (full cape support) ''' there are other versions check <big>[http://eewiki.net/display/linuxonarm/BeagleBone+Black BBB-RobertCNelson-Main Wiki]</big>
+
'''checkout v3.8.xbranch (full cape support) ''' There are other versions,check here [http://eewiki.net/display/linuxonarm/BeagleBone+Black BBB-RobertCNelson-Main Wiki]
 
<pre>
 
<pre>
 
git checkout origin/am335x-v3.8 -b eewiki
 
git checkout origin/am335x-v3.8 -b eewiki
 
</pre>
 
</pre>
  
'''<big>Now setup the git and compile the kernel</big>'''  
+
'''Now setup the git and compile the kernel'''  
 
  <pre>
 
  <pre>
 
apt-get update
 
apt-get update
Line 91: Line 91:
 
</pre>
 
</pre>
  
<big>Add support of USB and PPS driver</big>
+
=== Add USB and PPS driver ===
 +
While compiling for first time, LINUX_GIT is set by default(check its path in build_kernel.sh and /tools/rebuild.sh).
 +
Set it to 'pwd'/linux-dev/ignore/linux-src/ in build_kernel.sh and /tools/rebuild.sh, so use following for later use:
  
#LINUX_GIT is set by default(check its path in build_kernel.sh and /tools/rebuild.sh while compiling and set it to 'pwd'/linux-dev/ignore/linux-src/, so use following for later use
+
<pre>
 
export LINUX_GIT='pwd'/linux-dev/ignore/linux-src/
 
export LINUX_GIT='pwd'/linux-dev/ignore/linux-src/
#Please download our USB drivers patch which is required to use the WCDMA modem on Cape.  
+
</pre>
 +
 
 +
Please download our USB drivers patch which is required to use the WCDMA modem on Cape.  
 +
<pre>
 
wget wcdma_patch_vayu_usb_drivers.patch
 
wget wcdma_patch_vayu_usb_drivers.patch
command for applying the patch in git ( have to figure it out exactly)
+
patch -p1 < wcdma_patch_vayu_usb_drivers.patch
#Now rebuild the kernel  while enabling the pps drivers in makemenuconfig and after USB drivers patch applied if required.
+
</pre>
./tools/rebuild.sh
+
#Following figures illustrate how to enable the PPS drivers and also some settings in USB drivers section
+
i. First image shows the first screen of makemenuconfig while recompiling the kernel. Select Device drivers .
+
  
 +
Alternate to this, if patch is not applied clean, do following
  
ii. In the device drivers window, scroll down to select PPS support.
+
'''Locate the file option.c under: /linux/drivers/usb/serial/option.c'''
 +
Edit the file to add following
 +
* Define on top following
 +
<pre>
 +
/*  Yantrr Strongrising products */
 +
#define YANTRR_VENDOR_ID                        0x21f5
 +
#define YANTRR_PRODUCT_VAYU3G                  0x2012
 +
</pre>
 +
* Add following structure inside  static struct usb_device_id option_ids[], you would find lot of modem defined here
 +
<pre>
 +
/*  Yantrr Strongrising products */
 +
{ USB_DEVICE(YANTRR_VENDOR_ID, YANTRR_PRODUCT_VAYU3G) },
 +
</pre>
  
 +
* You may create your local patch based on kernel for next time patch
 +
* This option adding would help udev to detect the device
  
iii. In PPS support, select PPS client using GPIO as built-in driver. It should look like as illustrated in figure below :
+
=== Rebuild kernel ===
 +
Now rebuild the kernel while enabling the pps drivers in makemenuconfig and after USB drivers patch applied.
 +
<pre>
 +
./tools/rebuild.sh
 +
</pre>
  
 +
*Following figures illustrate how to enable the PPS drivers and also some settings in USB drivers section
 +
:* First image shows the first screen of makemenuconfig while recompiling the kernel. Select Device drivers .
 +
[[File:First Image for makemenuconfig.png|center|border | Select device drivers]]
  
 +
:* In the device drivers window, scroll down to select PPS support.
 +
[[File:Second Image for makemenuconfig.png|center|border | Select PPS support]]
  
iv. Exit PPS Support and select USB support and ensure that EHCI HCD (USB2.0) support is enabled. Please match other options too from the figure illustrated below :
+
:* In PPS support, select PPS client using GPIO as built-in driver. It should look like as illustrated in figure below :
 +
[[File:Third Image for makemenuconfig.png|center|border | Select PPS client using GPIO]]
  
#at the end of compilation , copy and paste the line with kernel_version, which is as follows
+
:* Exit PPS Support and select USB support  and ensure that EHCI HCD (USB2.0) support is enabled. Please match other options too from the figure illustrated below :
export kernel_version=3.X.Y-Z          ( in our case 3.8.13-bone36)
+
[[File:Fourth Image for makemenuconfig.png|center|border|900px | USB Support]]
  
#Root file system (~/)
+
 
#Download and extract the minimal root file system for debian wheezy :
+
At the end of compilation , copy and paste the line with kernel_version, which is as follows
 +
<pre>
 +
export kernel_version=3.X.Y-Z          ( in our case 3.8.13-bone32)
 +
</pre>
 +
 
 +
== Root file system (~/)==
 +
Download and extract the minimal root file system for debian wheezy :
 +
<pre>
 
wget -c https://rcn-ee.net//deb/minfs/wheezy/debian-7.3-minimal-armhf-2013-12-18.tar.xz
 
wget -c https://rcn-ee.net//deb/minfs/wheezy/debian-7.3-minimal-armhf-2013-12-18.tar.xz
 
md5sum debian-7.3-minimal-armhf-2013-12-18.tar.xz
 
md5sum debian-7.3-minimal-armhf-2013-12-18.tar.xz
 
tar xf debian-7.3-minimal-armhf-2013-12-18.tar.xz
 
tar xf debian-7.3-minimal-armhf-2013-12-18.tar.xz
 +
</pre>
  
#Setup MicroSD card (as root)
+
== Setup MicroSD card (as root)==
#Attach a microSD card of size atleast 2GB to the desktop with the help of a card reader
+
=== Format and prepare a microSD card ===
#use lsblk to determine device id of sd card , it is either /dev/mmcblkx or /dev/sdx , so supposedly :
+
Attach a microSD card of size atleast 2GB to the desktop with the help of a card reader.
 +
 
 +
Use lsblk to determine device id of sd card , it is either /dev/mmcblkx or /dev/sdx , so supposedly :
 +
<pre>
 
export DISK=/dev/mmcblk0
 
export DISK=/dev/mmcblk0
 
dd if=/dev/zero of=${DISK} bs=1M
 
dd if=/dev/zero of=${DISK} bs=1M
Line 132: Line 170:
 
__EOF__
 
__EOF__
 
dd if=/dev/zero of=${DISK} bs=512 count=1
 
dd if=/dev/zero of=${DISK} bs=512 count=1
#format partitions, for DISK=/dev/mmcblk0
+
</pre>
 +
 
 +
Format partitions, for DISK=/dev/mmcblk0
 +
<pre>
 
mkfs.vfat -F 16 ${DISK}p1 -n boot
 
mkfs.vfat -F 16 ${DISK}p1 -n boot
 
mkfs.ext4 ${DISK}p2 -L rootfs
 
mkfs.ext4 ${DISK}p2 -L rootfs
#or for DISK=/dev/sdX
+
</pre>
 +
Or for DISK=/dev/sdX
 +
<pre>
 
mkfs.vfat -F 16 ${DISK}1 -n boot
 
mkfs.vfat -F 16 ${DISK}1 -n boot
 
mkfs.ext4 ${DISK}2 -L rootfs
 
mkfs.ext4 ${DISK}2 -L rootfs
#mount paths may vary, sometimes they are auto mounted, otherwise do following
+
</pre>
 +
 
 +
After formatting, mount the partitions. Mount paths may vary, sometimes they are auto mounted, otherwise do following
 +
<pre>
 
mkdir -p /media/boot/
 
mkdir -p /media/boot/
 
mkdir -p /media/rootfs/
 
mkdir -p /media/rootfs/
 
mount ${DISK}p1 /media/boot/        or mount ${DISK}1 /media/boot/
 
mount ${DISK}p1 /media/boot/        or mount ${DISK}1 /media/boot/
 
mount ${DISK}p2 /media/rootfs/      or mount ${DISK}2 /media/rootfs/
 
mount ${DISK}p2 /media/rootfs/      or mount ${DISK}2 /media/rootfs/
#install bootloader (~/)
+
</pre>
 +
 
 +
=== Install Bootloader ===
 +
 
 +
Now, Install bootloader by executing following commands (~/) :
 +
<pre>
 
cp -v ./u-boot/MLO  /media/boo t/
 
cp -v ./u-boot/MLO  /media/boo t/
 
cp -v ./u-boot/u-boot.img  /media/boot/
 
cp -v ./u-boot/u-boot.img  /media/boot/
 +
</pre>
  
#Create “uEnv.txt” boot script  and copy following in it: (nano uEnv.txt)
+
Then, create “uEnv.txt” boot script  and copy following in it: (nano uEnv.txt)
 +
<pre>
 
#u-boot eMMC specific overrides; Angstrom Distribution (BeagleBone Black) 2013-06-20
 
#u-boot eMMC specific overrides; Angstrom Distribution (BeagleBone Black) 2013-06-20
 
kernel_file=zImage
 
kernel_file=zImage
Line 175: Line 228:
 
#boot_fdt=run loadzimage; run loadinitrd; run loadfdt
 
#boot_fdt=run loadzimage; run loadinitrd; run loadfdt
 
#uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} 0x81000000:${initrd_size} ${fdtaddr}
 
#uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} 0x81000000:${initrd_size} ${fdtaddr}
+
</pre>
 +
 
 +
<pre>
 
cp -v ./uEnv.txt  /media/boot/
 
cp -v ./uEnv.txt  /media/boot/
 +
</pre>
  
#Install Kernel and root file system
+
=== Install Kernel and Root file system ===
#copy root file system (~/)
+
 
 +
 
 +
Now, we have to Install Kernel and root file system
 +
 
 +
'''Copy root file system (~/)'''
 +
<pre>
 
tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/
 
tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/
#copy kernel files
+
</pre>
 +
 
 +
'''Copy kernel files'''
 +
<pre>
 
cp -v ./linux-dev/deploy/${kernel_version}.zImage /media/boot/zImage
 
cp -v ./linux-dev/deploy/${kernel_version}.zImage /media/boot/zImage
 
mkdir -p /media/boot/dtbs/
 
mkdir -p /media/boot/dtbs/
Line 187: Line 251:
 
tar xfv ./linux-dev/deploy/${kernel_version}-firmware.tar.gz -C /media/rootfs/lib/firmware
 
tar xfv ./linux-dev/deploy/${kernel_version}-firmware.tar.gz -C /media/rootfs/lib/firmware
 
tar xfv ./linux-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/
 
tar xfv ./linux-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/
#file systems table, edit /etc/fstab
+
</pre>
 +
 
 +
'''Make a File systems table'''
 +
 
 +
edit /etc/fstab:
 +
<pre>
 
nano /media/rootfs/etc/fstab
 
nano /media/rootfs/etc/fstab
#and copy following
+
</pre>
 +
and copy following
 +
<pre>
 
/dev/mmcblk0p2 / auto errors=remount-ro 0 1
 
/dev/mmcblk0p2 / auto errors=remount-ro 0 1
 
/dev/mmcblk0p1 /boot/uboot auto defaults 0 2
 
/dev/mmcblk0p1 /boot/uboot auto defaults 0 2
#networking , edit /etc/network/interfaces
+
</pre>
 +
 
 +
'''Networking'''
 +
 
 +
edit /etc/network/interfaces
 +
<pre>
 
nano /media/rootfs/etc/network/interfaces
 
nano /media/rootfs/etc/network/interfaces
#and copy following
+
</pre>
 +
 
 +
and copy following (fixed ip)
 +
<pre>
 
auto lo
 
auto lo
 
iface lo inet loopback
 
iface lo inet loopback
Line 204: Line 283:
 
     network 192.168.1.0
 
     network 192.168.1.0
 
     gateway 192.168.1.1
 
     gateway 192.168.1.1
#networking: using a shared sd card with multiple beaglebone
+
</pre>
 +
 
 +
'''Networking: using a shared sd card with multiple beaglebone'''
 +
<pre>
 
nano /media/rootfs/etc/udev/rules.d/70-persistent-net.rules
 
nano /media/rootfs/etc/udev/rules.d/70-persistent-net.rules
#and copy following
+
</pre>
 +
 
 +
and copy following
 +
<pre>
 
# BeagleBone: net device ()
 
# BeagleBone: net device ()
 
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
 
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
#for enabling serial login to system
+
</pre>
 +
 
 +
'''Enable serial login to system'''
 +
<pre>
 
nano /media/rootfs/etc/inittab
 
nano /media/rootfs/etc/inittab
#and copy following at the end of inittab
+
</pre>
 +
 
 +
and copy following at the end of inittab
 +
<pre>
 
T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102
 
T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102
#Remove microsd card
+
</pre>
 +
 
 +
'''Remove microsd card'''
 +
<pre>
 
sync
 
sync
 
umount /media/boot/
 
umount /media/boot/
 
umount /media/rootfs/
 
umount /media/rootfs/
 +
</pre>
  
#Extras
+
==Extras==
#usb gadget (http access to beaglebone black over usb)
+
 
#run beaglebone black with the created sd card and then do the following in it over eth0 ssh
+
=== USB Gadget (http access to beaglebone black over usb)===
apt-get install udhcpd
+
'''Run beaglebone black with the created sd card and then do the following in it over eth0 ssh'''
# and edit the file at /etc/default/udhcpd for enabling udhcpd
+
<pre>
#and edit /etc/network/interfaces to add following at the end
+
apt-get install udhcpd
# Ethernet/RNDIS gadget (g_ether)
+
</pre>
# ... or on host side, usbnet and random hwaddr
+
 
 +
Edit the file at /etc/default/udhcpd for enabling udhcpd
 +
 
 +
'''Edit /etc/network/interfaces to add following at the end'''
 +
<pre>
 +
Ethernet/RNDIS gadget (g_ether)
 +
... or on host side, usbnet and random hwaddr
 
iface usb0 inet static
 
iface usb0 inet static
 
     address 192.168.7.2
 
     address 192.168.7.2
Line 231: Line 332:
 
     network 192.168.7.0
 
     network 192.168.7.0
 
     gateway 192.168.7.1
 
     gateway 192.168.7.1
#and use the following temp script
+
</pre>
wget -c https://raw.github.com/RobertCNelson/tools/master/scripts/beaglebone-black-g-ether-load.sh
+
chmod +x beaglebone-black-g-ether-load.sh
+
sudo ./beaglebone-black-g-ether-load.sh
+
  
#to enable/disable HDMI or eMMC or LCD
 
#edit the uEnv.txt and comment/uncomment the line corresponding to this appropriately
 
  
#to boot from eMMC
+
'''Other scripts are also there, they can be found here : '''
# we have to boot with an init filesystem so edit the uEnv.txt and comment out zImage commands and uncomment zImage+uInitrd boot commands.
+
#then use scripts to copy microSD to eMMC
+
wget -c https://raw.github.com/RobetCNelson/tools/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh
+
chmod +x beaglebone-black-copy-microSD-to-eMMC.sh
+
sudo ./beaglebone-black-copy-microSD-to-eMMC.sh
+
  
#script to just update the boot partition of the eMMC
 
wget -c https://raw.github.com/RobertCNelson/tools/master/scripts/beaglebone-black-just-copy-boot-to-eMMC.sh
 
chmod +x beaglebone-black-just-copy-boot-to-eMMC.sh
 
sudo ./beaglebone-black-just-copy-boot-to-eMMC.sh
 
 
#other scripts are also there, they can be found here :
 
 
https://raw.github.com/RobertCNelson/tools/master/scripts/
 
https://raw.github.com/RobertCNelson/tools/master/scripts/
#Note : These steps are publicly available here : http://eewiki.net/display/linuxonarm/BeagleBone+Black
+
 
 +
Note : These steps are publicly available here : http://eewiki.net/display/linuxonarm/BeagleBone+Black
 +
 
 
Please check the above link for any updates.
 
Please check the above link for any updates.

Latest revision as of 04:28, 24 June 2015

Note : All steps are executed on the Ubuntu 12.04 LTS and as a root user. Most of the steps are similar Robert C Nelson BBB Wiki.

Basic Requirements

ARM cross compiler linaro gcc (~/)

Download and extract the ARM Cross compiler linaro gcc . Supposedly we mark that directory as root (~/)

wget -c https://launchpad.net/linaro-toolchain-binaries/trunk/2013.10/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
tar xJf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
export CC='pwd'/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-

Test the version of the gcc path set above to verify it will work

${CC}gcc –version
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 4.8.2 20131014 (prerelease)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

if the above test fails, verify that you have 32bit libraries installed on your development system , and execute following :

 apt-get install lbs
 apt-get install ia32-libs

Bootloader U-boot (~/)

Bootloader used is Das U-Boot, and its works like charm. Das U-Boot -- the Universal Boot Loader http://www.denx.de/wiki/U-Boot

Download:

~/
git clone git://git.denx.de/u-boot.git
cd u-boot/
git checkout v2013.10 -b tmp

Patches: After cloning git takes you to the u-boot directory of the working directory, else go to the u-boot directory

~/u-boot
wget https://raw.github.com/eewiki/u-boot-patches/master/v2013.10/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch

Configure and Build:

~/u-boot
make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config
make ARCH=arm CROSS_COMPILE=${CC}

Upgrade distro "device-tree-compiler" package

 (~/) {In the working directory}
wget -c https://raw.github.com/RobertCNelson/tools/master/pkgs/dtc.sh
chmod +x dtc.sh
./dtc.sh

Linux kernel (~/)

We follow RobertCNelson branch of the kernel. For more details, please go to BBB-RobertCNelson-Main Wiki

Git setup and Kernel Compile

git clone git://github.com/RobertCNelson/linux-dev.git
cd linux-dev/

checkout v3.8.xbranch (full cape support) There are other versions,check here BBB-RobertCNelson-Main Wiki

git checkout origin/am335x-v3.8 -b eewiki

Now setup the git and compile the kernel

apt-get update
apt-get install device-tree-compiler lzma lzop u-boot-tools libncurses5-dev
git config --global user.name "username"
git config --global user.email "useremailid"
./build_kernel.sh

Add USB and PPS driver

While compiling for first time, LINUX_GIT is set by default(check its path in build_kernel.sh and /tools/rebuild.sh). Set it to 'pwd'/linux-dev/ignore/linux-src/ in build_kernel.sh and /tools/rebuild.sh, so use following for later use:

export LINUX_GIT='pwd'/linux-dev/ignore/linux-src/

Please download our USB drivers patch which is required to use the WCDMA modem on Cape.

wget wcdma_patch_vayu_usb_drivers.patch
patch -p1 < wcdma_patch_vayu_usb_drivers.patch

Alternate to this, if patch is not applied clean, do following

Locate the file option.c under: /linux/drivers/usb/serial/option.c Edit the file to add following

  • Define on top following
 /*  Yantrr Strongrising products */
#define YANTRR_VENDOR_ID                         0x21f5
#define YANTRR_PRODUCT_VAYU3G                   0x2012
  • Add following structure inside static struct usb_device_id option_ids[], you would find lot of modem defined here
 /*  Yantrr Strongrising products */
 { USB_DEVICE(YANTRR_VENDOR_ID, YANTRR_PRODUCT_VAYU3G) },
  • You may create your local patch based on kernel for next time patch
  • This option adding would help udev to detect the device

Rebuild kernel

Now rebuild the kernel while enabling the pps drivers in makemenuconfig and after USB drivers patch applied.

./tools/rebuild.sh
  • Following figures illustrate how to enable the PPS drivers and also some settings in USB drivers section
  • First image shows the first screen of makemenuconfig while recompiling the kernel. Select Device drivers .
Select device drivers
  • In the device drivers window, scroll down to select PPS support.
Select PPS support
  • In PPS support, select PPS client using GPIO as built-in driver. It should look like as illustrated in figure below :
Select PPS client using GPIO
  • Exit PPS Support and select USB support and ensure that EHCI HCD (USB2.0) support is enabled. Please match other options too from the figure illustrated below :
USB Support


At the end of compilation , copy and paste the line with kernel_version, which is as follows

export kernel_version=3.X.Y-Z          ( in our case 3.8.13-bone32)

Root file system (~/)

Download and extract the minimal root file system for debian wheezy :

wget -c https://rcn-ee.net//deb/minfs/wheezy/debian-7.3-minimal-armhf-2013-12-18.tar.xz
md5sum debian-7.3-minimal-armhf-2013-12-18.tar.xz
tar xf debian-7.3-minimal-armhf-2013-12-18.tar.xz

Setup MicroSD card (as root)

Format and prepare a microSD card

Attach a microSD card of size atleast 2GB to the desktop with the help of a card reader.

Use lsblk to determine device id of sd card , it is either /dev/mmcblkx or /dev/sdx , so supposedly :

export DISK=/dev/mmcblk0
dd if=/dev/zero of=${DISK} bs=1M
sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__
1,48,0xE,*
,,,-
__EOF__
dd if=/dev/zero of=${DISK} bs=512 count=1

Format partitions, for DISK=/dev/mmcblk0

mkfs.vfat -F 16 ${DISK}p1 -n boot
mkfs.ext4 ${DISK}p2 -L rootfs

Or for DISK=/dev/sdX

mkfs.vfat -F 16 ${DISK}1 -n boot
mkfs.ext4 ${DISK}2 -L rootfs

After formatting, mount the partitions. Mount paths may vary, sometimes they are auto mounted, otherwise do following

mkdir -p /media/boot/
mkdir -p /media/rootfs/
mount ${DISK}p1 /media/boot/        or mount ${DISK}1 /media/boot/
mount ${DISK}p2 /media/rootfs/      or mount ${DISK}2 /media/rootfs/

Install Bootloader

Now, Install bootloader by executing following commands (~/) :

cp -v ./u-boot/MLO  /media/boo	t/
cp -v ./u-boot/u-boot.img  /media/boot/

Then, create “uEnv.txt” boot script and copy following in it: (nano uEnv.txt)

#u-boot eMMC specific overrides; Angstrom Distribution (BeagleBone Black) 2013-06-20
kernel_file=zImage
initrd_file=uInitrd

loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file}
loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x81000000 ${initrd_file}; setenv initrd_size ${filesize}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /dtbs/${fdtfile}
#

console=ttyO0,115200n8
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext4 rootwait fixrtc

##To disable HDMI/eMMC...
#optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G

##3.1MP Camera Cape
#optargs=capemgr.disable_partno=BB-BONE-EMMC-2G

mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}

#zImage:
uenvcmd=run loadzimage; run loadfdt; run mmcargs; bootz ${loadaddr} - ${fdtaddr}

#zImage + uInitrd: where uInitrd has to be generated on the running system.
#boot_fdt=run loadzimage; run loadinitrd; run loadfdt
#uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} 0x81000000:${initrd_size} ${fdtaddr}
 
cp -v ./uEnv.txt  /media/boot/

Install Kernel and Root file system

Now, we have to Install Kernel and root file system

Copy root file system (~/)

tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/

Copy kernel files

cp -v ./linux-dev/deploy/${kernel_version}.zImage /media/boot/zImage
mkdir -p /media/boot/dtbs/
tar xfov ./linux-dev/deploy/${kernel_version}-dtbs.tar.gz -C /media/boot/dtbs/
tar xfv ./linux-dev/deploy/${kernel_version}-firmware.tar.gz -C /media/rootfs/lib/firmware
tar xfv ./linux-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/

Make a File systems table

edit /etc/fstab:

nano /media/rootfs/etc/fstab

and copy following

/dev/mmcblk0p2	/		auto	errors=remount-ro	0	1
/dev/mmcblk0p1	/boot/uboot	auto	defaults		0	2

Networking

edit /etc/network/interfaces

nano /media/rootfs/etc/network/interfaces

and copy following (fixed ip)

auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
    address 192.168.1.150
    netmask 255.255.255.0
    network 192.168.1.0
    gateway 192.168.1.1

Networking: using a shared sd card with multiple beaglebone

nano /media/rootfs/etc/udev/rules.d/70-persistent-net.rules

and copy following

# BeagleBone: net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Enable serial login to system

nano /media/rootfs/etc/inittab

and copy following at the end of inittab

T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102

Remove microsd card

sync
umount /media/boot/
umount /media/rootfs/

Extras

USB Gadget (http access to beaglebone black over usb)

Run beaglebone black with the created sd card and then do the following in it over eth0 ssh

 apt-get install udhcpd

Edit the file at /etc/default/udhcpd for enabling udhcpd

Edit /etc/network/interfaces to add following at the end

 
Ethernet/RNDIS gadget (g_ether)
... or on host side, usbnet and random hwaddr
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1


Other scripts are also there, they can be found here :

https://raw.github.com/RobertCNelson/tools/master/scripts/

Note : These steps are publicly available here : http://eewiki.net/display/linuxonarm/BeagleBone+Black

Please check the above link for any updates.