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

From Yantrr Wiki
Jump to: navigation, search
(Created page with "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 [http://eewiki.net/displ...")
 
Line 12: Line 12:
 
* ARM based rootfs
 
* ARM based rootfs
 
* Debian Squeeze: http://www.debian.org/
 
* Debian Squeeze: http://www.debian.org/
ARM
 
  
for 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]
 
wget -c https://launchpad.net/linaro-toolchain-binaries/trunk/2013.10/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
 
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
 
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-
 
export CC='pwd'/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-
 +
[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
 
${CC}gcc –version
 
${CC}gcc –version

Revision as of 17:28, 23 February 2014

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 BBB-RobertCNelson-Main Wiki.

Basic Requirements

ARM cross compiler linaro gcc (~/)

Download and extract the ARM Cross compiler linaro gcc . Supposedly we mark that directory as root (~/) [/pre] 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- [pre]

  1. 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.

  1. 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
  1. for bootloader U-boot (~/)
  2. Clone git repository for bootloader U-boot

apt-get install git git clone git://git.denx.de/u-boot.git cd u-boot/ git checkout v2013.10 -b eewiki 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 export ARCH=arm make CROSS_COMPILE=${CC} distclean make CROSS_COMPILE=${CC} am335x_evm_config

  1. am335x_boneblack_config can be used instead, out in the latest git

make CROSS_COMPILE=${CC} cd ..

  1. upgrade distro device tree compiler package (~/)

wget -c https://raw.github.com/RobertCNelson/tools/master/pkgs/dtc.sh chmod +x dtc.sh ./dtc.sh

  1. linux kernel (~/)

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

  1. checkout v3.8.xbranch (full cape support) - It is used currently

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

  1. checkout v3.12.x branch(better usb and ethernet)
  2. git checkout origin/am335x-v3.12. -b tmp

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

  1. 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

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

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

wget wcdma_patch_vayu_usb_drivers.patch command for applying the patch in git ( have to figure it out exactly)

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

./tools/rebuild.sh

  1. 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 .


ii. In the device drivers window, scroll down to select PPS support.


iii. In PPS support, select PPS client using GPIO as built-in driver. It should look like as illustrated in figure below :


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 :

  1. 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-bone36)

  1. Root file system (~/)
  2. 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

  1. Setup MicroSD card (as root)
  2. Attach a microSD card of size atleast 2GB to the desktop with the help of a card reader
  3. 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

  1. format partitions, for DISK=/dev/mmcblk0

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

  1. or for DISK=/dev/sdX

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

  1. 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/

  1. install bootloader (~/)

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

  1. Create “uEnv.txt” boot script and copy following in it: (nano uEnv.txt)
  2. 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

    1. To disable HDMI/eMMC...
  1. optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
    1. 3.1MP Camera Cape
  1. optargs=capemgr.disable_partno=BB-BONE-EMMC-2G

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

  1. zImage:

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

  1. zImage + uInitrd: where uInitrd has to be generated on the running system.
  2. boot_fdt=run loadzimage; run loadinitrd; run loadfdt
  3. uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} 0x81000000:${initrd_size} ${fdtaddr}

cp -v ./uEnv.txt /media/boot/

  1. Install Kernel and root file system
  2. copy root file system (~/)

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

  1. 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/

  1. file systems table, edit /etc/fstab

nano /media/rootfs/etc/fstab

  1. and copy following

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

  1. networking , edit /etc/network/interfaces

nano /media/rootfs/etc/network/interfaces

  1. and copy following

auto lo iface lo inet loopback auto eth0

  1. 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
  1. networking: using a shared sd card with multiple beaglebone

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

  1. and copy following
  2. BeagleBone: net device ()

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

  1. for enabling serial login to system

nano /media/rootfs/etc/inittab

  1. and copy following at the end of inittab

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

  1. Remove microsd card

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

  1. Extras
  2. usb gadget (http access to beaglebone black over usb)
  3. run beaglebone black with the created sd card and then do the following in it over eth0 ssh

apt-get install udhcpd

  1. and edit the file at /etc/default/udhcpd for enabling udhcpd
  2. and edit /etc/network/interfaces to add following at the end
  3. Ethernet/RNDIS gadget (g_ether)
  4. ... 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
  1. and use the following temp script

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

  1. to enable/disable HDMI or eMMC or LCD
  2. edit the uEnv.txt and comment/uncomment the line corresponding to this appropriately
  1. to boot from eMMC
  2. we have to boot with an init filesystem so edit the uEnv.txt and comment out zImage commands and uncomment zImage+uInitrd boot commands.
  3. 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

  1. 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

  1. other scripts are also there, they can be found here :

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

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

Please check the above link for any updates.