本帖最后由 molun 于 2023-10-10 17:24 编辑
Windows下通过CMD(PowerShell)搭建小安派开发板编译环境 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps114.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps115.jpg 出现上图所示情况是因为没有安装git工具。 安装 git 工具 下载网址:https://git-scm.com/ file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps116.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps117.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps118.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps119.jpg 根据你的操作系统下载对应的版本,我这里下载64位的。 下载有点慢,可能需要施点魔法,或者通过应用市场下载。 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps120.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps121.jpg 不到60M下载了有10来分钟😅还没有下载完。 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps122.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps123.jpg 迅雷还是比较厉害,刷刷刷就下载完成了。 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps124.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps125.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps126.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps127.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps128.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps129.jpg 一路默认Next安装就可以了。 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps130.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps131.jpg 安装完成。 克隆小安派官方示例代码 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps132.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps133.jpg 找个文件夹,鼠标右键>选择在终端中打开 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps134.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps135.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps136.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps137.jpg 静待完成。速度差的话需要施加魔法或者尝试以下命令 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps138.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps139.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps140.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps141.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps142.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps143.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps144.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps145.jpg cd AiPi-Open-Kits file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps146.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps147.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps148.jpg git submodule init file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps149.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps150.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps151.jpg git submodule update file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps152.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps153.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps154.jpg 这一步比较久 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps155.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps156.jpg 拉取不到的话,可以删除了aithinker_Ai-M6X_SDK文件夹,重新拉取 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps157.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps158.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps159.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps160.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps161.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps162.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps163.jpg 设置环境变量 进入aithinker_Ai-M6X_SDK,拉取SDK子模块以及设置路径 cd aithinker_Ai-M6X_SDK file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps164.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps165.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps166.jpg .\install.sh file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps167.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps168.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps169.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps170.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps171.jpg .\export.sh file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps172.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps173.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps174.jpg git窗口太快,没有截取到图片。 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps175.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps176.jpg 尝试编译 cd AiPi-Eyes_weather file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps177.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps178.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps179.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps180.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps181.jpg 看来还是得等待上一步完成,或者按照上一篇安装博流的编译环境。 手动设置环境变量 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps182.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps183.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps184.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps185.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps186.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps187.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps188.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps189.jpg 如上图所示,设置好变量后,确定保存后重启电脑。 测试环境 make -v file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps190.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps191.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps192.jpg riscv64-unknown-elf-gcc -v file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps193.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps194.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps195.jpg 执行后弹出让选择打开riscv64-unknown-elf-gcc的程序 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps196.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps197.jpg 再次尝试编译file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps198.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps199.jpg 还是报错,怀疑是代码中的riscv64-unknown-elf-gcc只支持Linux环境 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps200.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps201.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps202.jpg 重新拉取windows版本toolchain_gcc_t-head_windowsfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps203.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps204.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps205.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps206.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps207.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps208.jpg 对比下Linux版本和Windows版本 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps209.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps210.jpg 重新设置编译环境 riscv64-unknown-elf-gcc -v file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps211.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps212.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps213.jpg 环境搭建测试成功 编译示例代码 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps214.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps215.jpg cd AiPi-Eyes_weather make file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps216.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps217.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps218.jpg file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps219.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps220.jpg 编译成功 烧录固件 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps221.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps222.jpg 这里需要注意,Windows下的烧录代码与Linux是有差别的。 Linux: make flash COMX=/dev/ttyUSB0 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps223.jpg Windows: make flash COMX=COM5 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps224.jpg 具体的端口号需要根据实际进行调整。Windows下可以查看设备管理器 file:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps225.jpgfile:///C:/Users/molun/AppData/Local/Temp/ksohtml17580/wps226.jpg 我现在没有插设备,So稍后再补截图。 注意:启动烧录命令后会出现“Please Press Reset Key!”,需要在模组上按下RST键继续完成烧录
|