【板子申请】Ai-M61-32S开发环境搭建之天气站,还是个小白多多指教

[复制链接]
查看361 | 回复1 | 2023-11-17 21:48:35 | 显示全部楼层 |阅读模式
零基础搭建小安派Windows 开发环境
VS code 代码编辑器安装
ps: 安装步骤一直点下一步就行可以看出来我的版本以及型号
(base) PS F:\code> code.cmd -v   
1.79.1
4cb974a7aed77a74c7813bdccd99ee0d04901215
x64
插件的安装
打开vscode界面
ctrl + shift + X  在插件界面中搜索并安装以下以几个界面
  • Chinese (Simplified): 让vscode更得心应手
  • C/C++ 用来实现代码跳转
  • Doxygen Documentation Generator :快速注释(可选)
  • vscode-icons :文件名识别 icon,可以给各种文件自动标识出图标(可选)

git工具的安装
安装一样无脑操作就行 一直 next
以下是我的安装的版本
(base) PS F:\code> git -v
git version 2.41.0.windows.3
小安派原码克隆原码克隆
在你想要放置源码的位置点击 鼠标右键 选择 Open Git bash here 即可打开安装好的 git 工具。接着输入指令(可以复制运行):
Administrator@WIN-20230609WHN MINGW64 /f
$  git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git
Cloning into 'AiPi-Open-Kits'...
remote: Enumerating objects: 3580, done.
remote: Counting objects: 100% (3580/3580), done.
remote: Compressing objects: 100% (2130/2130), done.
remote: Total 3580 (delta 1676), reused 3173 (delta 1270), pack-reused 0
Receiving objects: 100% (3580/3580), 88.38 MiB | 13.54 MiB/s, done.
Resolving deltas: 100% (1676/1676), done.
Updating files: 100% (2597/2597), done.
(base)
这样就成功了
在你不能浏览github的情况下:
在拉取 SDK 之前,需要修改一下子模块的来源,不然可能会拉取失败。
编辑.gitmodules文件

[submodule "aithinker_Ai-M6X_SDK"]
    path = aithinker_Ai-M6X_SDK
    url = https://gitee.com/Ai-Thinker-Open/aithinker_Ai-M6X_SDK.git
    branch = release/AiPi_Eyes_SDK
ps:如果可以浏览就不用更改
拉取 M61 的 SDK 子模块
然后在 git 工具中分别执行:
Administrator@WIN-20230609WHN MINGW64 /f
$ cd AiPi-Open-Kits/
(base)
Administrator@WIN-20230609WHN MINGW64 /f/AiPi-Open-Kits (master)
$ git submodule init
(base)
Administrator@WIN-20230609WHN MINGW64 /f/AiPi-Open-Kits (master)
$ git submodule update
(base)拉取 M61 SDK 中的子模块
M61 SDK 是小安派仓库的子模块,而 M61 SDK 自己也有子模块,所以也需要拉取,否则会编译不成功。
进入到 SDK 中拉取子模块
逐条运行以下指令:
$ cd aithinker_Ai-M6X_SDK/
$ git submodule init
$ git submodule update适用 Windows 的编译工具链$ git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git
ps:  文件很大可能需要点时间
编译工具路径设置
首先确定工具链所在文件目录
我的文件路径 :F:\AiPi-Open-Kits\所有都拉取完成之后,需要把三个路径加入到电脑的环境变量当中,分别是:
F:\AiPi-Open-Kits\aithinker_Ai-M6X_SDK\toolchain_gcc_t-head_windows\bin
F:\AiPi-Open-Kits\aithinker_Ai-M6X_SDK\tools\make
F:\AiPi-Open-Kits\aithinker_Ai-M6X_SDK\tools\ninja

                               
登录/注册后可看大图

验证路径有没有配置好
C:\Users\Administrator> make -v
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.C:\Users\Administrator> riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=f:/aipi-open-kits/aithinker_ai-m6x_sdk/toolchain_gcc_t-head_windows/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper.exe
Target: riscv64-unknown-elf
Configured with: /mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/./source/riscv/riscv-gcc/configure --target=riscv64-unknown-elf --host=i686-w64-mingw32 --with-gmp=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/build-Xuantie-900-gcc-elf-newlib-mingw-V2.6.1/lib-for-gcc-mingw --with-mpfr=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/build-Xuantie-900-gcc-elf-newlib-mingw-V2.6.1/lib-for-gcc-mingw --with-mpc=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/build-Xuantie-900-gcc-elf-newlib-mingw-V2.6.1/lib-for-gcc-mingw --with-libexpat-prefix=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/build-Xuantie-900-gcc-elf-newlib-mingw-V2.6.1/lib-for-gcc-mingw --with-libmpfr-prefix=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/build-Xuantie-900-gcc-elf-newlib-mingw-V2.6.1/lib-for-gcc-mingw --with-pkgversion='Xuantie-900 elf newlib gcc Toolchain V2.6.1 B-20220906' CXXFLAGS='-g -O2 -DTHEAD_VERSION_NUMBER=2.6.1 ' --enable-libgcctf --prefix=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/Xuantie-900-gcc-elf-newlib-mingw-V2.6.1 --disable-shared --enable-threads=posix --enable-languages=c,c++ --without-system-zlib --enable-tls --with-newlib --with-sysroot=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/build-gcc-riscv64-unknown-elf/Xuantie-900-gcc-elf-newlib-mingw-V2.6.1/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/mnt/ssd/jenkins_iotsw/slave/workspace/Toolchain/build-gnu-riscv/./source/riscv/riscv-gcc --enable-multilib --with-abi=lp64d --with-arch=rv64gcxthead 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medany'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Xuantie-900 elf newlib gcc Toolchain V2.6.1 B-20220906)
编译天气站程序在 VScode 打开小安派仓库源码
打开 VScode。在 VScode 打开 AiPi-Open-Kits 文件夹,即可看到源码:
cd AiPi-Eyes_weather
make
成功结果提示

                               
登录/注册后可看大图

[21:25:55.035] - create XZ file:F:\AiPi-Open-Kits\AiPi-Eyes_weather\build\build_out\Eyes_bl616.xz
[21:25:55.569] - create XZ OTA file:F:\AiPi-Open-Kits\AiPi-Eyes_weather\build\build_out\Eyes_bl616.xz.ota
Built target combine烧录程序
确定com口
在桌面上找到 计算机 图标,然后鼠标右击,在出现的选项中找到 管理 选项,鼠标点击它


                               
登录/注册后可看大图


根据板子的要求进行烧录 ,com口的数字也不一定是一个定值
确定好了执行
make flash COMX=COMxx


162847hhi805icadrwcqc9.gif
QQ截图20231117212728.png
QQ截图20231117213228.png
回复

使用道具 举报

爱笑 | 2023-11-21 15:59:20 | 显示全部楼层
通过
用心做好保姆工作
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则