--20171228
1、实验环境
、鼠标×2、键盘×1、USB分线器×1、ZedBoard开发板套件×1、AD-FMCOMMS2-EBZ×1、网线×1、SD卡×1。
2、软件安装
2.1、安装VMware Workstation Pro12
软件来源:http://bbs.feng.com/read-htm-tid-9815751.html
安装教程:VMware Workstation 12 Pro 虚拟机安装步骤详解_百度经验
。
2.2、安装虚拟系统ubuntu-14.04.5-desktop-amd64
软件来源:https://www.ubuntu.com/download/desktop
安装教程:VMware12安装虚拟机教程、Ubuntu16.04安装教程_百度经验
http://www.jb51.net/article/97295.htm
2.3、交叉编译环境的搭建
gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/
2.3.2下载gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
⑴ 在/usr/local/文件夹下建立名为ARM-toolchain的文件夹
$ sudo/usr/local/ARM-toolchain
gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
$ cd/usr/local/ARM-toolchain
$sudo wget https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
然后在文件的末尾空白处加入一下代码:
⑸ 使新的环境变量生效(不用重启电脑)
执行上面的命令,显示arm-linux-gnueabi-gcc -v信息和版本:
zhangjun@zhangjun-virtual-machine:~/eclipse_workspace/hello/Debug$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/local/ARM-toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/7.2.1/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/snapshots/gcc.git~linaro-7.2-2017.11/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/_build/sysroots/arm-linux-gnueabihf --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)
2.4、安装Eclipse IDE for C/C++
在Ubuntu下,可用apt-get命令先安装eclipse-platform,再安装CDT插件eclipse-cdt,可以获得Eclipse C/C++开发环境。命令如下:
$sudo apt-get install eclipse-cdt
安装完成,直接输入eclipse命令即可启动Eclipse环境。
3、Zynq硬件平台搭建
3.1 下载Linux 镜像
Download Linux Image地址:
http://swdownloads.analog.com/cse/2016_R2-2017_06_29.img.xz
https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz
ͼ3.1
4、NFS服务器
https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/linux/zynq_2015r2
_defconfig,先要删除掉# CONFIG_NETWORK_FILESYSTEMS is not set这一行,并在该位置加上如下配置内容:
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_SWAP is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set