开发环境

1.   Linux platform: ubuntu-18.04.3-desktop-amd64
官网连接:(https://www.nuvoton.com.cn/products/microprocessors/arm9-mpus/nuc970-industrial-control-series/nuc977dk61y/?group=Software&tab=2)
2.  GCC 4.8.4 crLinuxs compiler with EABI suppor
3.  VMware Workstation 15.5
使用文档:参考UM_NUC980_NUC970_Linux_environment_on_VMware_EN_Rev1.00.pdfu-Boot v2016.11下载:
https://gitee.com/OpenNuvoton/NUC970_U-Boot_v2016.11
kernel下载:
https://gitee.com/OpenNuvoton/NUC970_Linux_Kernel

uboot添加单板相关的代码至SI工程:

1.   选择NUC970_U-Boot_v2016.11目录 -> ADD ALL(选中“Include top level sub-directories”和“Recursively add lower sub-directories”点击“OK)
2.  选中board目录 -> 点击Remove Tree,去掉整个目录
3.  单选board目录 -> /board/nuvoton/nuc970 -> 点击ADD ALL4. 选中arch目录 -> 点击Remove Tree,去掉整个目录
5.  单选arch目录 -> /arch/arm/cpu/arm926ejs -> 点击ADD ALL(取消“Include top level sub-directories”和“Recursively add lower sub-directories”点击“OK)
6.  单选arch目录 -> /arch/arm/cpu/arm926ejs/nuc70 -> 点击ADD ALL
7.  单选arch目录 -> /arch/arm/dts -> 点击ADD ALL
8.  单选arch目录 -> /arch/arm/include -> 点击ADD ALL(取消“Include top level sub-directories”和“Recursively add lower sub-directories”点击“OK)只添加顶层目录
9.  单选arch目录 -> /arch/arm/include/asm/arch-nuc970 -> 点击ADD ALL
10. 单选arch目录 -> /arch/arm/include/asm/proc-armv -> 点击ADD ALL
11. 单选arch目录 -> /arch/arm/lib -> 点击ADD ALL12. 选中include目录 -> 点击Remove Tree,去掉整个目录
13. 进入include -> 点击Add All(去掉“include top level sub-directories”和“recursively add lower sub-directories”前面的勾)表示只加顶层目录的文件
14. 选中include目录 -> /include/andestech -> ADD ALL
15. 选中include目录 -> /include/asm-generic -> ADD ALL
16. 选中include目录 -> /include/configs/ -> 选择nuc70_evb.h -> 点击ADD
17. 同步,添加完成

编译uboot:

1.make distclean
2.make nuc970_defconfig
3.make menuconfig
在配置选项下面配置支持SPI NOR FLASH启动方式:(使用的华邦spi flash)
Device Drivers  ---> SPI Flash Support  --->  [*] Legacy SPI Flash Interface support [*]   SPI flash Bank/Extended address register support [*]   Winbond SPI flash support   Device Drivers  ---> SPI Support  ---> [*] NUC970/N9H30 SPI driver                                                                                                        Select NUC970/N9H30 SPI in Quad mode or Normal mode (Quad mode)  --->  (X) Quad mode   Command line interface  ---> Device access commands  ---> [*] sf[*] sspi
//note:修改配置头文件:include/configs/nuc970_evb.h
#define CONFIG_SYS_USE_SPIFLASH
#define CONFIG_SYS_USE_NANDFLASH
/*#define CONFIG_ENV_IS_IN_NAND */
#define CONFIG_ENV_IS_IN_SPI_FLASH
/*#define CONFIG_ENV_IS_IN_MMC *///common/board_r.c文件中的init_sequence_r[]关于nand的去掉,折腾几天uboot没有启动成功,nuvoton默认支持nand flash启动,卡在了检测
nand里面,导致一直uboot在无限重启#ifdef CONFIG_CMD_NAND//initr_nand,
#endif
#ifdef CONFIG_CMD_ONENAND//initr_onenand,
#endif
4.make
会生成u-boot.bin文件

编译Kernel

 建立依赖文件:1.    在linux-3.10.x/的上一层,建立mkdir image文件夹,生成的imagem,uImage镜像文件会在此目录生成2.  保证linux-3.10.x/同级目录下有根文件系统文件 rootfs/
 1.  cd linux-3.10.x/1.  make nuc976_defconfig2. make uImage
 在建立的image文件夹下会生成image,uImage烧录镜像文件

环境变量文件:env.txt

baudrate=115200
bootdelay=3
ethact=emac
ethaddr=00:00:00:11:66:88
stderr=serial
stdin=serial
stdout=serial
bootcmd=sf probe 0 18000000\; sf read 0x7FC0 0x200000 0x9206d0\; bootm 0x7FC0
watchdog=off
1.sf probe 0 18000000 : 将SPI时钟设置为18MHz
2.sf read 0x7FC0 0x200000 : 0x4D7800将一个大小为0x4D7800Bytes的Linux内核映像档(970uimage)
从SPI flash偏移量0x200000的位置读取到DDR 0x7Fc0的位置
3.bootm 0x7fc0 : 从DDR的0x7fc0这个地址启动内核

烧录uboot:地址0xE00000

烧录uImage,地址0x200000

烧录环境变量,地址0x80000

上电运行可以看到kernel启动完整log:

U-Boot 2016.11-g3bd4967-dirty (Nov 23 2021 - 16:44:27 +0800)CPU: NUC976
Board: NUC976
DRAM:  64 MiB
SF: Detected W25Q128BV with page size 256 Bytes, erase size 4 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
Net:   emac
Hit any key to stop autoboot:  0
SF: Detected W25Q128BV with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x200000, size 0x9206d0
SF: 9570000 bytes @ 0x200000 Read: OK
## Booting kernel from Legacy Image at 00007fc0 ...Image Name:   Linux-3.10.101Image Type:   ARM Linux Kernel Image (uncompressed)Data Size:    5072472 Bytes = 4.8 MiBLoad Address: 00008000Entry Point:  00008000Verifying Checksum ... OKXIP Kernel Image ... OKStarting kernel ...SF: Detected W25Q128BV with page size 256 Bytes, erase size 4 KiB, total 16 MiB
SF: DeviceBooting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.10.101 (user@ubuntu) (gcc version 4.8.5 (Buildroot 2016.11.1-g7116cea) ) #3 PREEMPT Wed Nov 24 10:28:12 CST 2021
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: NUC970
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 57900k/57900k available, 7636k reserved, 0K highmem
Virtual kernel memory layout:vector  : 0xffff0000 - 0xffff1000   (   4 kB)fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)vmalloc : 0xc4800000 - 0xff000000   ( 936 MB)lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)modules : 0xbf000000 - 0xc0000000   (  16 MB).text : 0xc0008000 - 0xc033af04   (3276 kB).init : 0xc033b000 - 0xc0675a54   (3307 kB).data : 0xc0676000 - 0xc06a95e0   ( 206 kB).bss : 0xc06a95e0 - 0xc06d9420   ( 192 kB)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:625
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 148.88 BogoMIPS (lpj=744448)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys perf_event
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc0291788 - 0xc02917c4
devtmpfs: initialized
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource nuc970-timer1
cfg80211: Calling CRDA to update world regulatory domain
NET: Registered protocol family 2
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 113
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
nuc970-uart.0: ttyS0 at I/O 0x0 (irq = 36) is a NUC970
brd: module loaded
libphy: nuc970_rmii0: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nuc970-ehci nuc970-ehci: Nuvoton NUC970 EHCI Host Controller
nuc970-ehci nuc970-ehci: new USB bus registered, assigned bus number 1
nuc970-ehci nuc970-ehci: irq 23, io mem 0xb0005000
nuc970-ehci nuc970-ehci: USB 2.0 started, EHCI 0.95
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc970-ohci nuc970-ohci: Nuvoton NUC970 OHCI Host Controller
nuc970-ohci nuc970-ohci: new USB bus registered, assigned bus number 2
nuc970-ohci nuc970-ohci: irq 24, io mem 0xb0007000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usbcore: registered new interface driver usb-storage
TCP: cubic registered
NET: Registered protocol family 17
Freeing unused kernel memory: 3304K (c033b000 - c0675000)BusyBox v1.22.1 (2016-02-03 14:11:04 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.~ # ls
app.sh   dev      lib      mnt      sbin     tmp      var
bin      etc      linuxrc  proc     sys      usr

修改rootfs,添加上电启动脚本

1.   cd rootfs/
2.  touch app.sh#在app.sh添加以下内容测试:#!/bin/bashecho "############## Hello World ##############!"
3.  chmod 777 app.sh
4.  在/etc/init.d/rcS最后,添加内容,让系统启动自动运行source /app.sh
5.  cd linux-3.10.x/
6.  make uImage重新编译生成uImage烧录,开机可以看到app.sh自动运行

启动部分log:

Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
nuc970-uart.0: ttyS0 at I/O 0x0 (irq = 36) is a NUC970
brd: module loaded
libphy: nuc970_rmii0: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nuc970-ehci nuc970-ehci: Nuvoton NUC970 EHCI Host Controller
nuc970-ehci nuc970-ehci: new USB bus registered, assigned bus number 1
nuc970-ehci nuc970-ehci: irq 23, io mem 0xb0005000
nuc970-ehci nuc970-ehci: USB 2.0 started, EHCI 0.95
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc970-ohci nuc970-ohci: Nuvoton NUC970 OHCI Host Controller
nuc970-ohci nuc970-ohci: new USB bus registered, assigned bus number 2
nuc970-ohci nuc970-ohci: irq 24, io mem 0xb0007000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usbcore: registered new interface driver usb-storage
TCP: cubic registered
NET: Registered protocol family 17
Freeing unused kernel memory: 3304K (c033b000 - c0675000)
############## Hello World ##############!BusyBox v1.22.1 (2016-02-03 14:11:04 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

使用nuvoton976DK61Y BSP运行自己的demon相关推荐

  1. WINCE的内存配置

    WINCE的内存(包括SDRAM及FLASH)的配置包含两个方面:源代码(包括C和汇编)中的定义,及系统配置文件CONFIG.BIB中的定义.源代码中需要定义内存的物理及虚拟地址,大小,并初始化名为O ...

  2. WINCE的内存配置-config.bib文件的解析

    WINCE的内存(包括SDRAM及FLASH)的配置包含两个方面:源代码(包括C和汇编)中的定义,及系统配置文件CONFIG.BIB中的定义.源代码中需要定义内存的物理及虚拟地址,大小,并初始化名为O ...

  3. python求助神器_python三大神器

    Python 中有很多优秀的包,本文主要讲一下 pip, virtualenv, fabric 1. pip 用来包管理 1 #安装,可指定版本号 2 (sudo) pip install Djang ...

  4. python必备神器_Python 必备神器

    1. pip 用来包管理 # 安装,可指定版本号 (sudo) pip install Django==1.6.8 # 升级 (sudo) pip install bpython --upgrade ...

  5. wince内存配置(转gooogleman的工作日志)

    WINCE的内存(包括SDRAM及FLASH)的配置包含两个方面:源代码(包括C和汇编)中的定义,及系统配置文件CONFIG.BIB中的定义.源代码中需要定义内存的物理及虚拟地址,大小,并初始化名为O ...

  6. 百度LBS服务我们自己上传数据,我们客户端获取数据然后进行小黄车和膜拜单车定位描点等骚操作

    一,演示和需求的SDK和ak等配置最近我们一个项目需要自己android端上传数据到百度LBS服务,然后获取数据并显示.搞了2天完成了.其实很简单的哦!我们一步步来,今天的活我一小时搞定,一天写博客, ...

  7. Intel系统编程指南第八章——8.4 多处理器(MP)初始化

    IA-32架构(开始于P6家族处理器)定义了一个多处理器(MP)初始化协议,称为多处理器规范版本1.4.该规范定义了IA-32处理器在多处理器系统中所使用的引导协议.(这里,多处理器被定义为两个或更多 ...

  8. 从数据中进行学习-基础知识

    1. 大数据 大数据是一种理念.一种解决问题的方法和一系列技术的集合.他与传统BI一样,都是从数据中挖掘有价值的信息,以满足商业目标:但它的独特之处在于:分布式.并行化. 优秀的数据科学家需要具备的素 ...

  9. MIT-JOS系列8:多任务处理(一)

    Part A:多处理器支持和协作式多任务处理 注:根据MIT-JOS的lab指导手册,以下不明确区分"环境"和"进程" 在这部分实验中,我们将扩展JOS使之能在 ...

  10. maya mentray_【Maya Mentalray】Maya Mentalray渲染设置

    摘要:在渲染过程中,所有的几何体都会被分解成为多个三角面进行最终的渲染输出,可以给表面物体添加Approximation节点来控制表面在渲染时的细分 相关视频教程学习推荐: MAYA/ZBRUSH角色 ...

最新文章

  1. 全面升级!星环科技基础软件再升级,赋能数字中国建设
  2. “阿姨我不想努力了”,阿姨的回复让我重燃斗志!
  3. 深度学习入门之PyTorch学习笔记:多层全连接网络
  4. python如何模拟键盘输入_python实现键盘输入的实操方法
  5. 图说 mysql 事务隔离级别
  6. 【Ant Design Vue】之layout布局
  7. Pandas 列索引操作
  8. android8.0华为荣耀8,一线|华为手机开启重大升级 荣耀成安卓8.0覆盖机型最多品牌...
  9. 单例模式(含多线程处理)
  10. 校验两个文件是否一样(MD5方式:windows,linux,自定义java代码三种方式)——亲测成功
  11. Oracle中使用批处理文件批量建表
  12. 主动学习、纯半监督学习与直推学习
  13. NetLimiter网速测试小坑
  14. 2.PyTorch的Dataset和DataLoader
  15. 傲慢与偏见之 - 因果倒置的锦上添花
  16. 【Java定时器】每天凌晨12点执行一次
  17. 20190916CF训练
  18. Sci-Hub创始人收到苹果的通知:2年前就把她的账户数据给了FBI
  19. 对面向过程,对象,接口,切面的理解
  20. Can't change container ID of fragment

热门文章

  1. c# chart 各个属性_C# Chart控件,chart、Series、ChartArea曲线图绘制的重要属性
  2. Base64在线转换工具
  3. Base64转MultipartFile
  4. 精力管理指南:想要每天精力充沛,只需做好这 3 点
  5. 哈利波特3 阿兹卡班的囚徒
  6. 如何将pdf批量转换成word?
  7. 注册表操作,reg脚本简单编写
  8. 程序员面试总结 (非原创)
  9. 切披萨n块需要几刀原理c语言,别再问我披萨要切几块了
  10. 自强不息系列之Python 线性查找