两种方式
(1)在Linux下搭建环境开发(ubuntu20.04 64bit)
a、通过repo下载相关源代码及工具文件,参考官方NUC980 Linux 4.4 BSP User Manual CHT.pdf文档(也可以直接一个一个地手动GIT下载),主要下载内容有:
https://gitee.com/OpenNuvoton/NUC970_U-Boot_v2016.11.git
https://gitee.com/OpenNuvoton/NUC980_Linux_Applications.git
https://gitee.com/OpenNuvoton/NUC970_Buildroot.git
https://gitee.com/OpenNuvoton/NUC980_NonOS_BSP.git
https://gitee.com/OpenNuvoton/NUC980-linux-4.4.y.git
https://gitee.com/OpenNuvoton/NUC980_NuWriter_CMD.git
b、安装所需的软件包,如下:
sudo apt install libc6-dev-i386
sudo apt install lib32z1
sudo apt install lib32ncurses6
sudo apt install lib32stdc++6
c、下载工具链 nuc980bsp.tar.gz,解压后进入目录,运行安装即可:
sudo ./install.sh
d、设置环境变量PATH
export ARCH=arm
export CROSS_COMPILE=/usr/local/arm_linux_4.8/bin/arm-nuvoton-linux-uclibceabi-
export PATH=/usr/local/arm_linux_4.8/bin:$PATH
完成后,进入uboot目录测试一下,是否编译通过,如下:
zhy@zhy-TravelMate-P259-G2-MG:~/Desktop/nuc980_env/NUC970_U-Boot_v2016.11$ ls configs/nuc*
configs/nuc970_defconfig configs/nuc980_defconfig
configs/nuc970_eth2uart_defconfig configs/nuc980_eth2uart_defconfig
configs/nuc970_tomato_defconfig configs/nuc980_iot_defconfig
configs/nuc980_chili_defconfig configs/nuc980_lorag_defconfig
zhy@zhy-TravelMate-P259-G2-MG:~/Desktop/nuc980_env/NUC970_U-Boot_v2016.11$ make nuc980_defconfig
#
# configuration written to .config
#
zhy@zhy-TravelMate-P259-G2-MG:~/Desktop/nuc980_env/NUC970_U-Boot_v2016.11$ make
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk
GEN include/autoconf.mk.dep
CFG spl/u-boot.cfg
GEN spl/include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/version_autogenerated.h
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CC lib/asm-offsets.s
CHK include/generated/generic-asm-offsets.h
CC arch/arm/lib/asm-offsets.s
CHK include/generated/asm-offsets.h
HOSTCC tools/envcrc.o
WRAP tools/lib/crc32.c
HOSTCC tools/lib/crc32.o
WRAP tools/common/env_embedded.c
HOSTCC tools/common/env_embedded.o
WRAP tools/lib/sha1.c
HOSTCC tools/lib/sha1.o
HOSTLD tools/envcrc
HOSTCC tools/gen_eth_addr
...
...
...
LD spl/drivers/built-in.o
LD spl/dts/built-in.o
LD spl/fs/built-in.o
LDS spl/u-boot-spl.lds
LD spl/u-boot-spl
OBJCOPY spl/u-boot-spl-nodtb.bin
COPY spl/u-boot-spl.bin
./scripts/check-config.sh u-boot.cfg \
./scripts/config_whitelist.txt . 1>&2
|