本帖最后由 cuilingji 于 2023-11-15 22:28 编辑
以下是按照教程搭建的编译环境。
1. vscode的安装
原已安装
接下来安装推荐插件:1.C/C++ :用来实现代码跳转
2.Doxygen Documentation Generator :快速注释插件
3.vscode-icons :文件名识别 icon,可以给各种文件自动标识出图标
2. git
原已安装
3. 安装源码
3.1 克隆小安派的 SDK :
git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git
3.2 拉取 M61 的 SDK 子模块
进入 AiPi-Open-Kits 中,用文本打开 .gitmodules 文件 url 参数中的 github.com 改成 gitee.com
cd AiPi-Open-Kits/
git submodule init
git submodule update
cd aithinker_Ai-M6X_SDK/
git submodule init
git submodule update
git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git
下载速度还挺快的。
4. 添加环境变量
验证一下
在桌面按住 shift 键点击 鼠标右键 打开 PowerShell 。在 PowerShell 输入:
make -v
riscv64-unknown-elf-gcc -v
成功输出信息,环境看起来没问题。
5. 打开代码,然后编译,编译完成。
打开 VScode。在 VScode 打开 AiPi-Open-Kits 文件夹,即可看到源码:
AiPi-Eyes_weather 是天气站的源码,选中该文件之后,鼠标右键 选择 在集成终端中打开,然后在终端输入:
执行:make
|