[i=s] 本帖最后由 hdydy 于 2025-5-4 11:37 编辑 [/i]
bl602支持OpenHarmony轻量系统,想体验一下的可以试试,不过官方仓库很久没有更新了

安装WSL2
https://learn.microsoft.com/zh-cn/windows/wsl/install
https://documentation.ubuntu.com/wsl/en/stable/howto/install-ubuntu-wsl2/

安装git,generate-ninja
sudo apt install git generate-ninja
安装python环境
miniconda:https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
激活python环境
conda activate base
获取轻量系统源码
git clone --depth=1 https://gitee.com/bouffalolab/device_bouffalolab.git
仓库里面包含toolchain

安装hb
参考文档 build/lite/README_zh.md
cd device_bouffalolab
pip install build/lite

查看hb帮助 hb -h

如果提示 ImportError: cannot import name 'style_from_dict' from 'prompt_toolkit.styles'
,需要安装1.0.14版本的prompt_toolkit,pip install prompt_toolkit==1.0.14


如果提示 ImportError: cannot import name 'Mapping' from 'collections'
,需要将 miniconda3/lib/python3.12/site-packages/prompt_toolkit/styles/from_dict.py
第9行代码 from collections import Mapping
替换为 from collections.abc import Mapping


编译
将toolchain路径添加进PATH
export PATH=~/device_bouffalolab/device/bouffalo/bl602/bl_iot_sdk/toolchain/riscv/gcc_riscv32/bin:$PATH
设置编译项目 hb set
提示 Input code path
,先回车,然后选择 bl602_wifiModule@bouffalo

查看编译帮助 hb build -h

编译 hb build -b release -f -c gcc
输出文件目录 out/bl602/bl602_wifiModule

参考链接
https://bbs.elecfans.com/jishu_2186884_1_1.html