LeMaker Guitar:How to use LeMaker Guitar BSP

From BananaPro/Pi
Jump to: navigation, search

Other languages:
English • ‎中文(简体)‎

This document describes the procedures and tips for building the source code of the linux actions bsp based on LeMaker Guitar board.The Source Code for the S500 SOC is based on the Actions SDK. We have re-adjusted the structure of directory, and fix some bugs for the LeMaker Guitar. It includes the "linux kernel (linux-actions)" "u-boot (u-boot-actions)" and "owl-actions" and so on, the "owl-actions" directory that includes some tools, scripts and configuration of the different boards.
Of course, we are not building a whole distribution here, we're only building platform firmware package which include u-boot, the kernel and so on, and then using an existing root file system to get a usable OS.

Prepare the development environment

You have to configure development environment before compiling the source Code, and you need to install cross-compiler toolchain, some compatibility libraries and tools on your machine.
The following steps are for Linux machine, specifically on 64-bit Ubuntu as examples. and you can copy and paste directly the following shell commands:

For Ubuntu12.04 LTS

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential gcc-4.6-arm-linux-gnueabihf-base g++-4.6-arm-linux-gnueabihf 
sudo apt-get install gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf \
git wget kpartx fakeroot libncurses5-dev
sudo apt-get install ia32-libs
 

For Ubuntu14.04 LTS

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential gcc-4.8-arm-linux-gnueabihf-base g++-4.8-arm-linux-gnueabihf
sudo apt-get install gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf \
git wget kpartx fakeroot libncurses5-dev
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6-4.8-dbg
 

For Ubuntu15.04

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential gcc-4.9-arm-linux-gnueabihf-base g++-4.9-arm-linux-gnueabihf 
sudo apt-get install gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf \
git wget kpartx fakeroot libncurses5-dev
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6-4.8-dbg


Linaro Linux host toolchains
You can also use the Linux host toolchains to build up the development environment under other Linux OS.

cd /opt
wget http://releases.linaro.org/15.05/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz
tar -xvf gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz

Note that this Linux host toolchains only support X86_64(64bit).

and then edit /etc/bash.bashrc and add the content as below:

 if [ -d /opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf ]; then
   PATH=/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin:":${PATH}"
 fi

At last, type the command as below to update /etc/bash.bashrc

source /etc/bash.bashrc

Use Linux-actions-bsp

Download Linux-actions-bsp

git clone https://github.com/LeMaker/linux-actions-bsp.git
Cloning into 'linux-actions-bsp'...
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 17 (delta 2), reused 12 (delta 0), pack-reused 0
Unpacking objects: 100% (17/17), done.

Configure board type

cd linux-actions-bsp/
./configure 
Submodule 'linux-actions' (https://github.com/LeMaker/linux-actions.git) registered for path 'linux-actions'
Submodule 'owl-actions' (https://github.com/LeMaker/owl-actions.git) registered for path 'owl-actions'
Submodule 'u-boot-actions' (https://github.com/LeMaker/u-boot-actions.git) registered for path 'u-boot-actions'
Cloning into 'owl-actions'...
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 35 (delta 8), reused 35 (delta 8), pack-reused 0
Unpacking objects: 100% (35/35), done.
Submodule path 'owl-actions': checked out ************************************************
Select board type:
     1. lemaker_guitar_bba
     2. lemaker_guitar_bbb
     3. lemaker_guitar_bbb_plus
     4. lemaker_guitar_bbc
     5. lemaker_guitar_bbd
 
Which would you like? [lemaker_guitar_bba] 2 
s500 lemaker_guitar_bbb configured. Now run `make`
 
NOTE:
<1> You'd better run 'make update' before compilation, this will update all subproject.
<2> If you need to compile another board type, run 'make clean' first, and then use './configure' to choose board type.

lemaker_guitar_bba is a board type for LeMaker Guitar base board Rev.A;
lemaker_guitar_bbb is a board type for LeMaker Guitar base board Rev.B;
lemaker_guitar_bbb_plus is a board type for LeMaker Guitar base board Rev.B Plus;
lemaker_guitar_bbc is a board type for LeMaker Guitar base board Rev.C;
lemaker_guitar_bbd is a board type for LeMaker Guitar base board Rev.D.

Compile Linux kernel and u-boot

make hwpack

You also can execute “make help” to list all compile options.

make help
 
Usage:
Optional targets:
  make hwpack          - Builds platform firmware package
  make linux           - Builds linux kernel
  make linux-clean     - Clean linux kernel
  make linux-config    - Menuconfig
  make uboot           - Builds u-boot
  make uboot-config    - Menuconfig
  make uboot-clean     - Clean uboot
  make linux-mrproper
  make uboot-mrproper
 
  make update          - sync all subproject
  make clean           - Clean all object files

You can use the command "ls" to list all files on the top dirctory:
linux-actions: including linux kernel source code;
u-boot-actions: including uboot source code;
owl-actions: including some tools, scripts and configuration of the different boards;

Get Linux platform firmware package

The source code generate a Linux platform firmware named after "xxx.hwpack.tar.xz", and the package is saved to the directory output.
You can make a system image based on the firmware package. For more information, please visit http://wiki.lemaker.org/LeMaker_Guitar:How_to_make_LeMaker_Guitar_OS_image