本帖最后由 glm 于 2023-11-16 12:08 编辑
1.去vscode官网下载vscode,Visual Studio Code - Code Editing. Redefined,安装方法可以参考网上教程。
2.去GIt官网下载git,Git (git-scm.com),安装方法可以参考网上教程。
3.开始克隆。
找到合适的位置打开命令终端,然后输入以下命令
- git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git
复制代码 等待clone完成
- 正克隆到 '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 1675), reused 3174 (delta 1270), pack-reused 0
- 接收对象中: 100% (3580/3580), 88.38 MiB | 194.00 KiB/s, 完成.
- 处理 delta 中: 100% (1675/1675), 完成.
- 正在更新文件: 100% (2597/2597), 完成.
复制代码 拉取子模块
使用文本编辑器,修改.gitmodules文件,将github改为gitee
修改前
修改后
然后执行命令
输出结果
- 子模组 'aithinker_Ai-M6X_SDK'(https://gitee.com/Ai-Thinker-Open/aithinker_Ai-M6X_SDK.git)已对路径 'aithinker_Ai-M6X_SDK' 注册
复制代码 然后在执行
然后就一直等待他clone完成。
完成后进入子目录,执行命令
- cd aithinker_Ai-M6X_SDK/
- git submodule init
复制代码 然后就一直等待他clone完成。
最后在当前目录下还要clone windows编译器。
执行命令
- git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git
复制代码 一直等待clone完成。
4.添加环境变量
5.验证环境是否成功,关掉终端,重新打开,输入命令
- <blockquote>GNU Make 4.2.1
复制代码- riscv64-unknown-elf-gcc -v
复制代码- Using built-in specs.
- COLLECT_GCC=riscv64-unknown-elf-gcc
- COLLECT_LTO_WRAPPER=h:/ai-thinker/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)
复制代码 环境搭建完成
6.使用vscode打开AiPi-Open-Kits文件夹
然后输入命令make
然后会报这样的错误,需要进入AiPi-Open-Kits\aithinker_Ai-M6X_SDK\project.build这个文件将75,76,90行注释掉重新编译就好了。
重新编译。
|