2.1下载BSP
下载地址是:http://www.nuvoton.com.cn/products/iot-solution/application/gateway/numaker-nuc980-iiot/?tab=2&group=Software&rt=Board%20Support%20Package%20(BSP)NuMaker-IIoT-NUC980 - Nuvotonhttp://www.nuvoton.com.cn/products/iot-solution/application/gateway/numaker-nuc980-iiot/?tab=2&group=Software&rt=Board%20Support%20Package%20(BSP)
文件解压之后
这个文件在git资源中有提供。
将BSP目录下的压缩包复制到ubuntu
解压文件:tar zxvf nuc980bsp.tar.gz
2.2 通过GIT下载源码
mkdir nuc980
cd nuc980/
export PATH=/home/jun/nuc980/:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > /home/jun/nuc980/repo
chmod a+x repo
git config --global user.name "jun" (填你自己的用户名)
git config --global user.email "2839084093@qq.com" (填你自己的账号)
mkdir linux_bsp
cd linux_bsp
repo init -u git://github.com/OpenNuvoton/manifest.git -b nuc980-2019.09 -m github.xml
//或者
repo init -u https://gitee.com/OpenNuvoton/manifest.git -b nuc980-2019.09 -m gitee.xml
repo sync
Init成功,准备sync
会拉下来五个文件夹
按照官方介绍
applications | 範例程序以及開源軟件, 例如 busybox, wireless tool… |
buildroot | 可用來編譯內核, 交叉編譯工具, 應用程序… 等的集合. |
image/kernel | 使用默認設置預先編譯好的內核 |
image/U-Boot | 使用默認設置預先編譯好的支持 NAND 或 SPI flash 的 U |
linux-4.4.y | 內核源碼 |
rootfs | 根文件系統 |
u-boot-2016.11 | U-Boot V2016.11 源碼 |
nuwriter | Linux 下使用的命令行介面 NuWriter |
2.3单独下载源码
源碼 | 倉庫鏈結 |
Applications | https://github.com/OpenNuvoton/NUC980_Linux_Applications.git |
buildroot | https://github.com/OpenNuvoton/NUC980_Buildroot.git |
linux-4.4.y | https://github.com/OpenNuvoton/NUC980-linux-4.4.y.git |
uboot.v2016.11 | https://github.com/OpenNuvoton/NUC970_U-Boot_v2016.11.git |
NuWriter | https://github.com/OpenNuvoton/NUC980_NuWriter.git |
Linux Command | https://github.com/OpenNuvoton/NUC980_NuWriter_CMD.git |
SD Writer | https://github.com/OpenNuvoton/NUC980_SDWriter.git |
2.4配置交叉编译环境
进入2.1 BSP解压出来的文件目录,下面有个install.sh安装脚本,用途是配置交叉编译工具。
输入命令:sudo ./install.sh
交叉编译工具被安装在usr/local下面。
现在交叉编译工具还没完全装好。
输入命令:vi /etc/bash.bashrc
在文件最后,添加路径:PATH="$PATH:/usr/local/arm_linux_4.8/bin"
保存退出,输入命令:source /etc/bash.bashrc
到终端输入:arm-
然后点击tab键,如果弹出交叉编译工具的命令,则配置完成。
这样就可以准备源码的编译了