鹏程万里------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 开发编译和烧录的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/794095

相关文章

Python38个游戏开发库整理汇总

《Python38个游戏开发库整理汇总》文章介绍了多种Python游戏开发库,涵盖2D/3D游戏开发、多人游戏框架及视觉小说引擎,适合不同需求的开发者入门,强调跨平台支持与易用性,并鼓励读者交流反馈以... 目录PyGameCocos2dPySoyPyOgrepygletPanda3DBlenderFife

使用Python开发一个Ditto剪贴板数据导出工具

《使用Python开发一个Ditto剪贴板数据导出工具》在日常工作中,我们经常需要处理大量的剪贴板数据,下面将介绍如何使用Python的wxPython库开发一个图形化工具,实现从Ditto数据库中读... 目录前言运行结果项目需求分析技术选型核心功能实现1. Ditto数据库结构分析2. 数据库自动定位3

Django开发时如何避免频繁发送短信验证码(python图文代码)

《Django开发时如何避免频繁发送短信验证码(python图文代码)》Django开发时,为防止频繁发送验证码,后端需用Redis限制请求频率,结合管道技术提升效率,通过生产者消费者模式解耦业务逻辑... 目录避免频繁发送 验证码1. www.chinasem.cn避免频繁发送 验证码逻辑分析2. 避免频繁

Spring Boot集成/输出/日志级别控制/持久化开发实践

《SpringBoot集成/输出/日志级别控制/持久化开发实践》SpringBoot默认集成Logback,支持灵活日志级别配置(INFO/DEBUG等),输出包含时间戳、级别、类名等信息,并可通过... 目录一、日志概述1.1、Spring Boot日志简介1.2、日志框架与默认配置1.3、日志的核心作用

PyQt5 GUI 开发的基础知识

《PyQt5GUI开发的基础知识》Qt是一个跨平台的C++图形用户界面开发框架,支持GUI和非GUI程序开发,本文介绍了使用PyQt5进行界面开发的基础知识,包括创建简单窗口、常用控件、窗口属性设... 目录简介第一个PyQt程序最常用的三个功能模块控件QPushButton(按钮)控件QLable(纯文本

Go语言编译环境设置教程

《Go语言编译环境设置教程》Go语言支持高并发(goroutine)、自动垃圾回收,编译为跨平台二进制文件,云原生兼容且社区活跃,开发便捷,内置测试与vet工具辅助检测错误,依赖模块化管理,提升开发效... 目录Go语言优势下载 Go  配置编译环境配置 GOPROXYIDE 设置(VS Code)一些基本

基于Python开发一个图像水印批量添加工具

《基于Python开发一个图像水印批量添加工具》在当今数字化内容爆炸式增长的时代,图像版权保护已成为创作者和企业的核心需求,本方案将详细介绍一个基于PythonPIL库的工业级图像水印解决方案,有需要... 目录一、系统架构设计1.1 整体处理流程1.2 类结构设计(扩展版本)二、核心算法深入解析2.1 自

java使用protobuf-maven-plugin的插件编译proto文件详解

《java使用protobuf-maven-plugin的插件编译proto文件详解》:本文主要介绍java使用protobuf-maven-plugin的插件编译proto文件,具有很好的参考价... 目录protobuf文件作为数据传输和存储的协议主要介绍在Java使用maven编译proto文件的插件

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

SpringBoot开发中十大常见陷阱深度解析与避坑指南

《SpringBoot开发中十大常见陷阱深度解析与避坑指南》在SpringBoot的开发过程中,即使是经验丰富的开发者也难免会遇到各种棘手的问题,本文将针对SpringBoot开发中十大常见的“坑... 目录引言一、配置总出错?是不是同时用了.properties和.yml?二、换个位置配置就失效?搞清楚加