Page tree
Skip to end of metadata
Go to start of metadata

配置系统

PanGu开发板的开发环境基于Ubuntu 16.04 64bit操作系统,内存最小4GB,硬盘至少80GB,推荐使用SSD硬盘,以获得更快的编译速度。Ubuntu 16.04系统安装好后,安装以下必要软件包:

sudo apt-get install build-essential git-core libncurses-dev flex bison texinfo zip unzip zlib1g-dev gettext u-boot-tools g++ xz-utils mtd-utils gawk diffstat gcc-multilib python git make gcc g++ diffstat bzip2 gawk chrpath wget cpio texinfo lzop libssl-dev  libncurses5-dev libncursesw5-dev


配置工具链

PanGu开发板提供的编译工具链也是64bit,编译工具链有两个, i2som-image-weston和i2som-image-qt。分别对应两种系统,包含不同的开发库文件。同时,两种除了可以用来编译对应的应用程序,也可以用来编译U-Boot, Linux代码。

文件名工具链分类说明适合用户

i2som-image-weston-openstlinux-weston-pangu-x86_64-toolchain-2.6-snapshot.sh

SDK Toolchaini2som-image-weston系统镜像的应用开发工具链系统和应用开发者

i2som-image-qt-openstlinux-eglfs-pangu-x86_64-toolchain-2.6-snapshot.sh

SDK Toolchaini2som-image-qt系统镜像的应用开发工具链系统和应用开发者


下面以安装i2som-image-qt系统镜像的SDK工具链为例,将工具安装在/opt/st/pangu-i2som-image-qt/2.6-snapshot目录下。

$ chmod a+x i2som-image-qt-openstlinux-eglfs-pangu-x86_64-toolchain-2.6-snapshot.sh
$ ./i2som-image-qt-openstlinux-eglfs-pangu-x86_64-toolchain-2.6-snapshot.sh
ST OpenSTLinux - EGLfs - (A Yocto Project Based Distro) SDK installer version 2.6-snapshot
==========================================================================================
Enter target directory for SDK (default: /opt/st/pangu/2.6-snapshot): /opt/st/pangu-i2som-image-qt/2.6-snapshot
You are about to install the SDK to "/opt/st/pangu-i2som-image-qt/2.6-snapshot". Proceed[Y/n]? y
[sudo] password for build:
Extracting SDK...................................................................................................................................................................................................................................................................................................................................................................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /opt/st/pangu-i2som-image-qt/2.6-snapshot/environment-setup-cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi


SDK包安装成功,后需要先加载SDK的环境变量,执行下面的命令。后面在编译U-Boot, Linux Kernel前都需要先加载环境变量。

$ source /opt/st/pangu-i2som-image-qt/2.6-snapshot/environment-setup-cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi


验证开发工具是否安装正确,显示版本信息就表示工具链安装正确。

$ $CC --version
arm-openstlinux_eglfs-linux-gnueabi-gcc (GCC) 8.2.0
Copyright (C) 2018 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.


按同样的方安可以安装i2som-image-weston系统镜像的SDK工具链。安装时请注意,工具链的路径应该指定不同路径,相同路径会有文件覆盖的情况。例如,/opt/st/pangu-i2som-image-qt/2.6-snapshot 和 /opt/st/pangu-i2som-image-weston/2.6-snapshot。

准备开发目录

在用户的家目录下创建PanGu目录,作为开发的工作目录。

$ mkdir $HOME/PanGu
$ cd $HOME/PanGu

本章节的目录都以$HOME/PanGu为基目录来操作。


  • No labels