一般开发嵌入式linux平台都是使用虚拟机,由于vmware workstation体积巨大,而且不同版本兼容性比较差,所以我选择了使用virtualbox,也没有版权的争议(不想去用盗版的vmware)。个人喜欢命令行模式操作,一方面比较节约资源,另一方面确实也没必要用图形界面。

安装virtualbox6.0.10,其他版本也可以,根据需要自己选择。

下载Ubuntu20.04的server光盘,名称:ubuntu-20.04-live-server-amd64.iso

安装server的虚拟机,在安装的时候不要选择在线更新,这样安装时间会非常长,直接安装即可。在选择安装包的时候,要安装openssh-server。

编辑网络配置文件,改为dhcp(后记:这一步应当忽略):

vi /etc/netplan/00-installer-config.yaml

内容为:


This is the network config written by ‘subiquity’

network:
ethernets:
enp0s3:
dhcp4: yes


关机的时候出现:A stop job is running for snap daemon 并且会计时90秒,通过修改/etc/systemd/system.conf来实现缩短时间,将:

找到如下两行(大约在第35行左右):

DefaultTimeoutStartSec=90s

DefaultTimeoutStopSec=90s

删除前面的’#’,把90改为10:
DefaultTimeoutStartSec=10s
DefaultTimeoutStopSec=10s

安装SecureCRT8.7,后面要勾选key exchange的选项才能连接ubuntu主机。

SecureCRT连接主机,并安装必须的工具:

root@szddt:/opt/NUC970_Buildroot# apt-get install make
root@szddt:/opt/NUC970_Buildroot# apt-get install gcc
root@szddt:/opt/NUC970_Buildroot# apt-get install g++
root@szddt:/opt/NUC970_Buildroot# apt-get install python-is-python3 unzip libncurses5-dev

搭建具体的代码环境,参考:https://github.com/OpenNuvoton/NUC970_Buildroot

git clone https://github.com/OpenNuvoton/NUC970_Buildroot.git

1) run 'make nuvoton_nuc972_defconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

发表评论

电子邮件地址不会被公开。 必填项已用*标注