Ubuntu22下Ai-M61-32S开发环境搭建

[复制链接]
查看779 | 回复4 | 2023-12-12 10:14:48 | 显示全部楼层 |阅读模式
本帖最后由 st780206 于 2024-7-30 14:34 编辑

搭建过程留个记录.

Ubuntu22的安装过程就不记录了.

1. 克隆SDK,需要先安装git
@ubt22-emb:~$ sudo apt install git -y

屏幕截图 2024-05-23 231513.png
git clone SDK

@ubt22-emb:~$ cd Ai-M61-32S/

@ubt22-emb:~/Ai-M61-32S$ git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git



很快完成.


2.拉取 M61 的 SDK 子模块
在拉取 SDK 之前,需要修改一下子模块的来源,不然可能会拉取失败。(子模块使用的是github,国内可能部分地区访问有问题)
进入 AiPi-Open-Kits 中,用文本打开 .gitmodules 文件 url 参数中的 github.com 改成 gitee.com:


@ubt22-emb:~/Ai-M61-32S$ cd AiPi-Open-Kits/

@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits$ vim.tiny .gitmodules


@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits$ git submodule init

@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits$ git submodule update

正克隆到 '/home/~~~~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK'...

没有进度条,等待一段时间就完成了.


3.拉取 M61 SDK 中的子模块
M61 SDK 是小安派仓库的子模块,而 M61 SDK 自己也有子模块,所以也需要拉取,否则会编译不成功。

@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits$ cd aithinker_Ai-M6X_SDK/
@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK$ git submodule init
子模组 'toolchain'(https://e.coding.net/axk/ai-m6xsdkzujian/toolchain.git)已对路径 'toolchain' 注册
子模组 'tools'(https://e.coding.net/axk/ai-m6xsdkzujian/tools.git)已对路径 'tools' 注册
@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK$ git submodule update
正克隆到 '/home/~~~~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/toolchain'...

4.克隆适用 linux 的编译工具链和头文件
在 aithinker_Ai-M6X_SDK/ 文件夹中拉取工具链

@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK$ git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_linux.git

5.将下面路径加入到环境变量PATH中
@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK$ export PATH=/home/~~~~/Ai-M61-32S/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/toolchain_gcc_t-head_linux/binPATH

6.安装make和ninja
@ubt22-emb:~/$ sudo apt install make
@ubt22-emb:~/$ sudo apt install ninja
   |   debian 12               sudo apt install ninja-build



7.验证设置是否成功
make -v
riscv64-unknown-elf-gcc -v


8.编译天气站程序
@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits$ cd AiPi-Eyes_weather
@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather$ make
编译出错.

/bin/sh: 1: ./../aithinker_Ai-M6X_SDK/tools/cmake/bin/cmake: Permission denied
make: *** [../aithinker_Ai-M6X_SDK/project.build:72:build] 错误 126

##@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather$ sudo apt install cmake

@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather$ chmod 774 ../aithinker_Ai-M6X_SDK/tools/cmake/bin/cmake


@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather$ make

开始编译

make -C build combine
/bin/sh: 1: ./../aithinker_Ai-M6X_SDK/tools/bflb_tools/bflb_fw_post_proc/bflb_fw_post_proc-ubuntu: Permission denied
make[4]: *** [CMakeFiles/combine.dir/build.make:70:CMakeFiles/combine] 错误 126

@ubt22-emb:~/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather$ chmod 774 ../aithinker_Ai-M6X_SDK/tools/bflb_tools/bflb_fw_post_proc/bflb_fw_post_proc-ubuntu

[11:00:46.148] - Bootheader config crc: b'f9cf01e0'
[11:00:46.149] - create OTA file:/home/songtao/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather/build/build_out/Eyes_bl616.bin.ota
[11:00:46.282] - create XZ file:/home/songtao/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather/build/build_out/Eyes_bl616.xz
[11:00:46.593] - create XZ OTA file:/home/songtao/Ai-M61-32S/AiPi-Open-Kits/AiPi-Eyes_weather/build/build_out/Eyes_bl616.xz.ota
Built target combine
cp ./../aithinker_Ai-M6X_SDK/bsp/board/bl616dk/config/edata.bin build/build_out
cp ./../aithinker_Ai-M6X_SDK/bsp/board/bl616dk/config/Rx_boot2_m61.bin build/build_out

编译成功.

9.烧录程序
make flash COMX=/dev/ttyACM0





本帖被以下淘专辑推荐:

回复

使用道具 举报

WT_0213 | 2023-12-12 10:33:03 | 显示全部楼层
回复

使用道具 举报

干簧管 | 2023-12-12 10:43:49 | 显示全部楼层
回复

使用道具 举报

lazy | 2023-12-12 11:53:20 | 显示全部楼层
学习了
回复

使用道具 举报

lovzx | 2024-5-2 19:29:19 | 显示全部楼层
学习
回复

使用道具 举报

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

本版积分规则