【开发板漂流计划】HiSpark Wi-Fi IoT小车上手之烧录出厂样例 原创 精华

yukoyu
发布于 2022-4-10 02:11
浏览
3收藏

【开发板漂流计划】 HiSpark Wi-Fi IoT智能小车套件上手之烧录出厂样例

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

【开发板漂流计划】HiSpark Wi-Fi IoT小车上手之烧录出厂样例-鸿蒙开发者社区

③.勾选上 Auto burn
④.烧录
点击Connect
⑤.开发板复位

开始烧录

【开发板漂流计划】HiSpark Wi-Fi IoT小车上手之烧录出厂样例-鸿蒙开发者社区

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

6.测试结果

测试成功!

【开发板漂流计划】HiSpark Wi-Fi IoT小车上手之烧录出厂样例-鸿蒙开发者社区

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'

【开发板漂流计划】HiSpark Wi-Fi IoT小车上手之烧录出厂样例-鸿蒙开发者社区

解决办法:

目录: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'

【开发板漂流计划】HiSpark Wi-Fi IoT小车上手之烧录出厂样例-鸿蒙开发者社区

解决办法:

目录: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数据线供电,导致无法供电,因为开发板没有受电端诱骗芯片。

©著作权归作者所有,如需转载,请注明出处,否则将追究法律责任
robot_demo.zip 22.49K 25次下载
已于2022-4-10 02:11:56修改
5
收藏 3
回复
举报
1条回复
按时间正序
/
按时间倒序
红叶亦知秋
红叶亦知秋

非常详细的烧录讲解,感谢分享。

回复
2022-4-11 11:54:49
回复
    相关推荐