学习Hi3516EV200的第一天——安装环境

学习Hi3516EV200的第一天——安装环境

问题及解决方法

写博客,要有系统性,要能成系统前后连贯起来,所以先用typora写然后再导入csdn中发表

意见:小心命令行中的空格、-和—这两者是不同的,希望最好可以自己手打命令行;然后还有就是如果可以的话先熟悉一下linux下的命令行然后再来安装,这样有助于看懂命令行的意思,在遇到问题时容易解决比如:./的意思是执行这个文件夹下边有的内容,如果没有不就没办法执行了吗。所以了解命令之后有助于安装
还要仔细看文档中的各个目录中的内容以及作用,己方便以后查找东西还能了解各个文件夹的作用
ubantu20.04版本的虚拟机
出师不利,安装软件包的第一行命令就出现问题了。
1、无法定位软件包 lib32ncurses5
具体的问题如下:执行命令出现错误

apt-get install g++ u-boot-tools lib32z1 lib32ncurses5 lib32bz2-1.0
lib32stdc++6 zlib1g-dev liblzo2-dev uuid-dev libacl1-dev libncurses5-dev

在这里插入图片描述
  从上面这个报错其实也知道原因了,就是在“更新源地址平台上”找不到相应的“lib32ncurses5”软件包。

  找不到软件包通常是软件包名输入错误,或者说,没有这个软件包了,有些软件包可能会被移除或被其它的软件包替代了等等。
解决办法:可以先安装其他的软件包最后在安装无法定位的软件包,可以先安装g++、等软件包
  对于:无法定位的软件包, 我们需要更新系统源,因为原来的系统源中没有这个软件包,所以我们只好去找其他源或者站点

 sudo apt-get update//更新一些软件源

去掉 u-boot-tools:i386中的 :i386部分

这个命令中还缺少命令:arm-himixXXX-linux-size文件是32位的,64位的系统缺少了lib库。
执行sudo apt install lib32z1-dev
2、安装过程中TCP传输出现问题就是Hashes of expected file
在这里插入图片描述
解决办法:重新安装一遍就可以了
3、安装交叉编译链
发布包提供编译工具链arm-himix100-linux-、arm-himix200-linux-。
但是我们使用的是arm-himix100-linux-
为基于32bit 操作系统uclibc 的工具链
4、tar命令中的”-“有问题
在这里插入图片描述
原因是”-“是在文档上边赋值粘贴下来的,所以和在键盘上打的不是一样的
解决办法:自己在键盘上打一个”-“
5、在生成U-boot镜像得时候mkboot.sh命令无法执行

sudo: ./mkboot.sh:找不到命令

解决办法:右击xxx.sh文件,打开属性———>权限——>勾选允许作为程序执行文件
退出即可
重新运行sudo ./xxx.sh,问题已解决
6.chmod +x arm-himix100-linux.install命令无法执行
chmod无法找到命令行
解决办法:chmod和+x之间有一个空格 这个
7、当出现Kernal出现编译错误的问题时候
在这里插入图片描述
解决办法:有可能是解压错误导致的,可以重新进行解压,然后重新进行
cp arch/arm/configs/hi3516ev200_xxx_defconfig .config小心空格,然后就是明白linux的命令行。
8、根文件系统中etc文件、lib文件、dev文件的配置
参考链接:https://www.ebaina.com/articles/140000004412
参考《Hi3516EV200/Hi3516EV300/Hi3518EV300 开发环境用户指南》
dev表示的是设备文件,不需要手动配置可以自动生成
最主要的是lib文件即库文件:此文件需要根据你自己的交叉编译链来进行配置即
在这里插入图片描述
此图中就是交叉编译链的lib文件此时库文件配置到此结束
然后该生成根文件系统了 一般spi nor flash是生成jffs2 为可读写文件系统。
执行命令:./mkfs.jffs2 -d ./rootbox -l –e 0x20000 -o jffs2-root.img(./不需要也是可以的
注意:空格 和- 和— 两个斜杆是不同的
此处会出现错误关于flash 擦除块大小整数倍的错误
正确的命令应该是:mkfs.jffs2 -d ./rootbox -l –e 0x10000 -o jffs2-root.img
因为**-e Flash的块大小**需要的是和你配套的开发板的erear block(擦除块)的大小一致,这个通过u_boot启动打印信息可以看到
在这里插入图片描述
显然block为64KB.
9、当把根文件系统的etc、dev、lib配置完成之后,需要进行设置启动参数(注意linux-4.9.y kernel默认文件系统只读,需要在bootargs中加入rw选项,文件系统才可读写)
参考文档:《Hi3516EV200/Hi3516EV300/Hi3518EV300Linux SDK 安装以及升级使用说明》
参考连接:https://www.ebaina.com/articles/140000004491
执行以下三个命令:

setenv bootargs 'mem=32M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 rw mtdparts=hi_sfc:1M(boot),4M(kernel),11M(rootfs)'//这三个分别是u_boot、kernel、rootfs三个的长度
setenv bootcmd 'sf probe 0;sf read 0x42000000 0x100000 0x400000;bootm 0x42000000'
saveenv

当设置完成之后需要 reset 重新启动系统

启动成功之后的打印信息
System startup

Uncompress Ok!

U-Boot 2016.11 (Jun 03 2019 - 10:40:04 +0800)hi3516ev200

Relocation Offset is: 1f735000
Relocating to 5ff35000, new gd at 5fed4ef0, sp at 5fed4ed0
SPI Nor:  Check Flash Memory Controller v100 ... Found
SPI Nor ID Table Version 1.0
SPI Nor(cs 0) ID: 0xc2 0x20 0x19
Block:64KB Chip:32MB Name:"MX25L(256/257)XX"
SPI Nor total size: 32MB
NAND:  0 MiB
MMC:   
In:    serial
Out:   serial
Err:   serial
Net:   eth0
Hit any key to stop autoboot:  0 
device 0 offset 0x100000, size 0x400000

SF: 4194304 bytes @ 0x100000 Read: OK
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-4.9.37
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3438386 Bytes = 3.3 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Loading Kernel Image ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.9.37 (wind@WKC) (gcc version 6.3.0 (HC&C V100R002C00B032_20190114) ) #6 Mon Nov 2 20:29:20 CST 2020
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
CPU: div instructions available: patching division code
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: Hisilicon HI3516EV200 DEMO Board
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 10160
Kernel command line: mem=40M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 rw mtdparts=hi_sfc:1M(boot),4M(kernel),27M(rootfs)
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: 33500K/40960K available (5071K kernel code, 183K rwdata, 1260K rodata, 176K init, 249K bss, 7460K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xc3000000 - 0xff800000   ( 968 MB)
    lowmem  : 0xc0000000 - 0xc2800000   (  40 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc04fc1a0   (5073 kB)
      .init : 0xc063a000 - 0xc0666000   ( 176 kB)
      .data : 0xc0666000 - 0xc0693fa0   ( 184 kB)
       .bss : 0xc0695000 - 0xc06d34c0   ( 250 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:16 nr_irqs:16 16
Gic dist init...
arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
Switching to timer-based delay loop, resolution 20ns
clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=500000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x40008200 - 0x40008258
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Serial: AMBA PL011 UART driver
12040000.uart: ttyAMA0 at MMIO 0x12040000 (irq = 20, base_baud = 0) is a PL011 rev2
console [ttyAMA0] enabled
12042000.uart: ttyAMA2 at MMIO 0x12042000 (irq = 21, base_baud = 0) is a PL011 rev2
SCSI subsystem initialized
ssp-pl022 12070000.spi: ARM PL022 driver, device ID: 0x00800022
ssp-pl022 12070000.spi: mapped registers from 0x12070000 to c306b000
ssp-pl022 12071000.spi: ARM PL022 driver, device ID: 0x00800022
ssp-pl022 12071000.spi: mapped registers from 0x12071000 to c306f000
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Linux video capture interface: v2.00
clocksource: Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=30 max_order=14 bucket_order=0
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered (default)
io scheduler cfq registered
pl061_gpio 120b0000.gpio_chip: PL061 GPIO chip @0x120b0000 registered
pl061_gpio 120b1000.gpio_chip: PL061 GPIO chip @0x120b1000 registered
pl061_gpio 120b2000.gpio_chip: PL061 GPIO chip @0x120b2000 registered
pl061_gpio 120b4000.gpio_chip: PL061 GPIO chip @0x120b4000 registered
pl061_gpio 120b5000.gpio_chip: PL061 GPIO chip @0x120b5000 registered
pl061_gpio 120b6000.gpio_chip: PL061 GPIO chip @0x120b6000 registered
pl061_gpio 120b7000.gpio_chip: PL061 GPIO chip @0x120b7000 registered
pl061_gpio 120b8000.gpio_chip: PL061 GPIO chip @0x120b8000 registered
brd: module loaded
hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.2
hisi-sfc hisi_spi_nor.0: all blocks is unlocked.
hisi-sfc hisi_spi_nor.0: mx25l25635f (Chipsize 32 Mbytes, Blocksize 64KiB)
3 cmdlinepart partitions found on MTD device hi_sfc
3 cmdlinepart partitions found on MTD device hi_sfc
Creating 3 MTD partitions on "hi_sfc":
0x000000000000-0x000000100000 : "boot"
0x000000100000-0x000000500000 : "kernel"
0x000000500000-0x000002000000 : "rootfs"
SPI Nand ID Table Version 2.7
Cannot found a valid SPI Nand Device
hisi_spi_nand_probe(175): Error: driver probe, result: -19
FEPHY:addr=1, la_am=0xc, ldo_am=0x4, r_tuning=0x1c
libphy: hisi_femac_mii_bus: probed
libphy: Fixed MDIO Bus: probed
Generic PHY 10041100.mdio:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=10041100.mdio:01, irq=-1)
phy_id=0x20669903, phy_mode=mii
hisi-femac 10040000.ethernet: using random MAC address 16:91:75:95:a2:25
xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
xhci-hcd xhci-hcd.0.auto: hcc params 0x0220fe6c hci version 0x110 quirks 0x20010010
xhci-hcd xhci-hcd.0.auto: irq 115, io mem 0x10030000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: xHCI Host Controller
usb usb1: Manufacturer: Linux 4.9.37 xhci-hcd
usb usb1: SerialNumber: xhci-hcd.0.auto
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: xHCI Host Controller
usb usb2: Manufacturer: Linux 4.9.37 xhci-hcd
usb usb2: SerialNumber: xhci-hcd.0.auto
hub 2-0:1.0: USB hub found
hub 2-0:1.0: hub can't support USB3.0
usbcore: registered new interface driver cdc_wdm
usbcore: registered new interface driver usb-storage
udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
mousedev: PS/2 mouse device common for all mice
hibvt_rtc 120e0000.rtc: rtc core: registered 120e0000.rtc as rtc0
hibvt_rtc 120e0000.rtc: RTC driver for hibvt enabled
i2c /dev entries driver
hibvt-i2c 12060000.i2c: hibvt-i2c0@100000hz registered
hibvt-i2c 12061000.i2c: hibvt-i2c1@100000hz registered
hibvt-i2c 12062000.i2c: hibvt-i2c2@100000hz registered
uvcvideo: Unable to create debugfs directory
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on 10010000.sdhci [10010000.sdhci] using ADMA in legacy mode
mmc1: SDHCI controller on 10020000.sdhci [10020000.sdhci] using ADMA in legacy mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
Key type dns_resolver registered
hibvt_rtc 120e0000.rtc: hctosys: unable to read the hardware clock
VFS: Mounted root (jffs2 filesystem) on device 31:2.
devtmpfs: mounted
Freeing unused kernel memory: 176K (c063a000 - c0666000)
This architecture does not have kernel memory protection.
random: init: uninitialized urandom read (4 bytes read)

Processing /etc/profile... Done

至此安装完成,但是还需要通过NFS来进行文件传输才可以执行二进制文件。
注意:二进制文件

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不过尔尔丶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值