User Tools

Site Tools


usomiq-ubuntu

uSomIQ Ubuntu and Debian

This page describes to how deploy the Ubuntu OS and Debian on a uSomIQ COM.

These instructions were adapted from the ones provided by Robert Nelson available here:
http://www.eewiki.net/display/linuxonarm/BeagleBone

Basic Requirements

GCC Toolchain

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

Bootloader

Das U-Boot – the Universal Boot Loader [http://www.denx.de/wiki/U-Boot]

U-Boot Download

Download U-Boot via git:

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

U-Boot Patches

wget http://www.mentorel.com/downloads/usomiq/patches/u-boot-2013.07-usomiq.patch
patch -p1 < u-boot-2013.07-usomiq.patch

U-Boot Configure and Build

make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config
make ARCH=arm CROSS_COMPILE=${CC}

Linux Kernel

git clone git://github.com/RobertCNelson/linux-dev.git
cd linux-dev/
git checkout origin/am33x-v3.2 -b tmp

Download a patch to enable uSomIQ support in kernel

wget http://www.mentorel.com/downloads/usomiq/patches/add-usomiq-rcn-v3.2.patch
patch -p1 < add-usomiq-rcn-v3.2.patch

Run Build Script:

./build_kernel.sh

The kernel zImage and modules will be under the deploy directory.

Prebuilt binaries

Root File System

Debian 7.0.0 (Wheezy) Root File System

This file system is very small and can be installed to the NAND flash on uSomIQ. It is not that small like Angstrom minimal distribution (~20M), but will require around 75M on the flash. However it is a real Debian system with apt-get utility installed.

Default User: debian
Password: temppwd

Root User: root
Root Password: root

wget -c https://rcn-ee.net/deb/minfs/wheezy/debian-7.5-minimal-armhf-2014-07-07.tar.xz

verify the image with:

md5sum debian-7.5-minimal-armhf-2014-07-07.tar.xz
cae9e0cfac14fd6aa19d4c17357aecc8 debian-7.5-minimal-armhf-2014-07-07.tar.xz

Extract Image:

tar xf debian-7.5-minimal-armhf-2014-07-07.tar.xz

Now you have a directory with the archived (tar) file system itself and a file with user names/passwords.

Ubuntu 13.04 (Raring) Root File System

Default User: ubuntu
Password: temppwd

wget -c https://rcn-ee.net/deb/minfs/trusty/ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz

verify the image with:

md5sum ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz
c30fb91012701cdbfa00bb6c86868d0a ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz

Extract Image:

tar xJf ubuntu-14.04-minimal-armhf-2014-07-07.tar.xz

Now you have a directory with the archived (tar) file system itself and a file with user names/passwords.

Root File System for NAND

A Root File System around 64Mb in size, for flash applications.

Debian 7 (small flash)

User Password
debian temppwd
root root

Download:

wget -c https://rcn-ee.net/deb/barefs/wheezy/debian-7.5-bare-armhf-2014-07-07.tar.xz

Verify:

md5sum debian-7.5-bare-armhf-2014-07-07.tar.xz
a5f0e75e5ad16bb110d4291f54ed6cb9  debian-7.5-bare-armhf-2014-07-07.tar.xz

Extract:

tar xJf debian-7.5-bare-armhf-2014-07-07.tar.xz

Install Ubuntu/Debian

SD card

Setup microSD card

For these instruction, we are assuming: DISK=/dev/mmcblk0, “sudo fdisk \-l” is useful for determining the device id..

export DISK=/dev/mmcblk0

Erase microSD card:

sudo dd if=/dev/zero of=${DISK} bs=1024 count=1024
sudo parted --script ${DISK} mklabel msdos

Setup Boot Partition:

sudo fdisk ${DISK} << __EOF__
n
p
1

+64M
t
e
p
w
__EOF__

Set Boot Flag

sudo parted --script ${DISK} set 1 boot on

Format Boot Partition as vfat:

DISK=/dev/mmcblk0
sudo mkfs.vfat -F 16 ${DISK}p1 -n boot
(or)
DISK=/dev/sdX
sudo mkfs.vfat -F 16 ${DISK}1 -n boot

Setup Root File System Partition:

sudo fdisk ${DISK} << __EOF__
n
p
2


w
__EOF__

Format rootfs as ext4:

DISK=/dev/mmcblk0
sudo mkfs.ext4 ${DISK}p2 -L rootfs
(or)
DISK=/dev/sdX
sudo mkfs.ext4 ${DISK}2 -L rootfs

Mount Partitions

*Note: On most systems these partitions will be auto-mounted…*

sudo mkdir -p /media/boot/
sudo mkdir -p /media/rootfs/

DISK=/dev/mmcblk0
sudo mount ${DISK}p1 /media/boot/
sudo mount ${DISK}p2 /media/rootfs/

(or)

DISK=/dev/sdX
sudo mount ${DISK}1 /media/boot/
sudo mount ${DISK}2 /media/rootfs/

Install Bootloaders

Copy MLO/u-boot.img to the boot partition

sudo cp -v ./u-boot/MLO /media/boot/
sudo cp -v ./u-boot/u-boot.img /media/boot/

uEnv.txt based bootscript

Requires: u-boot v2013.04

Create “uEnv.txt” boot script: (nano uEnv.txt)

#optargs=
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
 
#To boot old v3.2.x based kernel enable: (BeagleBone/uSomIQ only)
uenvcmd=run loaduimage; run mmc_classic_boot
   
#To boot new v3.8.x based device tree:
#uenvcmd=run loaduimage; run loadfdt; run mmcargs; bootz ${loadaddr} - ${fdtaddr}

Copy uEnv.txt to the boot partition:

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

Install Kernel and Root File System

To help new users, since the kernel version can change on a daily basis. The kernel building scripts in this git repo will now give you a hint of what kernel version was built.

-----------------------------
Script Complete
eewiki.net: [user@localhost:~$ export kernel_version=3.X.Y-Z]
-----------------------------

Copy and Paste that “export kernel_version=3.X.Y-Z” exactly as shown in your own build/desktop environment:

export kernel_version=3.X.Y-Z

Copy Kernel zImage:

sudo cp -v ./linux-dev/deploy/${kernel_version}.zImage /media/boot/zImage

Copy Root File System:

sudo tar xfvp ./*-*-minimal-arm*-*/arm*-rootfs-*.tar -C /media/rootfs/

Copy Kernel modules:

sudo tar xfv ./linux-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/

Setup /etc/fstab:

sudo nano /media/rootfs/etc/fstab

Add:

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

Enable Networking

sudo nano /media/rootfs/etc/network/interfaces

Add:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Enable Serial Login

Debian:

sudo nano /media/rootfs/etc/inittab

Add at end of file:

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

Ubuntu:

sudo nano /media/rootfs/etc/init/serial.conf

Add:

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty 115200 ttyO0

Remove microSD card:

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

Install Debian to NAND

Here you will learn how install Debian to a UBIFS partition on a uSomIQ system on module.

1) Install Ubuntu or Debian to a SD card as described in the previous step

2) Download and extract a small Debian file system as described root_file_system_for_nand

You will have an archive debian-7.1-bare-armhf-2013-08-25.tar after extracting. Place this archive to the SD card with OS installed in the previous step.

3) Boot the board with the SD card to u-boot and issue the following commands:

nand erase.chip
mmc rescan
fatload mmc 0 0x81600000 MLO
nand write 0x81600000 0 20000
nand write 0x81600000 20000 20000
nand write 0x81600000 40000 20000

Load the u-boot image u-boot.img to NAND. Note that we use the actual size of the u-boot.img file in Hex. If your file has a different size then update this number

fatload mmc 0 0x81600000 u-boot.img
nand write 0x81600000 80000 57d74 # <- this is the actual size of the u-boot.img file in Hex

Load the kernel image zImage to NAND. Note that we use the actual size of the zImage file in Hex. If your file has a different size then update this number

run loaduimage
nand write ${loadaddr} 280000 2B08f8 # <- this is the actual size of the zImage file in Hex

4) Boot farther to OS

5) Prepare a UBIFS partition

For more information visit: http://processors.wiki.ti.com/index.php/UBIFS_Support

Preparing NAND partition for modules with 256MB

ubiformat /dev/mtd7 -s 2048 -O 2048
ubiattach /dev/ubi_ctrl -m 7 -O 2048
ubimkvol /dev/ubi0 -s 235MiB -N rootfs
mount -t ubifs ubi0:rootfs /mnt

Preparing NAND partition for modules with 512MB

ubiformat /dev/mtd7 -s 2048 -O 2048
ubiattach /dev/ubi_ctrl -m 7 -O 2048
ubimkvol /dev/ubi0 -s 450MiB -N rootfs
mount -t ubifs ubi0:rootfs /mnt

6) Install the file system to the UBIFS-partiotion

cd /mnt
tar xf <path to image>/debian-7.1-bare-armhf-2013-08-25.tar
sync

7) Enable the Serial login

Edit the file /mnt/etc/inittab as described for the SD card installation.

8) Enable Network

Edit the file /mnt/etc/network/interfaces as described for the SD card installation.

9) Remove the SD card and reboot the board

FAQ

CircuitCo LCD3 Backlight

Turn on Backlight:

i2cset -f -y 1 0x24 0x07 0x09
i2cset -f -y 1 0x24 0x08 0x60

CircuitCo LCD3/LCD7 TouchScreen

Add to /etc/modules:

fbcon
ti_tscadc
usomiq-ubuntu.txt · Last modified: 2015/03/05 02:09 by maxx