【板子申请】Ai-M61-32S开发环境搭建WINDOWS11-第一步

[复制链接]
查看391 | 回复1 | 2023-11-10 19:42:02 | 显示全部楼层 |阅读模式
本帖最后由 linxue110 于 2023-11-10 21:19 编辑

VS code 和 Git工具
均已经安装
小安派 源码工程 克隆1.克隆源码
WIN11新建文件夹,右击显示更多选项,进入GitBash
下载源码.png
2.拉取M61的SDK 子模块
  • 修改拉取来源
    进入AiPi-Open-Kits 中,用文本打开.gitmodules 文件url 参数中的 github.com 改成gitee.com
  • 拉取工具
  • [backcolor=rgba(27, 31, 35, 0.05)]cd AiPi-Open-Kits/
    git submodule init
    git submodule update
  • 更改源.png

3.拉取M61 SDK中的子模块
M61 SDK 是小安派仓库的子模块,而M61 SDK自己也有子模块,所以也需要拉取,否则会编译不成功。
1)进入到SDK中拉取子模块
逐条运行以下指令:
cd aithinker_Ai-M6X_SDK/git submodule initgit submodule update
  • 拉取子模块.png

2)克隆适用Windows 的编译工具链
就在aithinker_Ai-M6X_SDK/文件夹中拉取工具链,直接适用git 工具拉取:
git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git


三、编译工具路径设置
所有都拉取完成之后,需要把三个路径加入到电脑的环境变量当中,分别是:
aithinker_Ai-M6X_SDK\toolchain_gcc_t-head_windows\bin
aithinker_Ai-M6X_SDK\tools\make
aithinker_Ai-M6X_SDK\tools\ninja
而且需要把aithinker_Ai-M6X_SDK\tools\make路径上移到最高层,先打开电脑的环境变量窗口:

4.验证是否成功设置
在桌面按住 shift 键点击鼠标右键打开PowerShell 。在PowerShell 输入:
make -v
成功输出信息:
GNU Make 4.2.1Built for x86_64-w64-mingw32Copyright (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.
输入:
riscv64-unknown-elf-gcc -v
成功时输出信息:
Using built-in specs.COLLECT_GCC=D:\ai_pi\AiPi-Open-Kits\aithinker_Ai-M6X_SDK\toolchain_gcc_t-head_windows\bin\riscv64-unknown-elf-gcc.exeCOLLECT_LTO_WRAPPER=d:/ai_pi/aipi-open-kits/aithinker_ai-m6x_sdk/toolchain_gcc_t-head_windows/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper.exeTarget: riscv64-unknown-elfConfigured 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: posixSupported LTO compression algorithms: zlib zstdgcc version 10.2.0 (Xuantie-900 elf newlib gcc Toolchain V2.6.1 B-20220906)



四、编译天气站程序1.在VScode 打开小安派仓库源码
打开 VScode。在VScode 打开AiPi-Open-Kits 文件夹,即可看到源码
vscode打开程序.png
make 回车,等待编译完成
生成成功.png


回复

使用道具 举报

妖猊 | 2023-11-10 22:19:46 | 显示全部楼层
插个眼给七哥看
回复 支持 反对

使用道具 举报

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

本版积分规则