【鸿蒙IPC开发板开发板体验】编译才是灵魂,也是踩坑的开始 - HarmonyOS技术社区 - 电子技术论坛 - 广受欢迎的专业电子论坛
分享 收藏 返回

云司机 关注 私信
[文章]

【鸿蒙IPC开发板开发板体验】编译才是灵魂,也是踩坑的开始

完成第一步后,进入了第二步编译,正式开始了不断试错,

image.png

以上是我下载的源码版本

Target: riscv32-unknown-elf

Configured with: ../riscv-gcc/configure --prefix=/home/yuanwenhong/gcc_compiler_riscv/gcc_riscv32/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' CXXFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' LDFLAGS=-Wl,-z,relro,-z,now,-z,noexecstack 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' --with-headers=/home/yuanwenhong/gcc_compiler_riscv/gcc_riscv32/gcc-riscv32/riscv32-unknown-elf/include --with-mpc=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2

Thread model: single

gcc version 7.3.0 (GCC)
image.png
可以通过各种代码仓库下载源码,自有搭建

@ubuntu:~$ npm install -g @ohos/hpm-cli

npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

npm WARN deprecated @babel/polyfill@7.4.4: ��� This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.

npm WARN checkPermissions Missing write access to /usr/lib/node_modules

image.png

踩过一些坑之后 找到了官方 ,官方不建议 在 老的代码上进行开发

1 warning generated.

conformance/interfaces/timer_settime/2-1 compile PASSED

conformance/interfaces/timer_settime/8-3 compile PASSED

conformance/interfaces/timer_settime/3-2 compile PASSED

conformance/interfaces/timer_settime/3-1 compile PASSED

conformance/interfaces/timer_settime/5-3 compile PASSED

conformance/interfaces/timer_settime/13-1 compile PASSED

conformance/interfaces/timer_settime/8-2 compile PASSED

../../../conformance/interfaces/timer_settime/1-2.c:91:7: warning: absolute valu e function 'labs' given an argument of type 'long long' but has parameter of typ e 'long' which may cause truncation of value [-Wabsolute-value]

if (labs(tsleft.tv_sec - SLEEPDELTA) > ACCEPTABLEDELTA) {

                ^

../../../conformance/interfaces/timer_settime/1-2.c:91:7: note: use function 'll abs' instead

if (labs(tsleft.tv_sec - SLEEPDELTA) > ACCEPTABLEDELTA) {

                ^~~~

                llabs

1 warning generated.

conformance/interfaces/timer_settime/9-1 compile PASSED

conformance/interfaces/timer_settime/1-2 compile PASSED

conformance/interfaces/timer_settime/3-3 compile PASSED

make[2]: Entering directory '/home/compile/harmonyos/openharmony/third_party/ltp /testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative '

conformance/interfaces/timer_settime/speculative/12-1 compile PASSED

conformance/interfaces/timer_settime/speculative/12-3 compile PASSED

conformance/interfaces/timer_settime/speculative/12-2 compile PASSED

make[2]: Leaving directory '/home/compile/harmonyos/openharmony/third_party/ltp/ testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative'

make[1]: Leaving directory '/home/compile/harmonyos/openharmony/third_party/ltp/ testcases/open_posix_testsuite/conformance/interfaces/timer_settime'

make: Leaving directory '/home/compile/harmonyos/openharmony/third_party/ltp/tes tcases/open_posix_testsuite/conformance/interfaces'

[1012/1022] STAMP obj/test/xts/acts/open_posix_testsuite/conformance/interfaces/ prebuild_ActsOpenPosixTest.stamp

[1013/1022] ACTION //test/xts/acts/open_posix_testsuite/conformance/interfaces:A ctsOpenPosixTest(//build/lite/toolchain:linux_x86_64_clang)

[1014/1022] STAMP obj/test/xts/acts/open_posix_testsuite/conformance/interfaces/ ActsOpenPosixTest.stamp

[1015/1022] STAMP obj/test/xts/acts/acts_compoment.stamp

[1016/1022] COPY bin/query.bin suites/acts/resource/tools/query.bin

[1017/1022] STAMP obj/test/xts/acts/query_copy.stamp

[1018/1022] ACTION //test/xts/acts:acts(//build/lite/toolchain:linux_x86_64_clan g)

[1019/1022] STAMP obj/test/xts/acts/acts.stamp

[1020/1022] STAMP obj/build/lite/ohos.stamp

[1021/1022] ACTION //build/lite:gen_rootfs(//build/lite/toolchain:linux_x86_64_c lang)
image.png

[1022/1022] STAMP obj/build/lite/gen_rootfs.stamp

ohos ipcamera_hi3518ev300 build success!

image.png

来之不易的success

image.png

外国的大美女大软件,按照操作就行,简单上手

开始烧录

等待boot启动超时,单板上无fastboot或当前fastboot无法启动

当前fastboot分区选择的Flash类型与实际的fastboot不匹配,

当前单板boot分区的Flash类型为spi

hisilicon #

hisilicon #

hisilicon # setenv bootcmd "sf probe 0;sf read 0x40000000 0x100000 0x600000;go 0x40000000";

hisilicon # setenv bootargs "console=ttyAMA0,115200n8 root=flash fstype=jffs2 rw rootaddr=6M rootsize=7M";

hisilicon # saveenv

Saving Environment to SPI Flash... Erasing SPI flash...Writing to SPI flash...done

OK

hisilicon # reset

resetting ...

System startup

Uncompress Ok!

U-Boot 2020.01 (Sep 02 2020 - 17:34:02 +0800)hi3518ev300

DRAM: SPI Nor: hifmc_ip_ver_check(54): Check Flash Memory Controller v100 ...hifmc_ip_ver_check(60): Found

hifmc_spi_nor_probe(2070): SPI Nor ID Table Version 1.0

hifmc_spi_nor_probe(2095): SPI Nor(cs 0) ID: 0x20 0x70 0x18

hifmc_init_print(2016): Block:64KB hifmc_init_print(2017): Chip:16MB hifmc_init_print(2018): Name:"XM25QH128A"

hifmc100_spi_nor_probe(145): SPI Nor total size: 16MB

NAND: 0 MiB

Loading Environment from SPI Flash... OK

In: serial

Out: serial

Err: serial

Net: eth0

Error: eth0 address not set.

Hit any key to stop autoboot: 0

device 0 offset 0x100000, size 0x600000

SF: 6291456 bytes @ 0x100000 Read: OK

Starting application at 0x40000000 ...

Welcome

Processor : Cortex-A7

Run Mode : UP

GIC Rev : GICv2

build time : Sep 18 2022 12:48:15

Kernel : Huawei LiteOS 2.0.0.35/debug


main core booting up...

cpu 0 entering scheduler

random dev init ...

proc fs init ...

Mount procfs finished.

MMC dev init ...[ERR]No console dev used.

[ERR]No console dev used.

mem dev init ...

spi nor flash init ...

Spi Nor ID:0x20 0x70 0x18 0x20 0x70 0x18 0x20 0x70

Spi Nor Flash Info:

Name:"XM25QH128A" Size:16MB Block:64KB

spinor_init ...

net init ...

tcpip_init start

tcpip_init end

Ethernet start.hisi_eth: User did not set phy mode, use default=rmii

hisi_eth: User did not set phy addr, auto scan...

Can't find PHY device - id: 0

netif_is_link_up overtime!


usb init ...

******** usb_init in **********

usb v3.05 2019-11-20 10:40

[ERR]controller type 1 dtype 2 is error

******** usb_init fail**********

Date:Sep 18 2022.

Time:12:50:03.

OsMountRootfs start ...

OsMountRootfs end ...

DeviceManagerStart start ...

FUNC:parse_sensor_clock line:123 SNS: is [f23]!

FUNC:parse_sensor_bus_type line:85 SNS is [f23] !

==== online_flag=0, cmos_yuv_flag=0, sensor=f23, chip=hi3518ev300, board=demo====

==== g_quick_start_flag=0 ====

sysconfig init success!

g_mmz_start=0x42000000, g_mmz_size=0x20

mmz param= anonymous,0,0x42000000,32M

<6>Hisilicon Media Memory Zone Manager

Load hifb.ko OK!

[VERSION]:Hi3881V100R001C00SPC020 2020-08-20 17:10:00

oam_main_init SUCCESSFULLY!

wal_customize_init SUCCESSFULLY!

oal_main_init SUCCESSFULLY

frw_main_init SUCCESSFULLY!

hi_wifi_plat_init SUCCESSFULLY

hcc_hmac_init SUCCESSFULLY

[7025][W:1524]Hi3881 VERSION:: [Hi3881V100]

plat_firmware_init SUCCESSFULLY

[7028][W:209]sdio max transmit size is [32768]

[7032][W:580]HI_SUCCESS: Device Version=[Hi3881V100], CfgVersion=[Hi3881V100].

[7162][W:116]wlan_power_on:: firmware download success

Device is Ready!

wlan_pm_open SUCCESSFULLY!!

[7170][W:63]{hmac_wow_set_host_state::state[0]->[1]!}

[7173][W:1008]hmac_wow_set_dmac_cfg, flag[0], wow_event[0x1F]

get rates from device

hmac_main_init SUCCESSULLY

[7184][W:132]wal_set_dev_addr:: mac from efuse is zero!

[7188][W:1301]{wal_get_efuse_mac_from_dev::set dev_addr fail!}

[7194][W:367]{mac_user_set_key::keytpe==1, ciphertype==3, keyid==0, usridx==0}

[7201][W:1148]{hmac_config_add_vap::add vap [1] success! vap_id is 1

wal_main_init SUCCESSFULLY

hi_wifi_host_init SUCCESSFULLY

WiFi driver init SUCCESSFULLvirtual_serial_init end ...

system_console_init end ...

CatLogShell start ...

CatLogShell start ...

OsUserInitProcess start ...

OsUserInitProcess end ...

[Init] ////OpenHarmony///3/OpenHarmony 1.0/debug

[Init] InitReadCfg, parse failed! please check file /etc/init.cfg format.

[Init] main, entering wait.


最后顺利启动了 hi_wifi_host_init SUCCESSFULLY

WiFi driver init SUCCESSFULLvirtual_serial_init end ...

但是 怎么和 手机 联动 依旧是个 问题 ,希望 有大神前来解答

更多回帖

×
发帖