HiSpark Wi-Fi IoT小车上手之烧录出厂样例

系统 OpenHarmony
本篇带给大家HiSpark Wi-Fi IoT智能小车套件上手之烧录出厂样例,希望对你有所帮助!

​想了解更多内容,请访问:​

​51CTO和华为官方合作共建的鸿蒙技术社区​

​https://ost.51cto.com​

1.下载样例代码

①.gitee仓库地址

https://gitee.com/hihope_iot/hispark-pegasus-smart-car.git

②.克隆代码到本地

git clone https://gitee.com/hihope_iot/hispark-pegasus-smart-car.git

③.将样例代码拷贝到openharmony

目录:hispark-pegasus-smart-car\智能循迹避障小车样例代码\robot_demo 
拷贝到:openharmony\applications\sample\wifi-iot\app\

2.使能编译IIC驱动

目录:openharmony\device\hisilicon\hispark_pegasus\sdk_liteos\build\config\usr_config.mk。

找到这里
# CONFIG_FACTORY_TEST_SUPPORT is not set
# end of Factory Test Settings
#
# BSP Settings
#
CONFIG_I2C_SUPPORT=y 《《《打开编译IIC驱动,改成这样
# CONFIG_I2S_SUPPORT is not set
# CONFIG_SPI_SUPPORT is not set
# CONFIG_DMA_SUPPORT is not set
# CONFIG_SDIO_SUPPORT is not set
# CONFIG_SPI_DMA_SUPPORT is not set
# CONFIG_UART_DMA_SUPPORT is not set
CONFIG_PWM_SUPPORT=y
CONFIG_PWM_HOLD_AFTER_REBOOT=y
CONFIG_AT_SUPPORT=y
CONFIG_FILE_SYSTEM_SUPPORT=y
CONFIG_UART0_SUPPORT=y
CONFIG_UART1_SUPPORT=y
# CONFIG_UART2_SUPPORT is not set
# end of BSP Settings

3.把样例加入编译

目录:openharmony3\applications\sample\wifi-iot\app\BUILD.gn。

import("//build/lite/config/component/lite_component.gni")
lite_component("app") {
features = [
"robot_demo:robot_demo",
"robot_demo/ssd1306:oled_ssd1306",
]
}

注意:官方样例使用说明 https://gitee.com/hihope_iot/hispark-pegasus-smart-car 里面的 BUILD.gn 未将 oled_ssd1306 加入编译,不加入会报错。

4.编译样例

①.设置编译路径

hb set
.(英文字符)

复制②.选择wifiiot_hispark_pegasus

③.执行编译

hb build -f

5.烧录

①打开HiBurn烧录工具

②. 选择要烧录的文件

点击select fine
选择该路径:openharmony\out\hispark_pegasus\wifiiot_hispark_pegasus 下的Hi3861_loader_signed.bin和Hi3861_wifiiot_app_allinone.bin

复制

③.勾选上 Auto burn

④.烧录

点击Connect

⑤.开发板复位

开始烧录。

⑥.烧录完成,点击disconnect按钮

6.测试结果

测试成功!

7.报错解决

①.未使能驱动编译

报错提示:

[OHOS ERROR] riscv32-unknown-elf-ld: ohos/libs/libhal_iothardware.a(libhal_iothardware.hal_iot_i2c.o): in function `IoTI2cInit':
[OHOS ERROR] hal_iot_i2c.c:(.text.IoTI2cInit+0x10): undefined reference to `hi_i2c_init'

解决办法:

目录:openharmony\device\hisilicon\hispark_pegasus\sdk_liteos\build\config\usr_config.mk。

找到这里
# CONFIG_FACTORY_TEST_SUPPORT is not set
# end of Factory Test Settings
#
# BSP Settings
#
CONFIG_I2C_SUPPORT=y 《《《打开编译IIC驱动,改成这样
# CONFIG_I2S_SUPPORT is not set
# CONFIG_SPI_SUPPORT is not set
# CONFIG_DMA_SUPPORT is not set
# CONFIG_SDIO_SUPPORT is not set
# CONFIG_SPI_DMA_SUPPORT is not set
# CONFIG_UART_DMA_SUPPORT is not set
CONFIG_PWM_SUPPORT=y
CONFIG_PWM_HOLD_AFTER_REBOOT=y
CONFIG_AT_SUPPORT=y
CONFIG_FILE_SYSTEM_SUPPORT=y
CONFIG_UART0_SUPPORT=y
CONFIG_UART1_SUPPORT=y
# CONFIG_UART2_SUPPORT is not set
# end of BSP Settings

②.未加入编译

报错提示:

[OHOS ERROR] ssd1306_test.c:(.text.Ssd1306TestTask+0x3c): undefined reference to `ssd1306_Init'
[OHOS ERROR] riscv32-unknown-elf-ld: ssd1306_test.c:(.text.Ssd1306TestTask+0x46): undefined reference to `ssd1306_Fill'
[OHOS ERROR] riscv32-unknown-elf-ld: ssd1306_test.c:(.text.Ssd1306TestTask+0x52): undefined reference to `ssd1306_SetCursor'

解决办法:

目录:openharmony3\applications\sample\wifi-iot\app\BUILD.gn。

import("//build/lite/config/component/lite_component.gni")
lite_component("app") {
features = [
"robot_demo:robot_demo",
"robot_demo/ssd1306:oled_ssd1306",
]
}

③.HiSpark Wi-Fi IoT开发板上电没反应

可能原因:使用了双头Type-C数据线供电,导致无法供电,因为开发板没有受电端诱骗芯片。

​想了解更多内容,请访问:​

​51CTO和华为官方合作共建的鸿蒙技术社区​

​https://ost.51cto.com​

责任编辑:jianghua 来源: 鸿蒙社区
相关推荐

2020-10-19 10:31:44

HiSpark Wi-烧录固件

2020-10-30 17:57:11

鸿蒙HiSpark

2020-10-13 10:01:00

HiSpark Wi-开发板

2024-01-29 10:26:00

Wi-Fi

2020-10-23 09:50:15

HiSpark Wi-开发套件

2011-11-28 14:36:41

2020-10-15 09:53:55

iSpark Wi-F开发套件板

2020-10-20 09:32:43

HiSparkWi-FiIoT

2022-10-19 12:18:56

家庭智能设备Wi-Fi网络

2012-07-13 10:23:04

Wi-Fi

2016-01-13 10:45:57

Wi-FiHalow

2020-04-08 16:09:37

机器学习Wi-Fi网络

2018-03-29 16:34:05

Wi-Fi

2015-01-09 12:04:37

Wi-FiWi-Fi AwareCES2015

2020-12-07 11:28:02

Wi-FiWi-Fi 6

2018-10-11 14:45:53

Wi-Fi无线通信网络

2012-07-04 10:49:54

Wi-Fi

2018-02-27 16:12:30

Wi-Fi

2016-11-02 15:23:06

华为
点赞
收藏

51CTO技术栈公众号