鹏程万里------esp32 开发编译和烧录

2024-03-10 11:30

本文主要是介绍鹏程万里------esp32 开发编译和烧录,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

首先编译demo

打开C:\msys32目录下的mingw32.exe然后执行下面的操作

DZ0012+Administrator@DZ0012 MINGW32 ~
# cd ..

DZ0012+Administrator@DZ0012 MINGW32 /home
# ls
Administrator

DZ0012+Administrator@DZ0012 MINGW32 /home
# cd ..

DZ0012+Administrator@DZ0012 MINGW32 /
# ls
autorebase.bat         hello_world          mingw32.ini      network.xml
autorebasebase1st.bat  home                 mingw64          opt
bin                    InstallationLog.txt  mingw64.exe      proc
components.xml         maintenancetool.dat  mingw64.ini      tmp
dev                    maintenancetool.exe  msys2.exe        usr
dir                    maintenancetool.ini  msys2.ico        var
esp                    mingw32              msys2.ini
etc                    mingw32.exe          msys2_shell.cmd

DZ0012+Administrator@DZ0012 MINGW32 /
# cd esp/

DZ0012+Administrator@DZ0012 MINGW32 /esp
# ls
esp-idf

DZ0012+Administrator@DZ0012 MINGW32 /esp
# cd esp-idf/

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf
# ls
add_path.sh     CONTRIBUTING.rst  Kconfig  README.md         tools
CMakeLists.txt  docs              LICENSE  requirements.txt
components      examples          make     sdkconfig.rename

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf
# cd examples/

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples
# ls
bluetooth          ethernet     peripherals   README.md  wifi
build_system       get-started  protocols     storage
common_components  mesh         provisioning  system

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples
# cd get-started/

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started
# ls
blink  hello_world  README.md

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started
# make
make: *** 没有指明目标并且找不到 makefile。 停止。

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started
# cd hello_world/

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started/hello_worl                                                                                                                                  d
# make


DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started/hello_worl                                                                                                                                  d
# ls
build  CMakeLists.txt  main  Makefile  README.md  sdkconfig  sdkconfig.old

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started/hello_worl                                                                                                                                  d
# make
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-80-g6c4433a5
Expected to see version: esp32-2019r1
Please check ESP-IDF setup instructions and update the toolchain, or proceed at                                                                                                                                   your own risk.
WARNING: Compiler version is not supported: 5.2.0
Expected to see version(s): 8.2.0
Please check ESP-IDF setup instructions and update the toolchain, or proceed at                                                                                                                                   your own risk.
Python requirements from C:/msys32/esp/esp-idf/requirements.txt are satisfied.
WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-80-g6c4433a5
Expected to see version: esp32-2019r1
Please check ESP-IDF setup instructions and update the toolchain, or proceed at                                                                                                                                   your own risk.
WARNING: Compiler version is not supported: 5.2.0
Expected to see version(s): 8.2.0
Please check ESP-IDF setup instructions and update the toolchain, or proceed at                                                                                                                                   your own risk.

App "hello-world" version: v4.0-dev-837-g58df1d93b-dirty
To flash all build output, run 'make flash' or:
python /esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /esp/esp-idf/examples/get-started/hello_world/build/bootloader/bootloader.bin 0x10000 /esp/esp-idf/examples/get-started/hello_world/build/hello-world.bin 0x8000 /esp/esp-idf/examples/get-started/hello_world/build/partitions_singleapp.bin

然后烧录

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started/hello_world
# make flash
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-80-g6c4433a5
Expected to see version: esp32-2019r1
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
WARNING: Compiler version is not supported: 5.2.0
Expected to see version(s): 8.2.0
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
Python requirements from C:/msys32/esp/esp-idf/requirements.txt are satisfied.
WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-80-g6c4433a5
Expected to see version: esp32-2019r1
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
WARNING: Compiler version is not supported: 5.2.0
Expected to see version(s): 8.2.0
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.

App "hello-world" version: v4.0-dev-837-g58df1d93b-dirty
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.7-dev
Serial port C:/msys32/dev/ttyUSB0
Traceback (most recent call last):
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3065, in <module>
    _main()
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3058, in _main
    main()
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2756, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 225, in __init__
    self._port = serial.serial_for_url(port)
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/serialwin32.py", line 62, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'C:/msys32/dev/ttyUSB0': WindowsError(2, '\xcf\xb5\xcd\xb3\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xce\xc4\xbc\xfe\xa1\xa3')
make: *** [/esp/esp-idf/components/esptool_py/Makefile.projbuild:67:flash] 错误 1
 

出错了。。。。。

看了以下端口号


DZ0012+Administrator@DZ0012 MINGW32 ~
# cd dev
-bash: cd: dev: No such file or directory

DZ0012+Administrator@DZ0012 MINGW32 ~
# cd /dev

DZ0012+Administrator@DZ0012 MINGW32 /dev
# ls
clipboard  dsp     null  random  sda3  sda7    stdin   urandom
conin      fd      ptmx  sda     sda4  sda8    stdout  windows
conout     full    pty0  sda1    sda5  shm     tty     zero
console    mqueue  pty1  sda2    sda6  stderr  ttyS12

DZ0012+Administrator@DZ0012 MINGW32 /dev
结果是 ttyS12

于是make menuconfig修改串口

选这个进去

然后

选第一个修改

改成自己的

然后再次make

make flash

DZ0012+Administrator@DZ0012 MINGW32 /esp/esp-idf/examples/get-started/hello_world
# make flash
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-80-g6c4433a5
Expected to see version: esp32-2019r1
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
WARNING: Compiler version is not supported: 5.2.0
Expected to see version(s): 8.2.0
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
Python requirements from C:/msys32/esp/esp-idf/requirements.txt are satisfied.
WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-80-g6c4433a5
Expected to see version: esp32-2019r1
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
WARNING: Compiler version is not supported: 5.2.0
Expected to see version(s): 8.2.0
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.

App "hello-world" version: v4.0-dev-837-g58df1d93b-dirty
Flashing binaries to serial port /dev/ttyS12 (app at offset 0x10000)...
esptool.py v2.7-dev
Serial port /??/COM13
Traceback (most recent call last):
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3065, in <module>
    _main()
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3058, in _main
    main()
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2756, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "C:/msys32/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 225, in __init__
    self._port = serial.serial_for_url(port)
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/serialwin32.py", line 62, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '/??/COM13': WindowsError(123, '\xce\xc4\xbc\xfe\xc3\xfb\xa1\xa2\xc4\xbf\xc2\xbc\xc3\xfb\xbb\xf2\xbe\xed\xb1\xea\xd3\xef\xb7\xa8\xb2\xbb\xd5\xfd\xc8\xb7\xa1\xa3')
make: *** [/esp/esp-idf/components/esptool_py/Makefile.projbuild:67:flash] 错误 1
看起来先装个gcc在windows上

参考https://blog.csdn.net/rong_toa/article/details/79002711

但是安装gcc遇到了

参考https://www.cnblogs.com/indif/archive/2011/04/18/2019688.html

原来是我安装了webstorm的愿意

然后安装后在桌面出现

双击打开

选中所有然后点击installation里的apply安装

然后到环境变量中把C:\MinGW\bin加入path

gcc是安装好了

但是用makeflash始终失败,不得已只能用flash烧录工具

 

搞定

这篇关于鹏程万里------esp32 开发编译和烧录的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:https://blog.csdn.net/u013308744/article/details/97239011
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/794095

相关文章

Spring Security基于数据库的ABAC属性权限模型实战开发教程

《SpringSecurity基于数据库的ABAC属性权限模型实战开发教程》:本文主要介绍SpringSecurity基于数据库的ABAC属性权限模型实战开发教程,本文给大家介绍的非常详细,对大... 目录1. 前言2. 权限决策依据RBACABAC综合对比3. 数据库表结构说明4. 实战开始5. MyBA

使用Python开发一个简单的本地图片服务器

《使用Python开发一个简单的本地图片服务器》本文介绍了如何结合wxPython构建的图形用户界面GUI和Python内建的Web服务器功能,在本地网络中搭建一个私人的,即开即用的网页相册,文中的示... 目录项目目标核心技术栈代码深度解析完整代码工作流程主要功能与优势潜在改进与思考运行结果总结你是否曾经

Java编译生成多个.class文件的原理和作用

《Java编译生成多个.class文件的原理和作用》作为一名经验丰富的开发者,在Java项目中执行编译后,可能会发现一个.java源文件有时会产生多个.class文件,从技术实现层面详细剖析这一现象... 目录一、内部类机制与.class文件生成成员内部类(常规内部类)局部内部类(方法内部类)匿名内部类二、

Spring Boot + MyBatis Plus 高效开发实战从入门到进阶优化(推荐)

《SpringBoot+MyBatisPlus高效开发实战从入门到进阶优化(推荐)》本文将详细介绍SpringBoot+MyBatisPlus的完整开发流程,并深入剖析分页查询、批量操作、动... 目录Spring Boot + MyBATis Plus 高效开发实战:从入门到进阶优化1. MyBatis

Python基于wxPython和FFmpeg开发一个视频标签工具

《Python基于wxPython和FFmpeg开发一个视频标签工具》在当今数字媒体时代,视频内容的管理和标记变得越来越重要,无论是研究人员需要对实验视频进行时间点标记,还是个人用户希望对家庭视频进行... 目录引言1. 应用概述2. 技术栈分析2.1 核心库和模块2.2 wxpython作为GUI选择的优

利用Python开发Markdown表格结构转换为Excel工具

《利用Python开发Markdown表格结构转换为Excel工具》在数据管理和文档编写过程中,我们经常使用Markdown来记录表格数据,但它没有Excel使用方便,所以本文将使用Python编写一... 目录1.完整代码2. 项目概述3. 代码解析3.1 依赖库3.2 GUI 设计3.3 解析 Mark

利用Go语言开发文件操作工具轻松处理所有文件

《利用Go语言开发文件操作工具轻松处理所有文件》在后端开发中,文件操作是一个非常常见但又容易出错的场景,本文小编要向大家介绍一个强大的Go语言文件操作工具库,它能帮你轻松处理各种文件操作场景... 目录为什么需要这个工具?核心功能详解1. 文件/目录存javascript在性检查2. 批量创建目录3. 文件

基于Python开发批量提取Excel图片的小工具

《基于Python开发批量提取Excel图片的小工具》这篇文章主要为大家详细介绍了如何使用Python中的openpyxl库开发一个小工具,可以实现批量提取Excel图片,有需要的小伙伴可以参考一下... 目前有一个需求,就是批量读取当前目录下所有文件夹里的Excel文件,去获取出Excel文件中的图片,并

基于Python开发PDF转PNG的可视化工具

《基于Python开发PDF转PNG的可视化工具》在数字文档处理领域,PDF到图像格式的转换是常见需求,本文介绍如何利用Python的PyMuPDF库和Tkinter框架开发一个带图形界面的PDF转P... 目录一、引言二、功能特性三、技术架构1. 技术栈组成2. 系统架构javascript设计3.效果图

基于Python开发PDF转Doc格式小程序

《基于Python开发PDF转Doc格式小程序》这篇文章主要为大家详细介绍了如何基于Python开发PDF转Doc格式小程序,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 用python实现PDF转Doc格式小程序以下是一个使用Python实现PDF转DOC格式的GUI程序,采用T