鹏程万里------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

相关文章

Go语言开发实现查询IP信息的MCP服务器

《Go语言开发实现查询IP信息的MCP服务器》随着MCP的快速普及和广泛应用,MCP服务器也层出不穷,本文将详细介绍如何在Go语言中使用go-mcp库来开发一个查询IP信息的MCP... 目录前言mcp-ip-geo 服务器目录结构说明查询 IP 信息功能实现工具实现工具管理查询单个 IP 信息工具的实现服

使用Python开发一个带EPUB转换功能的Markdown编辑器

《使用Python开发一个带EPUB转换功能的Markdown编辑器》Markdown因其简单易用和强大的格式支持,成为了写作者、开发者及内容创作者的首选格式,本文将通过Python开发一个Markd... 目录应用概览代码结构与核心组件1. 初始化与布局 (__init__)2. 工具栏 (setup_t

Spring Shell 命令行实现交互式Shell应用开发

《SpringShell命令行实现交互式Shell应用开发》本文主要介绍了SpringShell命令行实现交互式Shell应用开发,能够帮助开发者快速构建功能丰富的命令行应用程序,具有一定的参考价... 目录引言一、Spring Shell概述二、创建命令类三、命令参数处理四、命令分组与帮助系统五、自定义S

idea maven编译报错Java heap space的解决方法

《ideamaven编译报错Javaheapspace的解决方法》这篇文章主要为大家详细介绍了ideamaven编译报错Javaheapspace的相关解决方法,文中的示例代码讲解详细,感兴趣的... 目录1.增加 Maven 编译的堆内存2. 增加 IntelliJ IDEA 的堆内存3. 优化 Mave

Python通过模块化开发优化代码的技巧分享

《Python通过模块化开发优化代码的技巧分享》模块化开发就是把代码拆成一个个“零件”,该封装封装,该拆分拆分,下面小编就来和大家简单聊聊python如何用模块化开发进行代码优化吧... 目录什么是模块化开发如何拆分代码改进版:拆分成模块让模块更强大:使用 __init__.py你一定会遇到的问题模www.

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选择的优