Flashing Buildroot Image from Ubuntu

From www.chip-community.org
Jump to: navigation, search

This has been tested on Ubuntu 14.04 64bit using the C.H.I.P pro board as of 24 February 2017. In my experience flashing the buildroot image does not work in a virtual machine. Ubuntu needs to be run not in a virtual machine for this guide to work.

Install packages:

sudo apt-get update
sudo apt-get install git unzip bc libncurses5-dev mercurial lib32stdc++6 libc6-i386 lib32z1 u-boot-tools android-tools-fastboot build-essential libusb-1.0-0-dev curl android-tools-fsutils pkg-config libacl1-dev zlib1g-dev liblzo2-dev uuid-dev

Clone git repositories:

cd ~

git clone https://github.com/NextThingCo/CHIP-buildroot.git
git clone https://github.com/NextThingCo/CHIP-tools
git clone https://github.com/linux-sunxi/sunxi-tools
cd ~/sunxi-tools
git clone https://github.com/NextThingCo/chip-mtd-utils

These are the most recent commits as of 2017-02-24.
CHIP-buildroot b52c25c
CHIP-tools 6c16df5
sunxi-tools 7128c73
chip-mtd-utils f6a16e5

cd ~/CHIP-buildroot && git checkout b52c25c
cd ~/CHIP-tools && git checkout 6c16df5
cd ~/sunxi-tools && git checkout 7128c73
cd ~/sunxi-tools/chip-mtd-utils && checkout f6a16e5

Build sunxi tools:

cd ~/sunxi-tools
make misc
cd chip-mtd-utils
sudo make install

Create symbolic links for these sunxi-tool executibles in /usr/local/bin:

cd ~/sunxi-tools
sudo ln -s $PWD/sunxi-bootinfo /usr/local/bin/sunxi-bootinfo
sudo ln -s $PWD/sunxi-fel /usr/local/bin/sunxi-fel
sudo ln -s $PWD/sunxi-fexc /usr/local/bin/sunxi-fexc
sudo ln -s $PWD/sunxi-nand-image-builder /usr/local/bin/sunxi-nand-image-builder
sudo ln -s $PWD/sunxi-nand-part /usr/local/bin/sunxi-nand-part
sudo ln -s $PWD/sunxi-pio /usr/local/bin/sunxi-pio

Setup Udev to allow programming the CHIPpro over serial:

sudo usermod -a -G dialout ${USER}
sudo usermod -a -G plugdev ${USER}

sudo gedit /etc/udev/rules.d/99-allwinner.rules

Add the following lines:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a",ATTRS{idProduct}=="efe8", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip"

SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot"

SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot"

SUBSYSTEM=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GROUP="plugdev", MODE="0660" SYMLINK+="usb-serial-adapter"

Log out and then in again after making the udev rule.
Now build the image:

cd ~/CHIP-buildroot
make chippro_defconfig

The build image is under:

Load it onto CHIPpro by these commands:

cd ~/CHIP-tools

sudo ./chip-create-nand-images.sh ../CHIP-
buildroot/output/build/uboot-nextthing_2016.01_next ../CHIP-
buildroot/output/images/rootfs.tar new-image

sudo chown -R username:username new-image

(your username is used in place of 'username')

sudo ./chip-flash-nand-images.sh new-image

When flashing use a USB2, not a USB3 port. Hold down the FEL button on the CHIPpro, plug in USB, and then run the chip-flash-nand-images.sh command. Keep the FEL button held down. This can take a few minutes.

If you have trouble with this guide make a post here and let us know your problem:

If you find a solutions that is not written in this guide please edit the wiki to leave a note about what worked for you.