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

2024-09-04 00:38

本文主要是介绍鹏程万里------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/1134505

相关文章

Python实战之SEO优化自动化工具开发指南

《Python实战之SEO优化自动化工具开发指南》在数字化营销时代,搜索引擎优化(SEO)已成为网站获取流量的重要手段,本文将带您使用Python开发一套完整的SEO自动化工具,需要的可以了解下... 目录前言项目概述技术栈选择核心模块实现1. 关键词研究模块2. 网站技术seo检测模块3. 内容优化分析模

基于Java开发一个极简版敏感词检测工具

《基于Java开发一个极简版敏感词检测工具》这篇文章主要为大家详细介绍了如何基于Java开发一个极简版敏感词检测工具,文中的示例代码简洁易懂,感兴趣的小伙伴可以跟随小编一起学习一下... 目录你是否还在为敏感词检测头疼一、极简版Java敏感词检测工具的3大核心优势1.1 优势1:DFA算法驱动,效率提升10

Python开发简易网络服务器的示例详解(新手入门)

《Python开发简易网络服务器的示例详解(新手入门)》网络服务器是互联网基础设施的核心组件,它本质上是一个持续运行的程序,负责监听特定端口,本文将使用Python开发一个简单的网络服务器,感兴趣的小... 目录网络服务器基础概念python内置服务器模块1. HTTP服务器模块2. Socket服务器模块

Java 与 LibreOffice 集成开发指南(环境搭建及代码示例)

《Java与LibreOffice集成开发指南(环境搭建及代码示例)》本文介绍Java与LibreOffice的集成方法,涵盖环境配置、API调用、文档转换、UNO桥接及REST接口等技术,提供... 目录1. 引言2. 环境搭建2.1 安装 LibreOffice2.2 配置 Java 开发环境2.3 配

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)一些基本