The hardware conditions for the ESP32-C6 chip to enter the “ Download Mode“

本文介绍了ESP32-C6系列芯片如何通过UART接口(默认U0TXDGPIO16和U0RXDGPIO17)下载固件,包括Windows和Ubuntu环境下的操作步骤,以及进入下载模式和启动条件的要求。还提供了电源序列、硬件设计和故障排查指南。

ESP32-C6 downloads firmware via U0TXD(GPIO16)and U0RXD(GPIO17) by default. Please refer to the ESP32-C6 Datasheet

  • On the Windows environment, you can use the Flash download tool to download the firmware (The bin file).


    在这里插入图片描述

    • Run flash_download_tool.exe
      在这里插入图片描述

    • Choose ChipType as ESP32-C6, LoadMode as UART, then press OK.
      在这里插入图片描述

    1. Click to select the .bin file to be flashed.
    2. Enter the download address offset for the firmware to be flashed.
    3. Choose the COM port to which the development board is connected.
    4. Click “Start” at the bottom-left corner to begin the flashing process.

The green progress bar below will show the flashing progress, and it will be fully loaded when flashing is complete.

在这里插入图片描述

  • On the Ubuntu environment, you can use the esptool to download the firmware (The bin file). For example:

    esptool.py -p /dev/ttyUSB0 write_flash 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 ssc.bin
    

esptool command instructions can be found in the “Esptool.py Documentation”


1、The following pins level requirements must be met when the ESP32-C6 series chips need enter the download mode:

VDD -> 3V3 					(The Power Supply)
GND -> GND 					("Common ground" with power supply)
GPIO8 -> pull up			(default floating)
GPIO9 -> pull down 			(default pull up)
EN -> pull up				(Enables the Chip, Do not leave the `EN` pin floating)
TXD0 -> RX
RXD0 -> TX

After ensuring the correct wiring connections, you can proceed with the firmware programming

Note:

  • The strapping combination of GPIO8 = 0 and GPIO9 = 0 is invalid and will trigger unexpected behavior.
  • After powering up the chip/module, you can verify whether it has entered Download Boot mode by using the UART0 serial port.
  • Please refer to the ESP32-C6 about “2.6.2 Chip Boot Mode Control” instructions.
    在这里插入图片描述
  • Please refer to the 《ESP32-C6 Datasheet》 about "2.4 Strapping Pins" instructions
    在这里插入图片描述

2、The following hardware conditions must be met for the ESP32-C6 chip to start:

  • The ESP32-C6 chip working voltage range is 3.0 V ~ 3.6 V;if you use a single power supply, the recommended voltage of the power supply for ESP32-C6 family is 3.3 V, and its recommended output current is 500 mA or more.

  • When using ESP32-C6 series Chips, you need require an external 40 MHz crystal oscillator for chip startup. If using the ESP32-C6 series modules , there is no longer need to external starting crystal oscillator. The hardware working conditions of ESP32-C6 chip can refer to the《ESP32-C6-WROOM-I》

    在这里插入图片描述

  • For more hardware design details, please refer to the 《ESP32-C6 Series Hardware Design Guidelines》.


3、Power­on Sequence:

  • The Chip_EN pin can be enabled only after the power supply reaches 50 us after 2.8 V. So when VDD reaches 2.8V, the voltage at EN must not exceed 0.7V. Please refer to the ESP32-C6 Datasheet about "2.5.3 Power Scheme"

在这里插入图片描述>在这里插入图片描述

在这里插入图片描述在这里插入图片描述


4、If the download fails, Please refer to the following methods for troubleshooting:

  • After the serial port tool is powered on, please pull down the Chip_EN pin and reset it , the serial port will print logs. If print the “waiting for Download” logs , it proves that the chip is in download mode.

    ESP-ROM:esp32c6-20200918
    Build:Sep 18 2020
    rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/1))
    waiting for download
    
  • After entering the download mode, if the COM port is in waiting for Power-on synchronization state on the “Flash Download Tool” , please check whether the COM port is correctly selected or occupied. And whether the UART0 download interface is correctly connected.

    在这里插入图片描述


Note:

在嵌入式系统开发过程中,下载可执行文件到硬件(Download Executable to Hardware)是部署阶段的重要步骤之一。该阶段涉及将编译和链接后的可执行文件(通常是二进制文件或固件镜像)传输到目标硬件设备的非易失性存储器(如Flash)中,并确保其能够在设备上正确运行。 ### 下载可执行文件到硬件的流程 1. **连接目标设备** 在下载之前,开发工具(如 `esptool.py`)会尝试与目标硬件建立连接。例如,在 ESP32 平台上,工具会通过串口(如 `/dev/ttyUSB0`)与芯片通信,并检测芯片类型和当前状态。 ```bash Connecting..... Detecting chip type... ESP32 Chip is ESP32-D0WD (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz ``` 这一过程包括识别芯片型号、功能特性、晶振频率等信息,以确保后续操作的兼容性[^2]。 2. **上传引导程序(Stub)** 为了执行更复杂的操作,工具会上传一个小型的引导程序(Stub)到目标设备的 RAM 中。该引导程序负责接收并处理后续的下载命令。 ```bash Uploading stub... Running stub... Stub running... ``` 3. **擦除目标存储区域** 在写入新的可执行文件之前,通常需要擦除目标 Flash 区域的内容,以确保新数据可以正确写入。这一步骤可以通过特定的擦除命令完成。 4. **写入可执行文件** 工具将可执行文件(如 `.bin` 文件)分块写入到目标设备的 Flash 存储中。该过程通常包括校验机制,以确保写入的数据完整无误。 ```bash Writing segment 0x00001000... Writing segment 0x00008000... ``` 5. **校验写入内容** 写入完成后,工具会读取目标存储区域的内容,并与原始可执行文件进行比对,以验证数据的正确性。如果发现不一致,可能会提示错误或重新尝试写入。 6. **重置设备** 最后,工具会通过硬件引脚(如 RTS 引脚)重置目标设备,使其从新写入的固件开始执行。 ```bash Hard resetting via RTS pin... ``` ### 下载阶段的关键因素 - **通信协议**:下载过程中使用的通信协议(如 UART、SPI、USB)会影响下载速度和稳定性。 - **硬件支持**:目标设备的硬件设计(如 Flash 容量、存储布局)决定了可执行文件的写入方式和位置。 - **固件格式**:可执行文件的格式(如 ELF、BIN、HEX)必须与目标设备的引导机制兼容。 - **加密与安全**:在某些应用场景中,可能需要启用 Flash 加密功能,以防止固件被非法读取或篡改[^2]。 ### 示例:使用 `esptool.py` 下载固件 ```bash esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 write_flash 0x1000 firmware.bin ``` 该命令将 `firmware.bin` 文件写入 ESP32 设备的 Flash 起始地址 `0x1000`,并通过串口 `/dev/ttyUSB0` 以 115200 的波特率进行通信。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值