近期在做一个类似ipcamera需求产品的技术选型,所以买了一块海思ipcamera的板子,难道板子后,使用上碰到了一些问题,毕竟是一个新平台,所以需要足够的耐心,不然过程中经常出现的卡壳问题,放一放就想明白了,好事多磨难,重要是不能放弃!
环境搭建参考:https://ost.51cto.com/posts/2627
1、程序烧录,最开始总是烧录失败,后来确定是HiTool.exe的版本不一样,烧录不上,一定要找与开发板配套的Hitool版本!
分区表文件,这个需要跟芯片的flash大小对应上:
<?xml?version="1.0"?encoding="GB2312"??>
<Partition_Info?ProgrammerFile="">
<Part?Sel="1"?PartitionName="fastboot"?FlashType="spi"?FileSystem="none"?Start="0"?Length="1M"?SelectFile="u-boot-hi3518ev300.bin"/>
<Part?Sel="1"?PartitionName="kernel"?FlashType="spi"?FileSystem="none"?Start="1M"?Length="6M"???SelectFile="OHOS_Image.bin"/>
<Part?Sel="1"?PartitionName="rootfs"?FlashType="spi"?FileSystem="none"?Start="7M"?Length="8M"?SelectFile="rootfs.img"/>??
<Part?Sel="1"?PartitionName="userfs"?FlashType="spi"?FileSystem="none"?Start="15M"?Length="1M"?SelectFile="userfs.img"/>??
</Partition_Info>
串口fastboot擦除,根据提示上电单板(已上电状态需要重新下电后再上电)
USB口程序烧写
启动uboot参数配置:
2、编译环境搭建;
参考:https://www.bookstack.cn/read/openharmony-1.0-zh-cn/quick-start-%E6%90%AD%E5%BB%BA%E7%8E%AF%E5%A2%83-2.md
用虚拟机,按照文档每一步操作,环境搭建起来还比较顺利,并没有碰到特别的问题!
3、文档支持;
https://www.bookstack.cn/read/openharmony-1.0-zh-cn/
4、生态及问题解决;
学习入门资料不少,像harmonyos基金会推出的视频,认真学习,可以很快熟悉liteos的架构;
以下三个问题只能逐步摸索解决了,互联网上碰到类似问题的解决思路还不是很多,光靠baidu解决还比较难!
SD卡自动启动挂载失败,手动挂载成功:
[Init]?****/****/****/****/OpenHarmony/****/****/3/OpenHarmony?1.0/debug
[ERR]Failed?to?find?block?driver?/dev/mmcblk0
[Init]?DoMount,?failed?for?vfat?/dev/mmcblk0?/sdcard?rw,umask=000,?err?-1.
[ERR]Failed?to?find?block?driver?/dev/mmcblk1
[Init]?DoMount,?failed?for?vfat?/dev/mmcblk1?/sdcard?rw,umask=000,?err?-1.
[Init]?start?service?shell?succeed,?pid?3.
OHOS?#[Init]?start?service?apphilogcat?succeed,?pid?4.
[ERR]vfs_jffs_ioctl?NOT?SUPPORT
[ERR]vfs_jffs_ioctl?NOT?SUPPORT
“mount?-t?vfat?/dev/mmcblk0?/mnt”?失败
“mount?-t?vfat?/dev/mmcblk0p1?/mnt”?成功
OHOS?#mount?-t?vfat?/dev/mmcblk0p1?/sdcard
[ERR]Failed?to?find?file?system?/sdcard
mount?error:?No?such?device
OHOS?#disk_init?:?register?/dev/mmcblk0?ok!
DiskAddPart?:?register?/dev/mmcblk0p0?ok!
OHOS?#mount?/dev/mmcblk0p0?/sdcard?vfat
mount?ok
wifi初始化配置;
[DISCOVERY]?ioctl?fail
[DISCOVERY]?fail?to?get?eth?Ip,?tring?to?get?wifi?Ip.
01-01?00:00:12.800?6?29?I?01800/Samgr:?Goto?next?boot?step?failed!?errno:-9
01-01?00:00:12.835?5?23?I?01800/Samgr:?Create?proxy[0x26514db0]<bundle_daemon,?(null),?30,?0>
01-01?00:00:12.835?6?29?I?01100/bundle_deamon:?BundleDaemon::Invoke(102):?bundle_daemon?invoke?start?8[DISCOVERY]?ioctl?fail
[DISCOVERY]?fail?to?get?eth?Ip,?tring?to?get?wifi?Ip.
01-01?00:00:12.838?5?23?E?00000/(null):?ScanSharedLibPath?GetBundleInfos?is?error
01-01?00:00:12.838?5?22?D?01300/abilityms:?AbilityMgrHandler::OnServiceInited(122):?start
[ERR]vfs_jffs_ioctl?NOT?SUPPORT
音频播放失败;
camera摄像头拍照和录制的视频偏绿;
其他:
1、应用路径
D:\source\harmony\harmonyos_1.0\build\lite\product\ipcamera_hi3518ev300.json:
???17????????"name":?"applications",
???18????????"component":?[
???19:?????????{?"name":?"camera",?"dir":?"//applications/sample/camera/app:camera_app",?"features":[]?},
???20??????????{?"name":?"communication",?"dir":?"//applications/sample/camera/communication:sample",?"features":[]?}
???21????????]
???
D:\source\harmony\harmonyos_1.0\build\lite\platform\hi3518ev300_liteos_a\platform.json:
??205??????????????"optional":?"true",
??206??????????????"targets":?[
??207:???????????????"//applications/sample/camera/app:camera_app",
??208????????????????"//applications/sample/camera/communication:sample"
??209??????????????],
2、修改shell提示符
???D:\source\harmony\harmonyos_1.0\kernel\liteos_a\apps\shell\include\shmsg.h:
???53??#define?COLOR_RED??????"\e[0;31m"
???54??#define?COLOR_L_RED????"\e[1;31m"
???55:?#define?SHELL_PROMPT???COLOR_L_RED"OHOS?#?"COLOR_NONE
???56??
???57??typedef?void?(*OutputFunc)(const?char?*fmt,?...);
碰到的问题真不少,一个一个的解决吧!