本帖最后由 aniteipc 于 2023-11-21 02:07 编辑
一、软件安装
建议是使用到安信可官方 docs 下载:https://docs.ai-thinker.com/eyes
找到对应的软件进行下载
下载git和vscode
然后就是安装过程。。。
相信大家都是能够安装成功的,在下就过多赘述了直接上图
1、vscode安装
2、git安装
二、拉取源码
1、克隆源码
找给存放源码的位置点击 鼠标右键 选择 Open Git bash here 即可打开安装好的 git 工具。接着输入指令:
- <font size="1">git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git</font>
复制代码
2、修改拉取源
等待代码拉取完成后需要修改一下子模块的来源。进进入 AiPi-Open-Kits 中,用文本打开 .gitmodules 文件 url 参数中的 github.com 改成 gitee.com
3、拉取sdk 然后在 git 工具中分别执行: - cd AiPi-Open-Kits/
- git submodule init
- git submodule update
复制代码
4、拉取 M61 的 SDK 子模块
进入到 SDK 中拉取子模块
- cd aithinker_Ai-M6X_SDK/
- git submodule init
- git submodule update
复制代码
5、克隆适用 Windows 的编译工具链
- 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
复制代码四、测试 打开 PowerShell 。在 PowerShell中输入: 成功输出信息:
- 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:\Desktop\AiPi-Open-Kits\aithinker_Ai-M6X_SDK\toolchain_gcc_t-head_windows\bin\riscv64-unknown-elf-gcc.exeCOLLECT_LTO_WRAPPER=d:/desktop/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)
复制代码
2、编译测试
在vscode中打开AiPi-Open-Kits 文件夹AiPi-Eyes_weather 是天气站的源码,选中该文件之后,鼠标右键 选择 在集成终端中打开,然后在终端输入:
编译正常没有报错就可以了!!!
五、总结
总体来说没有什么难度,跟着搭建教程走基本没有什么问题,特别需要注意的是可能会有:
- Built target combine
- cp ./../aithinker_Ai-M6X_SDK/bsp/board/bl616dk/config/edata.bin build/build_out
- process_begin: CreateProcess(NULL, cp ./../aithinker_Ai-M6X_SDK/bsp/board/bl616dk/config/edata.bin build/build_out, ...) failed.
- make (e=2): 系统找不到指定的文件。
- make: *** [../aithinker_Ai-M6X_SDK/project.build:75: build] Error 2
- PS E:\bak\code\AiPi-Open-Kits\AiPi-Eyes_weather>
复制代码 这样的报错,只需要打开 /aithinker_Ai-M6X_SDK/project.build 文件,在 CP 指令前加#注释掉再进行编译就可以了
|