发帖
20 0 3

小安派自学笔记-搭建、编译和烧录

业余菜狗
论坛元老

28

主题

153

回帖

4498

积分

论坛元老

积分
4498
本帖最后由 业余菜狗 于 2023-10-16 20:38 编辑

环境搭建:
    ubuntu:http://bbs.ai-thinker.com/forum.php?mod=viewthread&tid=255
模组M61资料:https://docs.ai-thinker.com/ai_m61
小安派Ai-Pi-Eyes资料:http://bbs.ai-thinker.com/forum.php
附上一键安装环境,不过要先安装git工具
使用方式:
    Windows:解压出来双击,然后死等;
     ubuntu:解压出来点击右键,选择作为程序运行,然后死等.
:菜狗写的脚本不一定靠谱
.烧录方式:
        
1.
USB线烧录:按住烧录键不放,按一下复位键,电脑会识别到一个com;
        
2.
USBTTL烧录:接线方式GNDGND,RXTX相互反接.
        PS:建议烧录的时候用USB线,调试的时候用USBTTL工具,USBTTL工具的时候,建议还是用USB供电
.编译:
        
进入程序文件夹:E:\AIThinker\AiPi-Open-Kits\aithinker_Ai-M6X_SDK\examples\helloworld,按住键盘上的shift再点击鼠标右键,选择"在此处打开powershell",在新弹出的对话框里面输入"make"之后按回车键,出现"Builttargetcombine"就编译完成了.
.烧录程序:
        
在完成""之后,不要关闭窗口,继续输入"make flashCOMX=COM8"在按回车
        
PS:
其中的COM8是不固定的,需要在设备管理器里面看.
        如果烧录卡住,可能需要改一个文件,打开项目文件夹里面”flash_prog_cfg.ini”把里面的"boot2_isp_mode= 1"改成"boot2_isp_mode= 0"再重新烧录.
.库和函数
        待学习
helloworld代码+注释:
  1. #include "bflb_mtimer.h"//延时函数从这里出来的
  2. #include "board.h"//初始化的库?

  3. #define DBG_TAG "MAIN"//没看懂
  4. #include "log.h"//log输出的库


  5. int main(void){//主函数,不知道换成"void main()"会怎样
  6.     board_init();//初始化

  7.     while (1) {//死循环
  8.         LOG_F("hello world fatal\r\n");//打印"hello world fatal"
  9.         LOG_E("hello world error\r\n");
  10.         LOG_W("hello world warning\r\n");
  11.         LOG_I("hello world information\r\n");
  12.         LOG_D("hello world debug\r\n");
  13.         LOG_T("hello world trace\r\n");
  14.         LOG_RF("hello world fatal raw\r\n");
  15.         LOG_RE("hello world error raw\r\n");
  16.         LOG_RW("hello world warning raw\r\n");
  17.         LOG_RI("hello world information raw\r\n");
  18.         LOG_RD("hello world debug raw\r\n");
  19.         LOG_RT("hello world trace raw\r\n");
  20.         bflb_mtimer_delay_ms(1000);//延时1000ms
  21.     }
  22. }
复制代码

──── 0人觉得很赞 ────

一键安装小安派开发环境.zip

1.04 KB, 下载次数: 255

使用道具 举报

2023-11-26 22:15:32
打卡
2023-11-18 14:31:19
所以TTL烧录步骤呢
2023-10-3 18:08:24
最关键的打印截个图啊
2023-10-3 15:18:02
教程还得是狗哥
2023-10-3 14:31:46
狗哥nb
狗哥牛逼!!!
狗哥强啊
尝试一下,看看效果!一键安装!
您需要登录后才可以回帖 立即登录
高级模式
123下一页
统计信息
  • 会员数: 30502 个
  • 话题数: 44670 篇