476 字
2 分钟
合宙 ESP32-C3无法烧录
2023-05-24
无标签

案件还原#

开发板:[合宙ESP32-C3开发板]

在测试TFT显示屏时,尝试使用硬件SPI接口进行数据输出,引脚连接情况:

#define TFT_SLK 2 // SCLK
#define TFT_SDA 3 // MOSI
#define TFT_RST 0 // RESET
#define TFT_DC 1 // DC
#define TFT_CS 12 // CS
// #define TFT_BL 11 // BLK(可不接)

在连接完成后,使用 DIO 方式烧录程序,再修改并重新烧录时出现如下错误:

Writing at 0x00000000... (100 %)
Wrote 12352 bytes (8980 compressed) at 0x00000000 in 1.0 seconds (effective 99.5 kbit/s)...
File md5: 4507c5d23fb36ac2940567e390335cfb
Flash md5: 9d660a4d140e7a7a0c2c7e02524391dc
MD5 of 0xFF is af8a9eab4924fccc46764eb835f021aa
A fatal error occurred: MD5 of file does not match data in flash!

写入后程序的MD5校验码对不上,修改代码文件再烧录,出现如下错误:

File md5: 4507c5d23fb36ac2940567e390335cfb
Flash md5: 1adb81208f9f8592fd6e509cafc30f2f
MD5 of 0xFF is af8a9eab4924fccc46764eb835f021aa

代码文件确实重新生成了,但Flash中的内容并没有被修改。

使用乐鑫的Flash下载工具进行烧写或擦拭都没有成功,Flash中内容没有出现变化。


解决方法#

GPIO12-MTDI: If driven High, flash voltage (VDD_SDIO) is 1.8V not default 3.3V. Has internal pull-down, so unconnected = Low = 3.3V. May prevent flashing and/or booting if 3.3V flash is used and this pin is pulled high, causing the flash to brownout. See the datasheet for more details. VDDSDIO has been enabled at 1.8V (due to MTDI/GPIO12, see above), but this flash chip requires 3.3V so it’s browning out.

根据官方手册的说明1,GPIO12 被应用于 BootMode 的选择:如果在高电平表示 VDD_SDIO 是 1.3V;未连接或低电平表示 VDD_SDIO 是 3.3V。

因此为了芯片的正常烧录,GPIO12 在烧录时需要处于未连接或低电平的情况。

关于该问题的一些讨论:


其他的尝试#

尝试过的网上的一些其他方法23

Terminal window
pip install esptool
python -m esptool --port COM5 write_flash_status --non-volatile 0
python -m esptool --port COM5 --after hard_reset erase_flash
  • Lower Boadrate: upload_speed = 115200

Footnotes#

  1. Boot Mode Selection

  2. Fixed esp32 problem: MD5 of file does not match data in flash!

  3. MD5 of file does not match data in flash! (But works for the code that already running)

合宙 ESP32-C3无法烧录
https://fuwari.vercel.app/posts/嵌入式/其他/合宙-esp32-c3无法烧录/
作者
Asuwee
发布于
2023-05-24
许可协议
CC BY-NC-SA 4.0