doc: provide project background

This commit is contained in:
King Kévin 2022-10-24 14:15:36 +02:00
parent 3865612f0c
commit 24f7828766
1 changed files with 42 additions and 30 deletions

View File

@ -1,6 +1,48 @@
This is a [USB DFU](https://www.usb.org/document-library/device-firmware-upgrade-11-new-version-31-aug-2004) (DFU mode) implementation for [ESP32-S2](https://www.espressif.com/en/products/socs/esp32-s2) based on [tinyUSB](https://docs.tinyusb.org/en/latest/index.html).
It allows flashing the firmware using [dfu-util](http://dfu-util.sourceforge.net/).
background
==========
ESP-ROM
-------
The ESP-S2 comes with a ROM bootloader that already allows you to flash over USB using the serial CDC ACM profile.
But this method does not let you restart into the main firmware.
The ROM bootloader USB stack even offers DFU capability, and you can flash using dfu-util.
But this one also does not let you restart into the main firmware.
To flash using USB serial (can't restart the device):
~~~
idf.py -p /dev/ttyACM0 flash
...
WARNING: ESP32-S2 chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.
~~~
And to [flash using DFU](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/dfu.html):
~~~
# generate the DFU binary (not the same as the usual flash binary)
idf.py dfu
dfu-util --device 303a:0002 --download build/dfu.bin
# or
idf.py dfu-flash
~~~
Note: after detaching, the bootloader claims for be in runtime mode, but this is still the bootloader, and not the flashed firmware.
mode switch
-----------
To switch from the ESP32-S2 ROM bootloader back to the firmware flashed over USB, you need to press the reset button.
This is cumbersome when developing firmware, and sometimes impossible if the board is encased or installed remotely.
This USB DFU implementation allows to switch back to runtime mode without pressing a button.
The runtime firmware can also reboot into the DFU mode without pressing a button.
install
=======
@ -94,36 +136,6 @@ Feel free to reuse the 'partitions.csv' file as example.
alternatives
============
ESP-ROM
-------
The ESP-S2 comes with a ROM bootloader that already allows you to flash over USB using the serial CDC ACM profile.
But this method does not let you restart into the main firmware.
The ROM bootloader USB stack even offers DFU capability, and you can flash using dfu-util.
But this one also does not let you restart into the main firmware.
To flash using USB serial (can't restart the device):
~~~
idf.py -p /dev/ttyACM0 flash
...
WARNING: ESP32-S2 chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.
~~~
And to [flash using DFU](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/dfu.html):
~~~
# generate the DFU binary (not the same as the usual flash binary)
idf.py dfu
dfu-util --device 303a:0002 --download build/dfu.bin
# or
idf.py dfu-flash
~~~
Note: after detaching, the bootloader claims for be in runtime mode, but this is still the bootloader, and not the flashed firmware.
TinyUF2
-------