1.安装VSCODE
安装vscode并且安装中文插件
![image-20231110183312120.png image-20231110183312120.png](data/attachment/forum/202311/10/211124dqk2h8yd6faqfl8q.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
2.安装git工具
发布页:Releases · git-for-windows/git · GitHub
https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/Git-2.41.0.3-64-bit.exe
3.克隆源码
克隆源码
git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git
子模块aithinker_Ai-M6X_SDK更新
将AiPi-Open-Kits
下面的.gitmodules
文件中github替换成gitee。
然后执行
cd aithinker_Ai-M6X_SDK/
git submodule init
git submodule update
aithinker_Ai-M6X_SDK 拉取的时间可能会比较久
![image-20231110191154063.png image-20231110191154063.png](data/attachment/forum/202311/10/211204hl5svo494lgv9lld.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
aithinker_Ai-M6X_SDK的子模块更新
进入到aithinker_Ai-M6X_SDK
文件夹中在git中执行:
git submodule init
git submodule update
两个模块的拉取也需要等一会儿
![image-20231110191547726.png image-20231110191547726.png](data/attachment/forum/202311/10/211230thy26nni9oi014j6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
克隆编译工具栏
在aithinker_Ai-M6X_SDK
打开git
git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git
![image-20231110191843078.png image-20231110191843078.png](data/attachment/forum/202311/10/211302o33ymvylpvmgfcqf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
4.添加环境变量
将以下变量加入电脑环境变量:
aithinker_Ai-M6X_SDK\toolchain_gcc_t-head_windows\bin
aithinker_Ai-M6X_SDK\tools\make
aithinker_Ai-M6X_SDK\tools\ninja
以自己实际绝对路径为主
![image-20231110211912450.png image-20231110211912450.png](data/attachment/forum/202311/10/211928p89emp1mvppz8ehr.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
验证
make -v
riscv64-unknown-elf-gcc -v
![image-20231110192508195.png image-20231110192508195.png](data/attachment/forum/202311/10/211337cs8gddd7dy18vu7s.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
成功
5.编译天气站程序
进入AiPi-Open-Kits
下的AiPi-Eyes_weather
文件夹
打开CMD,输入make
然后等待编译过程:
![image-20231110194249936.png image-20231110194249936.png](data/attachment/forum/202311/10/211357zg6fgsw68gmqh6sm.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
成功了、吗?
看起来是最后将完成的edata.bin文件从aithinker_Ai-M6X_SDK文件价下拷贝到当前的build文件夹下出了问题
cp命令换成copy
1.确认edata.bin文件确实是存在的:
![image-20231110194521534.png image-20231110194521534.png](data/attachment/forum/202311/10/211521p7cflmdxz8e87ll5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
2.确认一下AiPi-Eyes_weather
模块的Makefile
文件
![image-20231110194652844.png image-20231110194652844.png](data/attachment/forum/202311/10/211532oyrrmj3s6ksvggkm.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
实际上指向是aithinker_Ai-M6X_SDK文件下面的project.build
![image-20231110202834447.png image-20231110202834447.png](data/attachment/forum/202311/10/211543aavqj3qvi8mv88v7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
CMD不支持cp命令,所以这里要改成copy命令;其次要使用反斜杠(\)而不是正斜杠(/)作为路径分隔符。比如:
copy /y a.txt .\to
# 将 a.txt 文件复制到 to文件夹下面,/y 代表强制覆盖
那么暂时就这么改:
![image-20231110205543601.png image-20231110205543601.png](data/attachment/forum/202311/10/211613hsntkzi0tddc2u5c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
然后再make:
![image-20231110205712751.png image-20231110205712751.png](data/attachment/forum/202311/10/211620li1i1ce1ul1le7f7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/300)
完成