|
|
5 лет назад | |
|---|---|---|
| .. | ||
| image | 5 лет назад | |
| main | 5 лет назад | |
| CMakeLists.txt | 5 лет назад | |
| README.md | 5 лет назад | |
Example demonstrates how to flash AT command firmware from one ESP32 to another using esp_serial_flash component API. Binary to be flashed has to be stored on SD card with fat filesystem. AT command firmware to copy onto SD card can be found in image folder. When other AT command firmware is stored on SD card, file name has to be changed in example accordingly.
Following steps are performed in order to re-program target's memory:
esp_loader_connect().esp_loader_flash_start() is called to enter flashing mode and erase amount of memory to be flashed.esp_loader_flash_write() function is called repeatedly until the whole binary image is transfered.ESP_WROVER_KIT (with SD card connector)Note: WROWER module(ESP32) to be flashed can be substituted with any other Espressif SoC as long as appropriate AT firmware version is used.
Table below shows connection between two ESP32 devices.
| ESP32 (host) | ESP32 (slave) |
|---|---|
| IO26 | IO0 |
| IO25 | RESET |
| IO4 | RX0 |
| IO5 | TX0 |
To run the example, type the following command:
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
For details about available configuration option, please refer to top level README.md. Compile definitions can be specified on command line when running idf.py, for example:
idf.py build -DTARGET_SOC=ESP32_S2 -DMD5_ENABLED=1
By default, example is compiled for ESP32 target with MD5 check disabled. When target is not ESP32, provide appropriate AT command firmware binary.
For available AT command firmwares refer to AT firmwares
Here is the example's console output:
...
I (342) example: Initializing SPIFFS
I (482) example: Image size: 144672
I (902) example: Connected to target
I (1732) example: Start programming
I (1832) example: packet: 0 written: 1024 B
I (1932) example: packet: 1 written: 1024 B
...
I (16052) example: packet: 140 written: 1024 B
I (16152) example: packet: 141 written: 288 B
I (16152) example: Finished programming