Crc Check For Wake Stubs; Device Firmware Upgrade Through Usb; Building The Dfu Image; Flashing The Chip With The Dfu Image - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 4. API Guides

4.5.5 CRC Check For Wake Stubs

During deep sleep, all RTC Fast memory areas will be validated with CRC. When ESP32-S2 wakes up from deep
sleep, the RTC fast memory will be validated with CRC again. If the validation passes, the wake stubs code will be
executed. Otherwise, the normal initialization, bootloader and esp-idf codes will be executed.
Note: When the CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP option is enabled, all the RTC fast
memory except the wake stubs area is added to the heap.

4.6 Device Firmware Upgrade through USB

Device Firmware Upgrade (DFU) is a mechanism for upgrading the firmware of devices through Universal Serial
Bus (USB). DFU is supported by ESP32-S2 chips. The necessary connections for the USB peripheral are shown in
the following table.
Note: The ESP32-S2 chip needs to be in bootloader mode for the detection as a DFU device and flashing. This
can be achieved by pulling GPIO0 down (e.g. pressing the BOOT button), pulsing RESET down for a moment and
releasing GPIO0.
Warning: Some cables are wired up with non-standard colors and some drivers are able to work with swapped
D+ and D- connections. Please try to swap the cables connecting to D+ and D- if your device is not detected.
The software requirements of DFU are included in
Section

Building the DFU Image

Chip with the DFU Image
deals with flashing the firmware.
4.6.1 Building the DFU Image
The DFU image can be created by running:
idf.py dfu
which creates dfu.bin in the build directory.
Note: Don't forget to set the target chip by idf.py set-target before running idf.py dfu. Otherwise,
you might create an image for a different chip or receive an error message something like unknown target
'dfu'.

4.6.2 Flashing the Chip with the DFU Image

The DFU image is downloaded into the chip by running:
Espressif Systems
GPIO
USB
20
D+ (green)
19
D- (white)
GND
GND (black)
+5V
+5V (red)
Step 1. Install prerequisites
describes how to build firmware for DFU with ESP-IDF and Section
1301
Submit Document Feedback
of the Getting Started Guide.
Flashing the
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF