海思编译相关

      文章主要是为方便自己记录问题和重点,方便后续查看;

1、load3536中关于内存部分的理解 

  mem_total=1024; # 1024M, total mem //表示总的内存,大小
  mem_start=0x40000000; # phy mem start //表示内存的启始位置,这里通常是芯片手册中,地址空间映射表中,会有标识出ddr的启始地址。

  os_mem_size=384; # 384M, os mem //表示分配给操作系统的内存
  mmz_start=0x58000000; # mmz start addr //表示mmz内存的启始公交车
  mmz_size=640M; # 640M, mmz size //表示mmz内存的大小

  这块的设置,需要和u-boot中的bootargs配套使用,如配套的bootargs:

       mem=384M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:2M(boot),4M(kernel),26M(rootfs)

       另外,海思中,查询os内存或mmz内存的两条指令

       查询os内存:free -m

       查询mmz内存:cat /proc/media-mem

2、海思打包命令

3536的打包命令:

pushd /home/hphua/osdrv/pub/bin/pc/;./mkfs.jffs2 -d /home/hphua/osdrv/pub/rootfs_glibc_single/ -l -e 0x10000 -o /home/hphua/osdrv/pub/image_glibc_single/rootfs_hi3536_64k_create.jffs2

3、3531dv200的编译

      编译基本是依据文档进行,过程中主要遇到下述错误,记录下解决过程

      3.1报错

  /usr/bin/mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file…] image

  -A ==> set architecture to ‘arch’
  -O ==> set operating system to ‘os’
  -T ==> set image type to ‘type’
  -C ==> set compression type ‘com
  ----》

  需要重新编译mkimage;osdrv目录下先对uboot进行编译,make BOOT_MEDIA=spi AMP_TYPE=linux hiboot 进行uboot的编译。ok之后(osdrv目录下)cd opensource/uboot/u-boot-2016.11/tools ,把里面的mkimage拷到 /usr/local/bin/目录下。sudo cp mkimage /usr/local/bin/ 。

3.2、报错

     internal compiler error: Killed (program cc1plus)

     ----》虚拟机,内存不足,修改Makefile,把-j 20去掉,减少编译线程;

3.3、报错

     fatal error:openssl/sha.h: No such file or directory

    ----》sudo apt-get install libssl-dev -y

3.4、报错

    configure: WARNING: cannot find uuid library required for mkfs.ubifs
   configure: mtd-utils can optionally be built without mkfs.ubifs
   configure: WARNING: cannot find headers for extended attributes
   configure: WARNING: disabling XATTR support
   configure: error: missing one or more dependencies
   make[1]: *** No targets specified and no makefile found. Stop.
   make[1]: *** No rule to make target `install’. Stop.

  ---》apt-get install libuuid1:i386

      apt-get install uuid-dev

 3.5、报错

     Command not found after installing 7z

     ---》

sudo apt-get install p7zip
sudo apt-get install p7zip-full

 

 

posted @ 2021-04-23 15:00  古先生-嵌入式  阅读(418)  评论(0编辑  收藏  举报