esp32-C3 Firmware Burning User Manual 1.4
Article directory
- esp32-C3 Firmware Burning User Manual 1.4
-
- Burn
-
- Required hardware
- software tools
-
- vscode + platformIO
- flash_download_tools
- Wiring between socket and USB to TTL module
-
- esp32-C3 version socket (4-pin base plate)
- bin firmware and burning address
-
- Get detailed burning address and information
- Obtain the detailed burning address and information of the file system program
- vscode + platformIO burning method
-
- Compile and download
- Put the device into download mode
- flash_download_tools burning method
-
- Open flash_download_tools
- Select ESP32-C3, other defaults, as shown in the figure
- Select burning firmware and fill in the corresponding address
- Select the serial port, baud rate, and click Start
- Put the device into download mode
- esptool.py burning method
-
- Install esptool
- Burn
-
- Erase flash
- Burn *.bin
Kind tips:
1. The BOOT pin of esp32-C3 is GPIO9 and needs to be soldered out from the chip board.
2. All programming-related pins have been reserved in the chip board. You can solder the leads as needed.
3. After downloading the program, when using the serial port to view the log, you need to use a 220v power supply (please be sure to observe power safety).
Reason: Since the socket contains power-consuming equipment such as relays and meters, the 3.3V voltage and current provided by the USB-to-serial port may be insufficient, which manifests as an intermittent connection between the USB-to-serial port and the computer, resulting in the inability to view the log.
Burning
Required hardware
Smart socket kit 1 piece
usb to ttl module 1
Several Dupont lines, 6-7
Acquisition method: Purchase on Taobao
Software Tools
vscode + platformIO
Applicability In the R&D learning and testing phase, there is engineering source code. You can use the development tool to compile the source code and download the program to the board. method of obtaining 1) Obtain it from the `Socket General Information/Software Tools/Development Software (platformIO self-installed)` directory, 2) You can also visit vscode official website to download https://code.visualstudio.com/
flash_download_tools
flash_download_tool_3.9.5: It is a very practical ESP module burning software
Applicability Factory stage, no source code, only bin, you can use this tool to download firmware method of obtaining 1) Obtain it from the `Socket General Information/Software Tools/Firmware Download` directory, 2) You can also visit Espressif’s official website to download https://www.espressif.com/zh-hans/support/download/other-tools
Wiring between the socket and USB to TTL module
Description of the location of the socket base plate and chip board
Weld 3.3V, gnd, RX, TX, IO9 from the chip board, among which 3.3V, gnd, RX, TX are connected to the 3.3V, gnd, TX, RX of USB to ttl; IO9 should be connected to the base board in download mode. GND is pulled low
The following line color descriptions (based on the pin numbers on the small board end of the chip):
Red: 3.3V
Black: gnd
Purple: RX
Blue: TX
Yellow: IO9
esp32-C3 version socket (4-pin base plate)
bin firmware and burning address
Serial number | bin name | Description | Burning address | Applicable products |
---|---|---|---|---|
1 | bootloader.bin | Start boot | 0x0 | Applicable to ssb, ssc products |
2 | partitions.bin | Partition | 0x8000 | Applicable to ssb, ssc products |
3 | boot_app0.bin | Start app0 | 0xe000 | Applicable to ssb, ssc products |
4 | firmware.bin | The main user program generated by platformIO | 0x10000 | Applicable to ssb, ssc products |
5 | littlefs.bin | File system generated by platformIO | 0x3B0000 | Applicable to ssb, ssc products |
View the bin address (the following part is for reference only)
For vscode + platformIO development method, you can create a new terminal under the project and enter
Get detailed programming address and information
pio run -v -t upload
Learned: The main information is as follows
–chip esp32c3
–flash_mode dio
–flash_freq 80m
–flash_size 4MB 0x0000
Under the project project.pio\build\esp32-c3-devkitm\bootloader.bin 0x0
Under the project project.pio\build\esp32-c3-devkitm\partitions.bin 0x8000
C drive user directory.platformio\packages\framework-arduinoespressif32\tools\partitions\boot_app0.bin 0xe000
Under the project project .pio\build\esp32-c3-devkitm\firmware.bin 0x10000
Get the detailed burning address and information of the file system program
pio run -v -t uploadfs
Learned: .pio\build\esp32-c3-devkitm\littlefs.bin 0x3B0000 under the project
In addition, if there is a customized partition.csv file, you can refer to the address definition in it.
Espressif official firmware download address:
https://docs.espressif.com/projects/esp-at/zh_CN/latest/esp32c3/AT_Binary_Lists/ESP32-C3_AT_binaries.html
esptool –chip esp32 –port COM11 write_flash -z 0x0000 D:\aa\firmware.bin
vscode + platformIO burning method
Note: In order to reduce welding wires, the chip is reset by powering off and on the chip. You can also solder the EN pin lead and pull EN low and high to reset the chip.
Compile and download
Open code project
First click the
Compile
button to compile the project.First enter the download mode (refer to 4.2), and then click the
Download
button
Compile and download button location screenshot
Compilation completed screenshot
Put the device into download mode
How to enter download mode 1. First power off the esp32-C3 module (disconnect the 3.3V connection between the usb to serial port module and esp32-C3) 2. Pull IO9 of the esp32-C3 module low (that is, connect IO9 of the chip board to the GND of the base board) 3. Then power on the esp32-C3 module (connect the 3.3V wiring between the usb to serial port module and esp32-C3) 4. When downloading, IO9 should always be pulled low (that is, the chip board IO9 should always be connected to the GND of the base board) 5. Wait until the download is complete. Note that IO9 of esp32-C3 needs to be led out from the chip board
Just wait for the download to complete
flash_download_tools burning method
Open flash_download_tools
Select ESP32-C3, other defaults, as shown in the figure
Select the firmware to be burned and fill in the corresponding address
Select the firmware to be burned. For the address, please refer to the bin firmware and burning address in Chapter 3 of this article. For specific reference configuration, please refer to the picture below.
Select the serial port, baud rate, and click Start
Finally, select the com port (the serial port for USB to serial) and bit rate, and click START to start.
Put the device into download mode
How to enter download mode 1. First power off the esp32-C3 module (disconnect the 3.3V connection between the usb to serial port module and esp32-C3) 2. Pull IO9 of the esp32-C3 module low (that is, connect IO9 of the chip board to the GND of the base board) 3. Then power on the esp32-C3 module (connect the 3.3V wiring between the usb to serial port module and esp32-C3) 4. When downloading, IO9 should always be pulled low (that is, the chip board IO9 should always be connected to the GND of the base board) 5. Wait until the download is complete. Note that IO9 of esp32-C3 needs to be led out from the chip board
esptool.py burning method
Install esptool
The prerequisite is to install python3
To check whether python is installed, you can open cmd, enter python and press Enter to check the python version. If it is not installed, please install it on Baidu yourself. As in my screenshot here:
After installing python, in the command line window
pip install esptool
Burning
Erase flash
esptool.py --port COM11 erase_flash illustrate: --port The port number of the USB-to-serial port that the PC connects to the device erase_flash erase operation
Burn *.bin
esptool.py --chip esp32-C3 --port COM11 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0000 D:\aa\bootloader .bin 0x8000 D:\aa\partitions.bin 0xe000 D:\aa\boot_app0.bin 0x10000 D:\aa\firmware.bin 0x3B0000 D:\aa\littlefs.bin Note: --chip chip model, modify according to your own situation --port The port number of the USB-to-serial port that the PC connects to the device is modified according to your own situation. --baud burning speed modified according to your own situation --before default_reset --after hard_reset reset both before and after write_flash write flash --flash_mode dio mode dio modified according to your own situation --flash_freq 80m frequency 80M Modify according to your own situation --flash_size 4MB, size 4M, modify according to your own situation Address + bin file Modify according to your own situation