鸿蒙wifiiot编译问题解决

终于开始搞了。上来就报错。

rm/system -Lbuild/build_tmp/scripts -Lbuild/libs -Lbuild/libs/hi3861/release/no_mesh -Lbuild/scripts -Lohos/libs -Tbuild/build_tmp/scripts/link.lds -Map=output/bin/Hi3861_wifiiot_app.map -o output/bin/Hi3861_wifiiot_app.out --start-group --no-whole-archive --whole-archive -lHwKeystoreSDK -ladc -lat -lauthmanager -lbootstrap -lbroadcast -lc_flash -lcfg -lcjson_static -lcmsis -lcommon_lite -lcpup -ldiag -ldiscovery -ldrv -lflash -lgcc -lgpio -lhal_file_static -lhal_iothardware -lhal_sysparam -lhal_token_static -lhichainsdk -lhilog_lite -lhiview_lite -lio -liothardware -liperf -lkal -lled_example -llitekernel_flash -lltoswpa -llwip -lm_flash -lmbedtls -lnative_file -lparttab -lres_cfg -lsamgr -lsamgr_adapter -lsamgr_source -lsdio -lsec_flash -lsensing_demo -lspiffs -lsysparam -lsystem -ltoken_static -ltrans_service -ltsensor -luart -lupg -lutils_kv_store -lwifi -lwifi_flash -lwifiiot_app -lwifiservice -lwpa --end-group
riscv32-unknown-elf-ld: ohos/libs/libhal_iothardware.a(hal_wifiiot_i2c.o): in function `.L0 ':
hal_wifiiot_i2c.c:(.text.HalI2cWrite+0x12): undefined reference to `hi_i2c_write'
riscv32-unknown-elf-ld: hal_wifiiot_i2c.c:(.text.HalI2cRead+0x12): undefined reference to `hi_i2c_read'
riscv32-unknown-elf-ld: hal_wifiiot_i2c.c:(.text.HalI2cInit+0x12): undefined reference to `hi_i2c_init'
riscv32-unknown-elf-ld: ohos/libs/libhal_iothardware.a(hal_wifiiot_pwm.o): in function `.L0 ':
hal_wifiiot_pwm.c:(.text.HalPwmInit+0x16): undefined reference to `hi_pwm_set_clock'
riscv32-unknown-elf-ld: hal_wifiiot_pwm.c:(.text.HalPwmInit+0x24): undefined reference to `hi_pwm_init'
riscv32-unknown-elf-ld: hal_wifiiot_pwm.c:(.text.HalPwmStart+0x12): undefined reference to `hi_pwm_start'
riscv32-unknown-elf-ld: hal_wifiiot_pwm.c:(.text.HalPwmStop+0x12): undefined reference to `hi_pwm_stop'
scons: *** [output/bin/Hi3861_wifiiot_app.out] Error 1
BUILD FAILED!!!!
Failed building output/bin/Hi3861_wifiiot_app.out: Error 1
Traceback (most recent call last):
  File "../../build/lite/build_ext_components.py", line 64, in <module>
    sys.exit(main())
  File "../../build/lite/build_ext_components.py", line 58, in main
    cmd_exec(args.command)
  File "../../build/lite/build_ext_components.py", line 32, in cmd_exec
    raise Exception("{} failed, return code is {}".format(cmd, ret_code))
Exception: ['sh', 'hm_build.sh'] failed, return code is 2
ninja: build stopped: subcommand failed.
you can check build log in /home/tony/homo/out/wifiiot/build.log
/home/tony/homo/tools/ninja/ninja -w dupbuild=warn -C /home/tony/homo/out/wifiiot failed, return code is 1
usage: 
 

解决方法:

1. 编译过程中报错:undefined reference to `hi_pwm_init` 等几个 `hi_pwm_`开头的函数,
   * **原因:** 因为默认情况下,hi3861_sdk中,PWM的CONFIG选项没有打开
   * **解决:** 修改`vendor\hisi\hi3861\hi3861\build\config\usr_config.mk`文件中的`CONFIG_PWM_SUPPORT`行:
     * `# CONFIG_PWM_SUPPORT is not set`修改为`CONFIG_PWM_SUPPORT=y`

2. 编译过程中报错:undefined reference to `hi_i2c_init` 等几个 `hi_i2c_`开头的函数,

   * **原因:** 因为默认情况下,hi3861_sdk中,I2C的CONFIG选项没有打开

   * **解决:** 修改`vendor\hisi\hi3861\hi3861\build\config\usr_config.mk`文件中的`CONFIG_I2C_SUPPORT`行:
     * `# CONFIG_I2C_SUPPORT is not set`修改为`CONFIG_I2C_SUPPORT=y`
 

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

九世坛主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值