学习资料
Hi35XX海思芯片基础使用
海思3559
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 app/komod/usb2net_load.sh;ifconfig usb0 192.168.2.10 netmask 255.255.255.0;route add default gw 192.168.2.1 mount -t nfs -o tcp,nolock 192.168.2.1:/nfs /mnt /mnt/gdbserver :1234 /app/bin/main_app mount -t nfs -o tcp,nolock 192.168.2.150:/nfsroot /mnt /mnt/openssh/sbin/sshd app/komod/usb2net_load.sh;ifconfig usb0 192.168.2.10 netmask 255.255.255.0;route add default gw 192.168.2.1 /gdbserver :1234 /app/bin/main_app sed -i 's/.\/main_app \&/#.\/main_app \&/' /app/bootapp ifconfig lo up; wget --spider -q "http://192.168.2.10/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=1" wget --spider -q "http://192.168.2.10/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=0" wget --spider -q "http://127.0.0.1/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=1" wget --spider -q "http://127.0.0.1/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=0" wget --spider -q "http://192.168.0.1/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=1" ifconfig lo up; wget --spider -q "http://192.168.0.1/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=1" wget --spider -q "http://127.0.0.1/cgi-bin/hisnet/setsceneauto.cgi?&-sceneauto=1" http://192.168.0.1/cgi-bin/hisnet/getwifi.cgi http://192.168.0.1/cgi-bin/hisnet/setworkmode.cgi?-workmode=NORM_REC http://192.168.0.1/cgi-bin/hisnet/getworkstate.cgi? http://192.168.0.1/cgi-bin/hisnet/workmodecmd.cgi?&-cmd=start /app/komod/usb2net_load.sh;ifconfig usb0 192.168.2.10 netmask 255.255.255.0;route add default gw 192.168.2.1 mount -t nfs -o nolock 192.168.2.150:/nfsroot /mntls -lht fd -h /mnt/gdbserver :1234 /mnt/main_app /mnt/gdbserver :1234 /app/bin/main_app ./xml2bin -b /hisi/sdk/reference/dashcam/modules/ui/carrecorder/higv/higv.bin -l /hisi/sdk/reference/dashcam/modules/ui/carrecorder/bin/ -x /hisi/sdk/reference/dashcam/modules/ui/carrecorder/xml/ -e /hisi/sdk/middleware/component/higv/tools/64bit_xml2bin/new -t c ./xml2bin -b ./ui3556/output/higv.bin -e ./ui3556/extcfile/ -t c -x ./ui3556/xml/ -l ./ui3556/output/
检测摄像头
1 2 3 4 5 virt-tty a7 cat proc/umap/mi pi_rx cat /proc/um ap/vi cat /proc/um ap/vpss cat /proc/um ap/venc
环境搭建
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 su - root su - pc sudo /etc/init.d/nfs-kernel-server start sudo ufw disable sudo apt-get install -y build-essential sudo apt-get install u-boot-tools 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 sudo apt-get install make libc6:i386 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools:i386 texinfo texlive gawk libssl-dev openssl bc sudo apt-get install bison flex dos2unix aptitude libpcap-dev gperf libuuid1:i386 u-boot-tools libpam0g-dev lib32z1-dev unzip sudo aptitude install libtool apt-get install build-essential u-boot-tools zlib1g-dev liblzo2-dev uuid-dev pkg-config make libc6 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools texinfo texlive gawk curl upx pngquant make libc6 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools texinfo texlive gawk libssl-dev openssl bc bison flex dos2unix aptitude libpcap-dev gperf libuuid1 libpam0g-dev lib32z1-dev apt-get install build-essential u-boot-tools zlib1g-dev liblzo2-dev uuid-dev pkg-config make libc6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools texinfo texlive gawk curl upx pngquant make libc6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools texinfo texlive gawk libssl-dev openssl bc bison flex dos2unix aptitude libpcap-dev gperf libuuid1 libpam0g-dev sudo aptitude install libtool susource ./arm-himix100-linux.install sudo gedit /etc/profileexport PATH="/opt/hisi-linux/x86-arm/arm-himix100-linux/bin:$PATH " export PKG_CONFIG_PATH="$PKG_CONFIG_PATH :/usr/lib/x86_64-linuxgnu/pkgconfig" top kill id 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
开启NFS 内核配置
首先 make all
,然后进入内核目录修改。
1 2 3 make ARCH=arm CROSS_COMPILE=arm-himix100-linux- menuconfig make ARCH=arm CROSS_COMPILE=arm-himix100-linux- uImage -j 20
使用
查看是否有nfs,有则配置成功
OpenSSH配置
相关资料
openssh移植及使用
移植openssh到arm-linux
HI3516DV300笔记(三)安装SSH和SFTP
全志A33 SSH移植配置(已成功)
命令
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 wget https://mirrors.tuna.tsinghua.edu.cn/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz --no-check-certificate wget https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz --no-check-certificate wget https://archive.fastgit.org/openssl/openssl/archive/refs/tags/OpenSSL_1_0_1t.tar.gz --no-check-certificate tar -zxvf zlib-1.2.11.tar.gz; tar -zxvf OpenSSL_1_0_1t.tar.gz; tar -zxvf openssh-6.1p1.tar.gz;cd ./openssl-OpenSSL_1_0_1t ./Configure --prefix=$PWD /_install os/compiler:arm-himix100-linux-gcc make -j20 make installcd ..cd ./zlib-1.2.11export CC=/opt/hisi-linux/x86-arm/arm-himix100-linux/bin/arm-himix100-linux-gcc ./configure --prefix=$PWD /_install --static make -j20 make installcd ..cd ./openssh-6.1p1export OPENSSHINSTALLPATH=/mnt/openssh ./configure --host=arm-himix100-linux --prefix=$OPENSSHINSTALLPATH --with-zlib=$PWD /../zlib-1.2.11/_install --with-ssl-dir=$PWD /../openssl-OpenSSL_1_0_1t/_install --with-libs --disable-etc-default-login --disable-strip CC=arm-himix100-linux-gcc AR=arm-himix100-linux-ar make -j20export TOPPATH=$PWD /../openssh_buildexport ROOTPATH=$TOPPATH /rootfsmkdir $ROOTPATH mkdir -p $ROOTPATH /binmkdir -p $ROOTPATH /sbinmkdir -p $ROOTPATH /usr/local/opensshmkdir -p $ROOTPATH /usr/local/libexecmkdir -p $ROOTPATH /usr/local/etcmkdir -p $ROOTPATH /usr/local/openssh/etcmkdir -p $ROOTPATH /usr/local/openssh/bincp scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan $ROOTPATH /usr/local/openssh/bincp sshd_config ssh_config $ROOTPATH /usr/local/openssh/etccp sshd $ROOTPATH /sbincp sftp-server ssh-keysign $ROOTPATH /usr/local/libexeccd $ROOTPATH /binln -s /usr/local/openssh/bin/scpln -s /usr/local/openssh/bin/sftpln -s /usr/local/openssh/bin/sshln -s /usr/local/openssh/bin/ssh-addln -s /usr/local/openssh/bin/ssh-agentln -s /usr/local/openssh/bin/ssh-keygenln -s /usr/local/openssh/bin/ssh-keyscancd $ROOTPATH cp $TOPPATH /sshd_config $ROOTPATH /usr/local/openssh/etccp $TOPPATH /openssh_install.sh $ROOTPATH tar -zcvf $TOPPATH /../openssh_build.tar.gz . tar -zxvf /openssh_build.tar.gzexport OPENSSHPATH=/export MNTPATH=/export SSHKEYGRNPATH=$OPENSSHPATH /usr/local/openssh/binmkdir $OPENSSHPATH /etccd $OPENSSHPATH /usr/local/etc$SSHKEYGRNPATH /ssh-keygen -t rsa -f ssh_host_rsa_key -N "" $SSHKEYGRNPATH /ssh-keygen -t dsa -f ssh_host_dsa_key -N "" $SSHKEYGRNPATH /ssh-keygen -t ecdsa -f ssh_host_ecdsa_key -N "" $SSHKEYGRNPATH /ssh-keygen -t dsa -f ssh_host_ed25519_key -N "" cp $OPENSSHPATH /usr/local/openssh/etc/sshd_config $OPENSSHPATH /etccp $OPENSSHPATH /usr/local/openssh/etc/ssh_config $OPENSSHPATH /etccp $OPENSSHPATH /usr/local/openssh/etc/ssh_config $OPENSSHPATH /etcmkdir -p /usr/local/etccp $OPENSSHPATH /usr/local/openssh/etc/ssh_config /usr/local/etcmkdir -p /var/run/sshdmkdir -p /var/emptycd /varchown root.root empty -R /sbin/sshd /mnt/openssh/sbin/sshd
此时文件目录为
压缩包文件结果如下
找到sshd_config修改如下:
1 2 3 4 5 6 7 8 9 10 11 HostKey /usr/ local/etc/ ssh_host_rsa_key HostKey /usr/ local/etc/ ssh_host_dsa_key HostKey /usr/ local/etc/ ssh_host_ecdsa_key PermitRootLogin yes PasswordAuthentication yes PermitEmptyPasswords yes Subsystem sftp internal-sftp UsePrivilegeSeparation no
ssh通过密钥无密码访问服务器时,尽管密钥配好了,端口服务启动都正常,但是还是ssh还是不能访问。最后发现,是密钥文件的权限问题,一般来说:
对.ssh目录设置700权限
对id_rsa,authorized_keys文件设置600权限
对id_rsa.pub,known_hosts文件设置644权限
所以,权限设置不对的话ssh登陆不上Linux系统
vscode 环境配置
资料
vscode连接SSH远程服务器(详细版)
手把手教windows10/linux ssh免密登录
VSCode远程SSH免密登录配置实现
VsCode + gdb + gdbserver远程调试C++程序
使用 VSCode 远程 图形化 GDB 调试 嵌入式linux
vscode 使用makefile 在线调试运行C/C++程序的方法
SD卡使用
1 2 3 4 # 加载驱动 /app/komod/mmc_load.sh# 挂载 mount /dev/mmcblk0p1 /mnt/sd
CLION
Using local makefile for CLion instead of CMake
Dealing with Makefile Projects in CLion: Status Update
CMAKE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 . 登录到 https:// cmake.org/download/ 2 . 下载 cmake-3.21 .0 -rc2.tar.gz wget https://gi thub.com/Kitware/ CMake/releases/ download/v3.21.0-rc2/ cmake-3.21 .0 -rc2.tar.gz3 . 解压 cmake-3.21 .0 -rc2.tar.gz tar -zxvf cmake-3.21 .0 -rc2.tar.gz 4 . 切换到 CMake 源目录并执行 bootstrap 脚本 cd cmake-3.21 .0 -rc2 ./bootstrap --parallel=32 5 . 执行 make make -j32 make install -j32 ln -s /usr/ local/bin/ cmake /usr/ bin/cmake6 . 查看 cmake 工具版本 cmake --version
问题 Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable
1 sudo apt install libssl-dev
提取CFLAGS
Remote Debug
海思3559万能平台搭建:在线调试1gdb+gdbserver
海思3559万能平台搭建:在线调试3VsCode插件
使用 VSCode 远程 图形化 GDB 调试 嵌入式linux
Hisi 使用GDB调试(远程调试)
GDB编译
1 2 3 4 5 6 7 # gdb sudo apt install libgmp-dev libexpat1-dev ./configure --target=arm-himix100-linux --prefix=/opt/gdb-12.1/ -v make -j8 make install sudo ln -s /opt/gdb-12.1/bin/arm-himix100-linux-gdb /opt/hisi-linux/x86-arm/arm-himix100-linux/bin/arm-himix100-linux-gdb# gdbserver
海思3556V200 PQTools 工具环境搭建
1 2 3 4 5 6 7 8 9 10 11 12 13 # usb 连接 192.168.2.10 这个ip是自己配置的 app/komod/usb2net_load.sh;ifconfig usb0 192.168.2.10 netmask 255.255.255.0;route add default gw 192.168.2.1# WIFI 连接192.168.0.1 cp -rf /app/bin/libs/libmpi.so /lib/ cp -rf /app/bin/libs/libsecurec.so /lib/ ifconfig lo up; wget --spider -q "http://192.168.2.10/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=1" wget --spider -q "http://192.168.2.10/cgi-bin/hisnet/setpqdebug.cgi?&-pqdebug=0"# rtsp地址 rtsp://IP:554/livestream/1
WSL开发环境
Windows10 WSL2搭建支持nfs的hi3518开发环境
关于wsl执行32位程序
wsl并不支持32位程序,wsl2才可以。需要安装几个基础库:
1 2 3 $ sudo dpkg --add-architecture i386 $ sudo apt-get update $ sudo apt-get install gcc-multilib
有了这几个库是前提,安装32位版本的程序或库的时候,要在最后添加:i386来指定架构。
可以通过Hyper-V管理器->虚拟交换机管理器,配置WSL2为外部网络,从而直接板端和WSL2通讯
添加reference/common库
reference/common目录下 make all
reference/dashcam/modules/init/amp/linux/Makefile 这里添加hiosd_client
1 2 3 4 COMM_LIBS := -ldevmng -lphotomng -lrecordmng -lusb \ -lstoragemng -lutils -lhilog -ltimedtask -ltimestamp -lmsg_client -lhicycle -lhiflash \ -lthttpd -lhisnet -lpowercontrol -lfiletrans -lliveserver -lplayback -lupgrade\ -lsharefs -lscene_client -lsystem -lqueue -lhiosd_client
HIOSD
middleware/ndk/sample/arch/common/sample_public_venc.c
middleware/ndk/sample/arch/common/loadbmp.c
问题
提示没有空间
无法在这个大型工作区文件夹中监视文件更改。请按照说明链接来解决此问题。
hi_gzip
问题解决:error: #error “Please port gnulib fseterr.c to your platform! Look at the definitions of ferror
从放弃到入门[二] 海思Hi3516EV200 SDK初体验
gdb调试symbol 'ps_lgetfpregs': can't resolve symbol
<<BSP FAQ.docx>>
1 2 3 4 5 $ file /hisi/demo/reference/dashcam/rootfs/rootfs/lib/libpthread-0.9.33.2.so /hisi/demo/reference/dashcam/rootfs/rootfs/lib/libpthread-0.9.33.2.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter ld-uClibc.so.0, stripped $ file /opt/hisi-linux/x86-arm/arm-himix100-linux/target/lib/a7_softfp_neon-vfpv4/libpthread-0.9.33.2.so /opt/hisi-linux/x86-arm/arm-himix100-linux/target/lib/a7_softfp_neon-vfpv4/libpthread-0.9.33.2.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter ld-uClibc.so.0, with debug_info, not stripped
not stripped
的动态库替换即可
改60fps
使用PQTools缺少动态库
使用标定工具前,请注意:工具利用了Matlab,因此需要用户预先安装MCR(MatlabCompiler Runtime)2012a(7.17)的32位版本。下载地址:
http://cn.mathworks.com/products/compiler/mcr/
分析
自启动
开发环境
动态库strip
SDK
uboot 启动三秒
osdrv/opensource/uboot/u-boot-2016.11/common/autoboot.c
wifi没开
reference/dashcam/modules/param/inicfg/hi3559v200/carrecorder/imx385_128M/config_product_devmng.ini
存储空间大小
menuconfig
HiGVBuilder生成二进制文件报错
在这个提示出现后,不要关掉,打开output文件夹,发现有如下文件:
将这些文件单独复制到一个新的文件夹,并把与HiGVBuilder.exe同目录的xml2bin.exe复制到新的文件内,这命令行运行该程序,即可正常生成。
屏幕排线修改
build\kconfig.mak
1 2 3 else ifeq ($(CONFIG_SCREEN_OLP039XGG0401), y) KCONFIG_CFLAGS += -DCONFIG_SCREEN_OLP039XGG0401 KCONFIG_CFLAGS += -DCONFIG_SCREEN_TYPE_LCD16BIT
amp\a7_liteos\mpp\init\sdk_init.c
1 2 3 4 void vo_24bit_lcd_mux (void ) int pinmux (void ) { vo_bt656_mode_mux(); }
reference\hal\screen\Kconfig
1 2 3 4 5 config SCREEN_OLP039XGG0401 bool "SCREEN_OLP039XGG0401_bt656" depends on (HI3559V200 || HI3556V200) && DEMB help A Small Screen use RGB Serail Transmission
reference\dashcam\modules\init\amp\liteos\src\hi_product_init_hi3559v200.c
1 static void Lcd_Pin_Mux (void )
VDP INTF_LCD_CTRL 0x1144D300
IO驱动能力要加大
注意事项
oled io驱动能力 大到小调试
ResImage
1 ./res2img.sh ../data/target/ ./reslist.txt ./resImage
注意reslist.txt 最后一行为回车