解压

用到的配置文件位置: /NUC980-linux-4.4.y-master/arch/arm/configs/nuc980_defconfig

执行:
编译linux内核源码。了解其 配置文件在 arch/arm/configs/nuc980_defconfig
 (1) make nuc980_defconfig 载入配置文件

 (2) make menuconfig
 --->Device Drivers --->使能MMC/SD/SDIO card support -->使能Nuvoton NUC980 SD Card support


 
 --->General setup -->关闭Initial RAM filesystem and RAM disk support [ 这个是使用spiflash 启动时候,kernel 和rootfs 打包用]

 
 --->File systems -->使能The Extended 4 (ext4) filesystem 第四期视频漏掉的,未使能 导致rootfs无法加载

打印:
 config - Linux/arm 4.4.289 Kernel Configuration
  > Kernel hacking > printk and dmesg options 
 (3)make 生成980image 
如果发生: arm-linux-gcc: Command not found的处理办法:
NUC980编译错误,arm-linux-gcc: Command not found_IOT-Power的博客-CSDN博客
在内核的同目录创建一个image 的文件夹,然后再编译,否则出错!

 
 
 (4)make uImage 生成980uimage

解决办法:mkimage command not found - U-Boot images will not be built_CryptonymAMS的博客-CSDN博客
缺失mkimage: 将Uboot中的工具 copy /bin/中
sudo cp mkimage /bin/

再次编译:

 
 将 980uimage 拷贝到 SD卡BOOT分区中。
启动UBOOT命令行,配置启动参数:
baudrate=115200
bootargs=console=ttyS0,115200n8 noinitrd rw rootfstype=ext4 root=/dev/mmcblk0p2 rootwait mem=64M
bootcmd=fatload mmc 0:1 0x19000 980uimage;fatload mmc 0:1 0x7c0000 nuc980-dev-v1.0.dtb;bootm 0x19000 - 0x7c0000
bootdelay=3
ethact=emac
stderr=serial
stdin=serial
stdout=serial
修改:
setenv bootcmd 'fatload mmc 0:1 0x19000 980uimage;fatload mmc 0:1 0x7c0000 nuc980-dev-v1.0.dtb;bootm 0x19000 - 0x7c0000'
setenv save
setenv print
重启板子出错:ERROR: Did not find a cmdline Flattened Device Tree

由于现在没有设备树,那么暂时按照没有设备数配置:
修改Uboot:
不使用设备树:
取消Boot images -> Support Flattened Image Tree
取消 Library routines->nable the FDT library


重新编译Uboot下载即可。
生成设备树:
让Uboot 支持设备树:
①Boot images -> Support Flattened Image Tree

②Library routines->nable the FDT library 取消Support running EFI Applications in U-Boot

重新编译Uboot,更新板子。



















