Hi3556v200踩坑笔记

Hi3556v200踩坑笔记

学习资料

  1. https://blog.csdn.net/u011003120/category_9990929.html
  2. https://blog.csdn.net/avideointerfaces/category_8762084.html
  3. https://blog.csdn.net/take_it/article/details/106162891
  4. https://blog.csdn.net/fengbingchun/article/details/96110515
  5. https://blog.csdn.net/weixin_51178981/article/details/119301437?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-2.opensearchhbase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-2.opensearchhbase
  6. Linux 内核配置机制(make menuconfig、Kconfig、makefile)讲解
  7. Hisi海思

常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
nautilus /home/pc/hi3556/

su - root
su - pc
sudo /etc/init.d/nfs-kernel-server start
sudo ufw disable
sudo apt-get install u-boot-tools

rm -f /etc/init.d/S10mpp
#安装
sudo apt-get install -y build-essential
#sudo chmod +x arm-himix100-linux.install
#sudo arm-himix100-linux.install
su
source ./arm-himix100-linux.install

export PATH=/opt/hisi-linux/x86-arm/arm-himix100-linux/target/bin:$PATH
export PATH="/opt/hisi-linux/x86-arm/arm-himix100-linux/bin:$PATH"

sudo apt-get install zlib1g-dev liblzo2-dev uuid-dev pkg-config
sudo apt-get install make libc6 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools texinfo texlive gawk curl upx pngquant bison flex

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/x86_64-linuxgnu/pkgconfig"
#/opt/hisi-linux/x86-arm/arm-himix100-linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin


#环境变量
sudo gedit /etc/profile
#添加
export PATH="$PATH:/opt/au1200_rm/build_tools/bin"

export PATH="/opt/hisi-linux/x86-arm/arm-himix100-linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/au1200_rm/build_tools/bin:/home/pc/hi3556/arm-himix100-linux/gdb/install/bin:/home/pc/hi3556/arm-himix100-linux/gdb/aarch64-himix100-linux/bin:/aarch64-himix100-linux/bin:/opt/hisi-linux/x86-arm/arm-himix100-linux/target/bin"

#显示隐藏文件
#桌面 ctrl+H
ls -a

#Linux 在文件夹的所有文件中查找某字符
grep -r -e string directory
grep -r -e "test" /home/

#查看内存
cat /proc/media-mem

#启动网络驱动
#modprobe nfs
#cat /proc/filesystems
/app/komod/usb2net_load.sh
#配置
#ifconfig usb0 xx.xx.xx.xx netmask 255.255.xxx.0;route add default gw xx.xx.xx.xx
#ifconfig usb0 192.168.0.1 netmask 255.255.0.0;route add default gw 192.168.0.1
#ifconfig usb0 192.168.3.110 netmask 255.255.0.0;route add default gw 192.168.3.1
ifconfig usb0 192.168.2.10 netmask 255.255.255.0;route add default gw 192.168.2.1

rmmod dwc3.ko;rmmod libcomposite.ko
/app/komod/usb2net_load.sh;ifconfig usb0 192.168.2.10 netmask 255.255.255.0;route add default gw 192.168.2.1
ifconfig wlan0 192.168.2.1 netmask 255.255.255.0;route add default gw 192.168.2.1
mount -t nfs -o nolock 192.168.2.150:/nfsroot /mnt

/app/komod/usb2net_load.sh;ifconfig usb0 192.168.1.10 netmask 255.255.255.0;route add default gw 192.168.1.1


ifconfig wlan0 192.168.1.1 netmask 255.255.255.0;route add default gw 192.168.1.1
mount -t nfs -o nolock 192.168.1.150:/nfsroot /mnt

mount -t nfs -o nolock 192.168.0.150:/nfsroot /mnt
#Linux 控制台访问 Huawei LiteOS 控制台:
# Ctrl+C 退出
virt-tty a7

#启动pqtools
#在 Linux 端串口启动 PQControl 业务和 PQT 通信业务
ifconfig lo up;
wget --spider -q "http://127.0.0.1/cgibin/hisnet/setpqdebug.cgi?&-pqdebug=1"
#在 Linux 端串口关闭 PQControl 业务和 PQT 通信业务
wget --spider -q "http://127.0.0.1/cgibin/hisnet/setpqdebug.cgi?&-pqdebug=0"

./app/komod/usb2net_load.sh
ifconfig usb0 192.168.0.2 netmask 255.255.0.0;route add default gw 192.168.0.1
sharefs&

virt-tty a7

#pq_stream sensortype /app/sharefs
#sensortype!!!
pq_stream imx307 /app/sharefs
pq_control /app/sharefs

CTRL+C

cd /app/bin
./HiIspTool.sh -a

#裁剪Linux内核
cp ./arch/arm/configs/hi3556v200_amp_defconfig .config
cp ./arch/arm/configs/hi3559v200_amp_defconfig .config
make ARCH=arm CROSS_COMPILE=arm-himix100-linux- menuconfig
make ARCH=arm CROSS_COMPILE=arm-himix100-linux- uImage -j 20

cd /home/pc/Desktop/hi3556v200_demo/osdrv/opensource/kernel/linux-4.9.y; \
find drivers/usb -name *.ko -exec cp -rf {} /home/pc/Desktop/hi3556v200_demo/osdrv/pub/ko \; ;\
find drivers/mmc -name *.ko -exec cp -rf {} /home/pc/Desktop/hi3556v200_demo/osdrv/pub/ko \; ;\
cd -;
/home/pc/Desktop/hi3556v200_demo/osdrv
cp /home/pc/Desktop/hi3556v200_demo/osdrv/opensource/kernel/linux-4.9.y/arch/arm/boot/uImage /home/pc/Desktop/hi3556v200_demo/osdrv/pub/hi3559v200_spi_amp_image_uclibc/uImage_hi3559v200_amp


#nfs
mount –t nfs –o tcp 192.168.0.100:/share /mnt/nfs
mount -t nfs -o nolock -o tcp -o rsize=32768,wsize=32768 192.168.2.150:/home/pc/nfsroot /mnt

文件夹打开终端

  1. 命令行:sudo apt-get install nautilus-open-terminal

  2. 重新加载文件管理器:nautilus -q

  3. 如果执行以上指令后在文件夹中右键还没有open in terminal选项的话就重启就好了。

demo教程

密码12345678
rtsp://192.168.0.1/livestream/1

问题

编译

资料

参考资料: https://blog.csdn.net/wirner/article/details/107024607
海思官方SDK Hi3516EV200_SDK_V1.0.1.0的编译教程
https://blog.csdn.net/wirner/article/details/107426024
编译Hi3516DV300的SDK
https://blog.csdn.net/wirner/article/details/107425986
安装交叉编译工具:arm-himix200-linux
https://blog.csdn.net/Turix/article/details/105146180
从零开始创建Hi3516DV300在EMMC上的根文件系统
https://blog.csdn.net/wirner/article/details/106979438
在ubuntu18.04上搭建的海思Hi3516EV200的编译环境
https://blog.csdn.net/nswcszmdfj/article/details/106697741
Hi3516EV200 liteOs SDK搭建
https://zhuanlan.zhihu.com/p/257938114
在Linux环境下,Hi3516DV300开发板搭载鸿蒙OS实现一个简单的Helloworld程序
https://blog.csdn.net/mao_hui_fei/article/details/108954420
海思3516dv300如何使用tftp烧录uboot、内核、文件系统
https://zhuanlan.zhihu.com/p/257965064
推荐丨8大视频课程学习海思AI芯片开发及部署
https://zhuanlan.zhihu.com/p/71789194
海思芯片系统镜像烧写教程
海思Hi3559(七)——NFS挂载https://blog.csdn.net/qq_38108312/article/details/115354765
Hisi海思

问题集

  1. https://blog.csdn.net/wb4916/article/details/114887107
  2. 编译Hi3518EV200 SDK遇到的问题
  3. 从搭建海思HI3516A开发环境到成功编译OSDRV整个目录走过的坑……

其他资料

  1. error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file
1
2
3
4
$ sudo apt install apt-file
$ sudo apt-file update
$ sudo apt-file find libncurses.so.5
$ sudo apt install libncurses5
  1. 已经安装并配置环境了,还是报错arm-himix100-linux-gcc: Command not found命令找不到

  2. 在Linux里设置环境变量的方法(export PATH)

    之前只在/etc/profile里面设置环境,发现终端里面’echo $PATH‘不生效,因此要在/root/.bashrc添加 ‘source /etc/profile’

  3. 问题解决:error: #error “Please port gnulib fseterr.c to your platform! Look at the definitions of ferror

使用

问题集

  1. Hi3559V200 网络部署 (一)

    步骤一单板上的转网口的驱动实际是在/app/komod/usb2net_load.sh

    步骤二. 文档上所说的linux.inf所在的路径为Hi3559V200_MobileCam_V1.0.1.5\Hi3559V200_MobileCam_V1.0.1.5\Hi3559V200_MobileCam_V1.0.1.5[01.software](https://link.zhihu.com/?target=http%3A//01.software)\pc\usb_tools

    步骤三.这一步是个大坑.

    1. 首先我们先用双头USB线将单板与PC机相连
    2. 进入到/app/komod文件夹,执行 usb2net_load.sh
    3. 执行完此命令后,在PC机的设备管理器中才能看到所谓的驱动加载起来
    4. 此处加载起来的驱动名称也不一样和文档中所说的一样.你可以通过usb2net_unload.sh再次在板卡端将usb虚拟网卡卸载下来.通过unload->load操作来观察PC端设备管理器中显示的是什么驱动名.
    5. 此后可以按照文档介绍继续进行驱动的安装过程了
    6. 完成此步操作之后,我们可以进入到PC机的网络连接管理器下查看一下了应该出现了如下图所示的图标.别管具体的名字,只要又Linux USB Ethernet的字样就OK
  2. 海思3556V200 PQTools 工具环境搭建

    1、电脑先安装MCR(Matlab Compiler Runtime)2012a(7.17)的32 位版本。下载地址:http://cn.mathworks.com/products/compiler/mcr/

    2、将SDK中的Hi3559V200_MobileCam_V1.0.1.3\01.software\pc\PQTools的HiPQTools_V5.18.1.zip直接解压到电脑上即可。

    3、Hi3559V200_MobileCam_V1.0.1.3\01.software\pc\PQTools目录中Hi3559V200_PQ_V1.0.1.3_AMP.tgz文件拷贝到SDK pqtool目录中。

    4、将Hi3559V200_PQ_V1.0.1.3_AMP.tgz文件解压,进入解压后文件夹Hi3516EV200_PQ_V1.0.1.3 的pq_sample目录修改Makefile,指定SDK_DIR 为用户使用的SDK路径。

    5、在SDK的最顶层目录 输入命令make menuconfig;
    选择 Build Configure —>
    [ ]PQTool Support(Reference)

    6、在reference层目录下 make clean ,再make

    7、烧录程序

    8、在单板上执行命令加载USB转网口驱动。 命令为 cd /app/komod ./usb2net_load.sh

    9、参考《HiMobileCam SDK 安装使用说明》6.2 USB 网口的搭建,解决驱动安装问题 电脑驱动 在开发包的01.software/pc/usb_tools里面

    10、在单板端配置IP,命令为
    ifconfig usb0 192.168.1.134 netmask 255.255.254.0 (注意同一网段)
    route add default gw 192.168.1.1

    11、在电脑端将PC的网络适配器和单板端的网络适配器进行桥接。

    12、相互ping通
    PC: win+R cmd ping 192.168.134 (demo IP)
    单板端: ping 192.168.0.10(网桥 IP)

    13、
    在单板端:
    virt-tty a7 进入LiteOS端
    pq_control app/sharefs 启动LiteOS端的control
    ctrl+c 退出到Linux端
    cd /app/bin 进入/app/bin目录
    ./StartControl.sh 执行脚本,启动Linux端的control

    14、启动PC端的PQTools工具

系统操作

  1. 关闭板端自启动
  1. Pqtool缺少文件HIPQAutoFocus.dll HiPQISPCalib.dll HiPQStitchingTool.dll

    如果依旧报错,可能是因为还装了其他版本的matlab,因此将2012a的mcr的环境变量设置上移到自己的matlab环境变量的前面。

    不要有中文!包括HiPQ工具的路径

    工具所在文件路径名不要太长😭😭😭

  2. pq_control /app/sharefs报错

    查看文档《HiISP 开发参考》找到错误码

    查看文档《HiMPP V4.0 媒体处理软件开发参考》找到错误码

    HISI3516 MMP VB调试汇总

    修改系统内存配置,linux加载ipcm的ko模块

    HI3556V200 Linux+Liteos双系统学习(5)----内存分配及EMMC Flash分区烧录

    改成Refb板后

    找到Makefile,去掉其中-Werror ,重新编译。

    或者修改下源码

  3. ffmpeg报错

    注意到sdk/reference/dashcam/rootfs下的Makefile

    1
    2
    3
    4
    5
    6
    7
    ifneq ($(AUDIO_OUT_SAMPRATE), $(AUDIO_RESOURCES_SAMPRATE))

    @find $(APPFS_PATH) -regex '.*\.m4a' | xargs -i ffmpeg -i {} -ar $(AUDIO_OUT_SAMPRATE) -v quiet -y {}

    @find $(APPFS_PATH) -regex '.*\.pcm' | xargs -i ffmpeg -f s16le -i {} -ar $(AUDIO_OUT_SAMPRATE) -f s16le -v quiet -y {}

    endif

    同时

    1
    AUDIO_OUT_SAMPRATE	:=$(subst ",,$(word 3, $(shell grep -w sample_rate $(PDT_INICFG_PATH)/config_product_media_common.ini | tail -1 )))

    修改为

    1
    AUDIO_OUT_SAMPRATE	:= 12000

记录

1
2
3
#发现刷屏
top 查看id
kill id

开启NFS

1
2
make ARCH=arm CROSS_COMPILE=arm-himix100-linux- menuconfig
make ARCH=arm CROSS_COMPILE=arm-himix100-linux- uImage -j 20
作者

GWJ

发布于

2021-12-20

更新于

2022-12-12

许可协议

评论