docs: Update getting started guide for ESP32-S2 target

This commit is contained in:
Krzysztof Budzynski 2020-03-05 05:05:23 +08:00
parent 582f5dd697
commit 2178e3fba4
2 changed files with 114 additions and 59 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View file

@ -2,6 +2,8 @@
Get Started
***********
{IDF_TARGET_CL:default = "esp32", esp32 = "esp32", esp32s2 = "esp32s2"}
:link_to_translation:`zh_CN:[中文]`
This document is intended to help you set up the software development environment for the hardware based on the {IDF_TARGET_NAME} chip by Espressif.
@ -13,23 +15,17 @@ After that, a simple example will show you how to use ESP-IDF (Espressif IoT Dev
Introduction
============
.. only:: esp32
{IDF_TARGET_NAME} is a system on a chip that integrates the following features:
{IDF_TARGET_NAME} is a system on a chip that integrates the following features:
* Wi-Fi (2.4 GHz band)
* Bluetooth
* Dual high performance cores
* Ultra Low Power co-processor
* Multiple peripherals
.. only:: esp32s2
{IDF_TARGET_NAME} is a system on a chip that integrates the following features:
.. list::
* Wi-Fi (2.4 GHz band)
:esp32: * Bluetooth
:esp32: * Dual high performance cores
* Ultra Low Power co-processor
* Multiple peripherals
:esp32s2: * Built-in security hardware
:esp32s2: * USB OTG interface
Powered by 40 nm technology, {IDF_TARGET_NAME} provides a robust, highly integrated platform, which helps meet the continuous demands for efficient power usage, compact design, security, high performance, and reliability.
@ -215,6 +211,7 @@ If changing the ``IDF_TOOLS_PATH``, make sure it is set to the same value every
.. _get-started-set-up-env:
Step 4. Set up the environment variables
========================================
@ -308,7 +305,7 @@ If you are not sure how to check the serial port name, please refer to :doc:`est
Step 7. Configure
=================
Navigate to your ``hello_world`` directory from :ref:`get-started-start-project` and run the project configuration utility ``menuconfig``.
Navigate to your ``hello_world`` directory from :ref:`get-started-start-project`, set {IDF_TARGET_NAME} chip as the target and run the project configuration utility ``menuconfig``.
Linux and macOS
~~~~~~~~~~~~~~~
@ -316,6 +313,7 @@ Linux and macOS
.. code-block:: bash
cd ~/esp/hello_world
idf.py set-target {IDF_TARGET_CL}
idf.py menuconfig
Windows
@ -324,8 +322,11 @@ Windows
.. code-block:: batch
cd %userprofile%\esp\hello_world
idf.py set-target {IDF_TARGET_CL}
idf.py menuconfig
Setting the target with ``idf.py set-target {IDF_TARGET}`` should be done once, after opening a new project. If the project contains some existing builds and configuration, they will be cleared and initialized. The target may be saved in environment variable to skip this step at all. See :ref:`selecting-idf-target` for additional information.
If the previous steps have been done correctly, the following menu appears:
.. figure:: ../../_static/project-configuration.png
@ -335,20 +336,7 @@ If the previous steps have been done correctly, the following menu appears:
Project configuration - Home window
.. note::
The colors of the menu could be different in your terminal. You can change the appearance with the option
``--style``. Please run ``idf.py menuconfig --help`` for further information.
To navigate and use ``menuconfig``, press the following keys:
* Arrow keys for navigation
* ``Enter`` to go into a submenu
* ``Esc`` to go up one level or exit
* ``?`` to see a help screen. Enter key exits the help screen
* ``Space``, or ``Y`` and ``N`` keys to enable (Yes) and disable (No) configuration items with checkboxes "``[*]``"
* ``?`` while highlighting a configuration item to display help about that item
* ``/`` to find configuration items
You are using this menu to set up project specific variables, e.g. Wi-Fi network name and password, the processor speed, etc. Setting up the project with menuconfig may be skipped for "hello_word". This example will run with default configuration.
.. only:: esp32
@ -356,6 +344,11 @@ To navigate and use ``menuconfig``, press the following keys:
If you use ESP32-DevKitC board with the **ESP32-SOLO-1** module, enable single core mode (:ref:`CONFIG_FREERTOS_UNICORE`) in menuconfig before flashing examples.
.. note::
The colors of the menu could be different in your terminal. You can change the appearance with the option
``--style``. Please run ``idf.py menuconfig --help`` for further information.
.. _get-started-build:
Step 8. Build the Project
@ -436,42 +429,91 @@ Depending on the kind of hardware you have, it may also be possible to manually
Normal Operation
~~~~~~~~~~~~~~~~
After resetting, you will see the output log similar to the following:
When flashing, you will see the output log similar to the following:
.. code-block:: bash
.. only:: esp32
Running esptool.py in directory [...]/esp/hello_world
Executing "python [...]/esp-idf/components/esptool_py/esptool/esptool.py -b 460800 write_flash @flash_project_args"...
esptool.py -b 460800 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 bootloader/bootloader.bin 0x8000 partition_table/partition-table.bin 0x10000 hello-world.bin
esptool.py v2.3.1
Connecting....
Detecting chip type... {IDF_TARGET_NAME}
Chip is {IDF_TARGET_NAME}D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0220
Compressed 22992 bytes to 13019...
Wrote 22992 bytes (13019 compressed) at 0x00001000 in 0.3 seconds (effective 558.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 82...
Wrote 3072 bytes (82 compressed) at 0x00008000 in 0.0 seconds (effective 5789.3 kbit/s)...
Hash of data verified.
Compressed 136672 bytes to 67544...
Wrote 136672 bytes (67544 compressed) at 0x00010000 in 1.9 seconds (effective 567.5 kbit/s)...
Hash of data verified.
.. code-block:: none
Leaving...
Hard resetting via RTS pin...
...
esptool.py --chip esp32 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v3.0-dev
Serial port /dev/ttyUSB0
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 24:0a:c4:05:b9:14
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 5962.8 kbit/s)...
Hash of data verified.
Compressed 26096 bytes to 15408...
Writing at 0x00001000... (100 %)
Wrote 26096 bytes (15408 compressed) at 0x00001000 in 0.4 seconds (effective 546.7 kbit/s)...
Hash of data verified.
Compressed 147104 bytes to 77364...
Writing at 0x00010000... (20 %)
Writing at 0x00014000... (40 %)
Writing at 0x00018000... (60 %)
Writing at 0x0001c000... (80 %)
Writing at 0x00020000... (100 %)
Wrote 147104 bytes (77364 compressed) at 0x00010000 in 1.9 seconds (effective 615.5 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Done
.. only:: esp32s2
.. code-block:: none
...
esptool.py --chip esp32s2 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v3.0-dev
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-S2
Features: WiFi
Crystal is 40MHz
MAC: 18:fe:34:72:50:e3
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 3851.6 kbit/s)...
Hash of data verified.
Compressed 22592 bytes to 13483...
Writing at 0x00001000... (100 %)
Wrote 22592 bytes (13483 compressed) at 0x00001000 in 0.3 seconds (effective 595.1 kbit/s)...
Hash of data verified.
Compressed 140048 bytes to 70298...
Writing at 0x00010000... (20 %)
Writing at 0x00014000... (40 %)
Writing at 0x00018000... (60 %)
Writing at 0x0001c000... (80 %)
Writing at 0x00020000... (100 %)
Wrote 140048 bytes (70298 compressed) at 0x00010000 in 1.7 seconds (effective 662.5 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Done
If there are no issues by the end of the flash process, the board will reboot and start up the “hello_world” application.
.. (Not currently supported) If you'd like to use the Eclipse IDE instead of running ``idf.py``, check out the :doc:`Eclipse guide <eclipse-setup>`.
If you'd like to use the Eclipse IDE instead of running ``idf.py``, check out the :doc:`Eclipse guide <eclipse-setup>`.
.. _get-started-build-monitor:
@ -510,7 +552,7 @@ To exit IDF monitor use the shortcut ``Ctrl+]``.
.. only:: esp32
If IDF monitor fails shortly after the upload, or, if instead of the messages above, you see random garbage similar to what is given below, your board is likely using a 26MHz crystal. Most development board designs use 40MHz, so ESP-IDF uses this frequency as a default value.
If IDF monitor fails shortly after the upload, or, if instead of the messages above, you see random garbage similar to what is given below, your board is likely using a 26 MHz crystal. Most development board designs use 40 MHz, so ESP-IDF uses this frequency as a default value.
.. figure:: ../../_static/get-started-garbled-output.png
:align: center
@ -521,7 +563,7 @@ To exit IDF monitor use the shortcut ``Ctrl+]``.
1. Exit the monitor.
2. Go back to :ref:`menuconfig <get-started-configure>`.
3. Go to Component config --> ESP32-specific --> Main XTAL frequency, then change :ref:`CONFIG_ESP32_XTAL_FREQ_SEL` to 26MHz.
3. Go to Component config --> ESP32-specific --> Main XTAL frequency, then change :ref:`CONFIG_ESP32_XTAL_FREQ_SEL` to 26 MHz.
4. After that, :ref:`build and flash <get-started-flash>` the application again.
.. note::
@ -539,6 +581,19 @@ See also:
Now you are ready to try some other :idf:`examples`, or go straight to developing your own applications.
.. important::
Some of examples do not support {IDF_TARGET_NAME} because required hardware is not included in {IDF_TARGET_NAME} so it cannot be supported.
.. only:: esp32
If building an example, please check the example CMakeLists.txt file for the clause ``SUPPORTED_TARGETS esp32``. If this is present including ``esp32`` target, or ``SUPPORTED_TARGETS`` does not exist at all, the example will work on {IDF_TARGET_NAME}.
.. only:: esp32s2
If building an example, please check the example CMakeLists.txt file for the clause ``SUPPORTED_TARGETS esp32s2``. If this is present including ``esp32s2`` target, or ``SUPPORTED_TARGETS`` does not exist at all, the example will work on {IDF_TARGET_NAME}.
Updating ESP-IDF
================