终于开始搞了。上来就报错。
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`