ARDUINO 上传失败:上传错误:退出状态 2常见原因及解决方法Failed uploading: uploading error: exit status

前言:

在这里插入图片描述

串口监视器可显示各种ESP32打印信息

下述均为USB TYPEC 数据线正常的情况下的报错,如果数据线或串口有问题

原因1:无法连接到ESP32:串行数据流停止:可能存在串行噪音或损坏

解决方法:ESP32电路板是否供电?电压是否正常?给电路板重新上电。

Sketch uses 297485 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20352 bytes (6%) of dynamic memory, leaving 307328 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM9
Connecting…
A fatal error occurred: Failed to connect to ESP32: Serial data stream stopped: Possible serial noise or corruption.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
Failed uploading: uploading error: exit status 2

Sketch 使用 297485 字节 (22%) 的程序存储空间。最大为 1310720 个字节。
全局变量使用 20352 字节 (6%) 的动态内存,留出 307328 个字节用于局部变量。最大值为 327680 字节。
esptool.py v4.6
串口COM9
连接。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
发生致命错误:无法连接到 ESP32:串行数据流停止:可能存在串行噪音或损坏。
有关故障排除步骤,请访问:https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
上传失败:上传错误:退出状态 2

原因2:无法打开 COM9,端口不存在

COM9为任意端口
解决方法:ARDUINO IDE是否打开了多个窗口,并在其它窗口或其它软件打开了串口导致串口被占用?检查其它窗口,关闭该窗口的串口监视功能。

Sketch uses 289881 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 18376 bytes (5%) of dynamic memory, leaving 309304 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM9
A fatal error occurred: Could not open COM9, the port doesn’t exist
Failed uploading: uploading error: exit status 2

Sketch 使用 289881 字节 (22%) 的程序存储空间。最大为 1310720 个字节。
全局变量使用 18376 字节 (5%) 的动态内存,留出 309304 个字节用于局部变量。最大值为 327680 字节。
esptool.py v4.6
串口COM9
发生致命错误:无法打开 COM9,端口不存在
上传失败:上传错误:退出状态 2

原因3:此芯片是 ESP32 而不是 ESP32-S3。错误的 --chip 参数

ARDUINO IDE 开发板选择错误
解决方法:重新选择正确的开发板,如将开发板更换为ESP32 Dev Module及正确的串口号。

Sketch uses 289881 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 18376 bytes (5%) of dynamic memory, leaving 309304 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM9
Connecting…
A fatal error occurred: This chip is ESP32 not ESP32-S3. Wrong --chip argument?
Failed uploading: uploading error: exit status 2
Sketch 使用 289881 字节 (22%) 的程序存储空间。最大为 1310720 个字节。

全局变量使用 18376 字节 (5%) 的动态内存,留出 309304 个字节用于局部变量。最大值为 327680 字节。
esptool.py v4.6
串口COM9
连接。。。。
发生致命错误:此芯片是 ESP32 而不是 ESP32-S3。错误的 --chip 参数?
上传失败:上传错误:退出状态 2

ESP32正常编译和下载的串口监视器显示的信息:

Sketch uses 268157 bytes (20%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20184 bytes (6%) of dynamic memory, leaving 307496 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM9
Connecting…
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:c9:22:f0:c6:d0
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 921600
Changed.
Configuring flash size…
Flash will be erased from 0x00001000 to 0x00005fff…
Flash will be erased from 0x00008000 to 0x00008fff…
Flash will be erased from 0x0000e000 to 0x0000ffff…
Flash will be erased from 0x00010000 to 0x00051fff…
Compressed 19744 bytes to 13604…
Writing at 0x00001000… (100 %)
Wrote 19744 bytes (13604 compressed) at 0x00001000 in 0.4 seconds (effective 383.6 kbit/s)…
Hash of data verified.
Compressed 3072 bytes to 146…
Writing at 0x00008000… (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 499.6 kbit/s)…
Hash of data verified.
Compressed 8192 bytes to 47…
Writing at 0x0000e000… (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 734.7 kbit/s)…
Hash of data verified.
Compressed 268528 bytes to 148942…
Writing at 0x00010000… (10 %)
Writing at 0x0001b898… (20 %)
Writing at 0x00024908… (30 %)
Writing at 0x00029ab7… (40 %)
Writing at 0x0002ef36… (50 %)
Writing at 0x0003428d… (60 %)
Writing at 0x0003cf0f… (70 %)
Writing at 0x00046149… (80 %)
Writing at 0x0004b841… (90 %)
Writing at 0x00050f26… (100 %)
Wrote 268528 bytes (148942 compressed) at 0x00010000 in 2.3 seconds (effective 934.4 kbit/s)…
Hash of data verified.

Leaving…
Hard resetting via RTS pin…

  • 21
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值