text
stringlengths
1
3.82k
__index_level_0__
int64
0
366
Standard Setup of Toolchain for Windows Introduction ESP-IDF requires some prerequisite tools to be installed so you can build firmware for supported chips. The prerequisite tools include Python, Git, cross-compilers, CMake and Ninja build tools. For this Getting Started we are going to use the Command Prompt, but after ESP-IDF is installed you can use `Eclipse Plugin `_ or another graphical IDE with CMake support instead. .. note:: Limitations: - The installation path of ESP-IDF and ESP-IDF Tools must not be longer than 90 characters. Too long installation paths might result in a failed build. - The installation path of Python or ESP-IDF must not contain white spaces or parentheses. - The installation path of Python or ESP-IDF should not contain special characters (non-ASCII) unless the operating system is configured with "Unicode UTF-8" support. System Administrator can enable the support via ``Control Panel`` > Change ``date``, ``time``, or ``number`` formats > ``Administrative tab`` > Change ``system locale`` > check the option ``Beta: Use Unicode UTF-8 for worldwide language support`` > ``Ok`` > reboot the computer.
327
.. _get-started-windows-tools-installer: ESP-IDF Tools Installer The easiest way to install ESP-IDF's prerequisites is to download one of ESP-IDF Tools Installers. +++ | |download-logo| | `Windows Installer Download`_ | +++ .. |download-logo| image:: ../../_static/logo_windows_install.png :target: https://dl.espressif.com/dl/esp-idf/?idf=4.4 .. _Windows Installer Download: https://dl.espressif.com/dl/esp-idf/?idf=4.4 What Is the Usecase for Online and Offline Installer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Online Installer is very small and allows the installation of all available releases of ESP-IDF. The installer downloads only necessary dependencies including `Git For Windows`_ during the installation process. The installer stores downloaded files in the cache directory ``%userprofile%\.espressif`` Offline Installer does not require any network connection. The installer contains all required dependencies including `Git For Windows`_ . Components of the Installation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The installer deploys the following components: - Embedded Python - Cross-compilers - OpenOCD - CMake_ and Ninja_ build tools - ESP-IDF The installer also allows reusing the existing directory with ESP-IDF.
327
The recommended directory is ``%userprofile%\Desktop\esp-idf`` where ``%userprofile%`` is your home directory. Launching ESP-IDF Environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ At the end of the installation process you can check out option ``Run ESP-IDF PowerShell Environment`` or ``Run ESP-IDF Command Prompt (cmd.exe)``. The installer launches ESP-IDF environment in selected prompt. ``Run ESP-IDF PowerShell Environment``: .. figure:: ../../_static/esp-idf-installer-screenshot-powershell.png :align: center :alt: Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF PowerShell Environment :figclass: align-center Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF PowerShell Environment .. figure:: ../../_static/esp-idf-installer-powershell.png :align: center :alt: ESP-IDF PowerShell :figclass: align-center ESP-IDF PowerShell ``Run ESP-IDF Command Prompt (cmd.exe)``: .. figure:: ../../_static/esp-idf-installer-screenshot.png :align: center :alt: Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF Command Prompt (cmd.
327
exe) :figclass: align-center Completing the ESP-IDF Tools Setup Wizard with Run ESP-IDF Command Prompt (cmd.exe) .. figure:: ../../_static/esp-idf-installer-command-prompt.png :align: center :alt: ESP-IDF Command Prompt :figclass: align-center ESP-IDF Command Prompt Using the Command Prompt For the remaining Getting Started steps, we are going to use the Windows Command Prompt. ESP-IDF Tools Installer also creates a shortcut in the Start menu to launch the ESP-IDF Command Prompt. This shortcut launches the Command Prompt (cmd.exe) and runs ``export.bat`` script to set up the environment variables (``PATH``, ``IDF_PATH`` and others). Inside this command prompt, all the installed tools are available. Note that this shortcut is specific to the ESP-IDF directory selected in the ESP-IDF Tools Installer. If you have multiple ESP-IDF directories on the computer (for example, to work with different versions of ESP-IDF), you have two options to use them: First Steps on ESP-IDF .
327
. _get-started-windows-first-steps: .. include:: windows-start-project.rst .. include:: start-project.rst Related Documents For advanced users who want to customize the install process: .. toctree:: :hidden: :maxdepth: 1 windows-setup-update establish-serial-connection flashing-troubleshooting .. _CMake: https://cmake.org/download/ .. _Ninja: https://ninja-build.org/ .. _Python: https://www.python.org/downloads/windows/ .. _Git for Windows: https://gitforwindows.org/ .. _Github Desktop: https://desktop.github.com/
327
Standard Toolchain Setup for Linux and macOS Installation Step by Step This is a detailed roadmap to walk you through the installation process. Setting up Development Environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These are the steps for setting up the ESP-IDF for your {IDF_TARGET_NAME}. .. _get-started-prerequisites: Step 1. Install Prerequisites In order to use ESP-IDF with the {IDF_TARGET_NAME}, you need to install some software packages based on your Operating System. This setup guide helps you on getting everything installed on Linux and macOS based systems. For Linux Users ~~~~~~~~~~~~~~~ To compile using ESP-IDF, you need to get the following packages. The command to run depends on which distribution of Linux you are using: - Ubuntu and Debian:: sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 - CentOS 7 & 8:: sudo yum -y update && sudo yum install git wget flex bison gperf python3 cmake ninja-build ccache dfu-util libusbx CentOS 7 is still supported but CentOS version 8 is recommended for a better user experience.
328
- Arch:: sudo pacman -S --needed gcc git make flex bison gperf python cmake ninja ccache dfu-util libusb .. note:: - CMake version 3.16 or newer is required for use with ESP-IDF. Run "tools/idf_tools.py install cmake" to install a suitable version if your OS versions does not have one. - If you do not see your Linux distribution in the above list then please check its documentation to find out which command to use for package installation. For macOS Users ~~~~~~~~~~~~~~~ ESP-IDF uses the version of Python installed by default on macOS. - Install CMake & Ninja build: - If you have HomeBrew_, you can run:: brew install cmake ninja dfu-util - If you have MacPorts_, you can run:: sudo port install cmake ninja dfu-util - Otherwise, consult the CMake_ and Ninja_ home pages for macOS installation downloads. - It is strongly recommended to also install ccache_ for faster builds. If you have HomeBrew_, this can be done via ``brew install ccache`` or ``sudo port install ccache`` on MacPorts_.
328
.. note:: If an error like this is shown during any step:: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Then you need to install the XCode command line tools to continue. You can install these by running ``xcode-select --install``. Apple M1 Users ~~~~~~~~~~~~~~ If you use Apple M1 platform and see an error like this:: WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found ERROR: tool xtensa-esp32-elf has no installed versions. Please run 'install.sh' to install it. or:: zsh: bad CPU type in executable: ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc Then you need to install Apple Rosetta 2 by running .. code-block:: bash /usr/sbin/softwareupdate --install-rosetta --agree-to-license Installing Python 3 ~~~~~~~~~~~~~~~~~~~ Based on macOS `Catalina 10.
328
15 release notes`_, use of Python 2.7 is not recommended and Python 2.7 is not included by default in future versions of macOS. Check what Python you currently have:: python --version If the output is like ``Python 2.7.17``, your default interpreter is Python 2.7. If so, also check if Python 3 is not already installed on your computer:: python3 --version If the above command returns an error, it means Python 3 is not installed. Below is an overview of the steps to install Python 3. - Installing with HomeBrew_ can be done as follows:: brew install python3 - If you have MacPorts_, you can run:: sudo port install python38 .. _get-started-get-esp-idf: Step 2. Get ESP-IDF To build applications for the {IDF_TARGET_NAME}, you need the software libraries provided by Espressif in `ESP-IDF repository `_. To get ESP-IDF, navigate to your installation directory and clone the repository with ``git clone``, following instructions below specific to your operating system.
328
Open Terminal, and run the following commands: .. include-build-file:: inc/git-clone-bash.inc ESP-IDF is downloaded into ``~/esp/esp-idf``. Consult :doc:`/versions` for information about which ESP-IDF version to use in a given situation. .. _get-started-set-up-tools: Step 3. Set up the Tools Aside from the ESP-IDF, you also need to install the tools used by ESP-IDF, such as the compiler, debugger, Python packages, etc, for projects supporting {IDF_TARGET_NAME}. .. code-block:: bash cd ~/esp/esp-idf ./install.sh {IDF_TARGET_PATH_NAME} or with Fish shell .. code-block:: fish cd ~/esp/esp-idf ./install.fish {IDF_TARGET_PATH_NAME} The above commands install tools for {IDF_TARGET_NAME} only. If you intend to develop projects for more chip targets then you should list all of them and run for example: .. code-block:: bash cd ~/esp/esp-idf ./install.sh esp32,esp32s2 or with Fish shell .. code-block:: fish cd ~/esp/esp-idf ./install.fish esp32,esp32s2 In order to install tools for all supported targets please run the following command: .
328
. code-block:: bash cd ~/esp/esp-idf ./install.sh all or with Fish shell .. code-block:: fish cd ~/esp/esp-idf ./install.fish all .. note:: For macOS users, if an error like this is shown during any step:: `_. Alternative File Downloads ~~~~~~~~~~~~~~~~~~~~~~~~~~ The tools installer downloads a number of files attached to GitHub Releases. If accessing GitHub is slow then it is possible to set an environment variable to prefer Espressif's download server for GitHub asset downloads. .. note:: This setting only controls individual tools downloaded from GitHub releases, it does not change the URLs used to access any Git repositories. To prefer the Espressif download server when installing tools, use the following sequence of commands when running ``install.sh``: .. code-block:: bash cd ~/esp/esp-idf export IDF_GITHUB_ASSETS="dl.espressif.com/github_assets" ./install.sh .. note:: For users in China, we recommend using our download server located in China for faster download speed.
328
.. code-block:: bash cd ~/esp/esp-idf export IDF_GITHUB_ASSETS="dl.espressif.cn/github_assets" ./install.sh Customizing the Tools Installation Path ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The scripts introduced in this step install compilation tools required by ESP-IDF inside the user home directory: ``$HOME/.espressif`` on Linux. If you wish to install the tools into a different directory, **export the environment variable IDF_TOOLS_PATH before running the installation scripts**. Make sure that your user account has sufficient permissions to read and write this path. .. code-block:: bash export IDF_TOOLS_PATH="$HOME/required_idf_tools_path" ./install.sh . ./export.sh If changing the ``IDF_TOOLS_PATH``, make sure it is exported in the environment before running any ESP-IDF tools or scripts. .. note:: Using ``IDF_TOOLS_PATH`` in variable assignement, e.g., ``IDF_TOOLS_PATH="$HOME/required_idf_tools_path" ./install.sh``, without prior exporting, will not work in most shells because the variable assignment will not affect the current execution environment, even if it's exported/changed in the sourced script.
328
.. _get-started-set-up-env: Step 4. Set up the Environment Variables The installed tools are not yet added to the PATH environment variable. To make the tools usable from the command line, some environment variables must be set. ESP-IDF provides another script which does that. In the terminal where you are going to use ESP-IDF, run: .. code-block:: bash . $HOME/esp/esp-idf/export.sh or for fish (supported only since fish version 3.0.0): .. code-block:: bash . $HOME/esp/esp-idf/export.fish Note the space between the leading dot and the path! If you plan to use esp-idf frequently, you can create an alias for executing ``export.sh``: .. code-block:: bash alias get_idf='. $HOME/esp/esp-idf/export.sh' Now you can run ``get_idf`` to set up or refresh the esp-idf environment in any terminal session. Technically, you can add ``export.sh`` to your shell's profile directly; however, it is not recommended. Doing so activates IDF virtual environment in every terminal session (including those where IDF is not needed), defeating the purpose of the virtual environment and likely affecting other software.
328
.. _get-started-start-a-project: .. _get-started-build: .. _get-started-configure: .. _get-started-connect: .. _get-started-linux-macos-first-steps: Step 5. First Steps on ESP-IDF .. include:: linux-macos-start-project.rst .. include:: start-project.rst Tip: Updating ESP-IDF It is recommended to update ESP-IDF from time to time, as newer versions fix bugs and/or provide new features. Please note that each ESP-IDF major and minor release version has an associated support period, and when one release branch is approaching end of life (EOL), all users are encouraged to upgrade their projects to more recent ESP-IDF releases, to find out more about support periods, see :doc:`ESP-IDF Versions `. The simplest way to do the update is to delete the existing ``esp-idf`` folder and clone it again, as if performing the initial installation described in :ref:`get-started-get-esp-idf`. Another solution is to update only what has changed. :ref:`The update procedure depends on the version of ESP-IDF you are using `.
328
After updating ESP-IDF, execute the Install script again, in case the new ESP-IDF version requires different versions of tools. See instructions at :ref:`get-started-set-up-tools`. Once the new tools are installed, update the environment using the Export script. See instructions at :ref:`get-started-set-up-env`. Related Documents .. toctree:: :hidden: :maxdepth: 1 establish-serial-connection flashing-troubleshooting .. _AUR: https://wiki.archlinux.org/index.php/Arch_User_Repository .. _First Steps on ESP-IDF: ../get-started/first-steps.html .. _cmake: https://cmake.org/ .. _ninja: https://ninja-build.org/ .. _ccache: https://ccache.dev/ .. _homebrew: https://brew.sh/ .. _MacPorts: https://www.macports.org/install.php .. _Catalina 10.15 release notes: https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes
328
{IDF_TARGET_FEATURES:default="[NEEDS TO BE UPDATED]", esp32="WiFi/BT/BLE, silicon revision 1, 2 MB external flash", esp32s2="WiFi, silicon revision 0, 2 MB external flash", esp32s3="This is esp32s3 chip with 2 CPU core(s), WiFi/BLE, silicon revision 0, 2 MB external flash", esp32c2="WiFi/BLE, silicon revision 0, 2 MB embedded flash", esp32c3="WiFi/BLE, silicon revision 0, 2 MB external flash", esp32c6="WiFi/BLE, 802.15.4 (Zigbee/Thread), silicon revision v0.0, 2 MB external flash", esp32h2="BLE, 802.15.4 (Zigbee/Thread), silicon revision v0.1, 2 MB external flash"} {IDF_TARGET_HEAP_SIZE:default="[NEEDS TO BE UPDATED]", esp32="298968", esp32s2="253900", esp32s3="390684", esp32c2="203888", esp32c3="337332", esp32c6="473816", esp32h2="268256"} Build the Project Build the project by running: .. code-block:: batch idf.py build This command compiles the application and all ESP-IDF components, then it generates the bootloader, partition table, and application binaries. .. code-block:: none $ idf.
329
py build Running cmake in directory /path/to/hello_world/build Executing "cmake -G Ninja --warn-uninitialized /path/to/hello_world"... Warn about uninitialized values. -- Found Git: /usr/bin/git (found version "2.17.0") -- Building empty aws_iot component due to configuration -- Component names: ... -- Component paths: ... ... (more lines of build system output) [527/527] Generating hello_world.bin esptool.py v2.3.1 Project build complete. To flash, run this command: ../../../components/esptool_py/esptool/esptool.py -p (PORT) -b 921600 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x10000 build/hello_world.bin build 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin or run 'idf.py -p PORT flash' If there are no errors, the build finishes by generating the firmware binary .bin files. Flash onto the Device To flash the binaries that you just built for the {IDF_TARGET_NAME} in the previous step, you need to run the following command: .
329
. code-block:: bash idf.py -p PORT flash Replace ``PORT`` with your {IDF_TARGET_NAME} board's USB port name. If the ``PORT`` is not defined, the :ref:`idf.py` will try to connect automatically using the available USB ports. For more information on ``idf.py`` arguments, see :ref:`idf.py`. .. note:: The option ``flash`` automatically builds and flashes the project, so running ``idf.py build`` is not necessary. Encountered Issues While Flashing? See the "Additional Tips" below. You can also refer to :doc:`flashing-troubleshooting` page or :doc:`establish-serial-connection` for more detailed information. Normal Operation ~~~~~~~~~~~~~~~~ When flashing, you will see the output log similar to the following: .. include:: {IDF_TARGET_PATH_NAME}_output_log.inc :start-after: output_log If there are no issues by the end of the flash process, the board will reboot and start up the "hello_world" application. If you would like to use the Eclipse or VS Code IDE instead of running ``idf.
329
py``, check out `Eclipse Plugin `_, `VSCode Extension `_. Monitor the Output To check if "hello_world" is indeed running, type ``idf.py -p PORT monitor`` (Do not forget to replace PORT with your serial port name). This command launches the :doc:`IDF Monitor ` application:: $ idf.py -p monitor Running idf_monitor in directory [...]/esp/hello_world/build Executing "python [...]/esp-idf/tools/idf_monitor.py -b 115200 [...]/esp/hello_world/build/hello_world.elf"... --- idf_monitor on 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 ... After startup and diagnostic logs scroll up, you should see "Hello world!" printed out by the application. .. code-block:: none ... Hello world! Restarting in 10 seconds... This is {IDF_TARGET_PATH_NAME} chip with {IDF_TARGET_SOC_CPU_CORES_NUM} CPU core(s), {IDF_TARGET_FEATURES} Minimum free heap size: {IDF_TARGET_HEAP_SIZE} bytes Restarting in 9 seconds.
329
.. Restarting in 8 seconds... Restarting in 7 seconds... To exit IDF monitor use the shortcut ``Ctrl+]``. .. only:: esp32 or esp32c2 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 :alt: Garbled output :figclass: align-center If you have such a problem, do the following: In the current version of ESP-IDF, main XTAL frequencies supported by {IDF_TARGET_NAME} are as follows: .. list:: :SOC_XTAL_SUPPORT_24M: - 24 MHz :SOC_XTAL_SUPPORT_26M: - 26 MHz :SOC_XTAL_SUPPORT_32M: - 32 MHz :SOC_XTAL_SUPPORT_40M: - 40 MHz .. note:: You can combine building, flashing and monitoring into one step by running:: idf.
329
py -p PORT flash monitor See also: - :doc:`IDF Monitor ` for handy shortcuts and more details on using IDF monitor. - :ref:`idf.py` for a full reference of ``idf.py`` commands and options. **That is all that you need to get started with {IDF_TARGET_NAME}!** 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. If building an example, please check the README file for the ``Supported Targets`` table. If this is present including {IDF_TARGET_NAME} target, or the table does not exist at all, the example will work on {IDF_TARGET_NAME}. Additional Tips Permission Denied Issue ~~~~~~~~~~~~~~~~~~~~~~~~ With some Linux distributions, you may get the error message similar to ``Could not open port : Permission denied: ''`` when flashing the {IDF_TARGET_NAME}. :ref:`This can be solved by adding the current user to the specific group `, such as ``dialout`` or ``uucp`` group.
329
Python Compatibility ~~~~~~~~~~~~~~~~~~~~ ESP-IDF supports Python 3.8 or newer. It is recommended to upgrade your operating system to a recent version satisfying this requirement. Other options include the installation of Python from `sources `_ or the use of a Python version management system such as `pyenv `_. .. only:: esp32 or esp32s2 or esp32s3 .. When adding new targets to the line above, please update this list in windows-start-project.rst and linux-macos-start-project.rst Start with Board Support Package ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To speed up prototyping on some development boards, you can use `Board Support Packages (BSPs) `_, which makes initialization of a particular board as easy as few function calls. A BSP typically supports all of the hardware components provided on development board. Apart from the pinout definition and initialization functions, a BSP ships with drivers for the external components such as sensors, displays, audio codecs etc.
329
The BSPs are distributed via :doc:`IDF Component Manager `, so they can be found in `IDF Component Registry `_. .. only:: esp32 **Here is an example of how to add ESP-WROVER-KIT BSP to your project:** .. code-block:: bash idf.py add-dependency esp_wrover_kit .. only:: esp32s2 **Here is an example of how to add ESP32-S2-Kaluga-Kit BSP to your project:** .. code-block:: bash idf.py add-dependency esp32_s2_kaluga_kit .. only:: esp32s3 **Here is an example of how to add ESP-BOX BSP to your project:** .. code-block:: bash idf.py add-dependency esp-box More examples of BSP usage can be found in `BSP examples folder `_. Flash Erase ~~~~~~~~~~~ Erasing the flash is also possible. To erase the entire flash memory you can run the following command: .. code-block:: bash idf.py -p PORT erase-flash For erasing the OTA data, if present, you can run this command: .. code-block:: bash idf.
329
py -p PORT erase-otadata The flash erase command can take a while to be done. Do not disconnect your device while the flash erasing is in progress.
329
Updating ESP-IDF Tools on Windows .. _get-started-install_bat-windows: Install ESP-IDF Tools Using a Script From the Windows Command Prompt, change to the directory where ESP-IDF is installed. Then run:: install.bat For Powershell, change to the directory where ESP-IDF is installed. Then run:: install.ps1 This downloads and installs the tools necessary to use ESP-IDF. If the specific version of the tool is already installed, no action will be taken. The tools are downloaded and installed into a directory specified during ESP-IDF Tools Installer process. By default, this is ``C:\Users\username\.espressif``. .. _get-started-export_bat-windows: Add ESP-IDF Tools to PATH Using an Export Script ESP-IDF tools installer creates a Start menu shortcut for "ESP-IDF Command Prompt". This shortcut opens a Command Prompt window where all the tools are already available. In some cases, you may want to work with ESP-IDF in a Command Prompt window which was not started using that shortcut.
330
If this is the case, follow the instructions below to add ESP-IDF tools to PATH. In the command prompt where you need to use ESP-IDF, change to the directory where ESP-IDF is installed, then execute ``export.bat``:: cd %userprofile%\esp\esp-idf export.bat Alternatively in the Powershell where you need to use ESP-IDF, change to the directory where ESP-IDF is installed, then execute ``export.ps1``:: cd ~/esp/esp-idf export.ps1 When this is done, the tools will be available in this command prompt.
330
Now since all requirements are met, the next topic guides you on how to start your first project. This guide helps you on the first steps using ESP-IDF. Follow this guide to start a new project on the {IDF_TARGET_NAME} and build, flash, and monitor the device output. .. note:: If you have not yet installed ESP-IDF, please go to :ref:`get-started-step-by-step` and follow the instruction in order to get all the software needed to use this guide. Start a Project Now you are ready to prepare your application for {IDF_TARGET_NAME}. You can start with :example:`get-started/hello_world` project from :idf:`examples` directory in ESP-IDF. .. important:: The ESP-IDF build system does not support spaces in the paths to either ESP-IDF or to projects. Copy the project :example:`get-started/hello_world` to ``~/esp`` directory: .. code-block:: batch cd %userprofile%\esp xcopy /e /i %IDF_PATH%\examples\get-started\hello_world hello_world .. note:: There is a range of example projects in the :idf:`examples` directory in ESP-IDF.
331
You can copy any project in the same way as presented above and run it. It is also possible to build examples in-place without copying them first. Connect Your Device Now connect your {IDF_TARGET_NAME} board to the computer and check under which serial port the board is visible. Serial port names start with ``COM`` in Windows. If you are not sure how to check the serial port name, please refer to :doc:`establish-serial-connection` for full details. .. note:: Keep the port name handy as it is needed in the next steps. Configure Your Project Navigate to your ``hello_world`` directory, set {IDF_TARGET_NAME} as the target, and run the project configuration utility ``menuconfig``. Windows ~~~~~~~ .. code-block:: batch cd %userprofile%\esp\hello_world idf.py set-target {IDF_TARGET_PATH_NAME} idf.py menuconfig After opening a new project, you should first set the target with ``idf.py set-target {IDF_TARGET_PATH_NAME}``. Note that existing builds and configurations in the project, if any, are cleared and initialized in this process.
331
The target may be saved in the 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 :align: center :alt: Project configuration - Home window Project configuration - Home window 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", since this example runs with default configuration. .. only:: esp32 .. attention:: If you use ESP32-DevKitC board with the **ESP32-SOLO-1** module, or ESP32-DevKitM-1 board with the **ESP32-MIN1-1/1U** module, please 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``.
331
Please run ``idf.py menuconfig --help`` for further information. .. only:: esp32 or esp32s2 or esp32s3 If you are using one of the supported development boards, you can speed up your development by using Board Support Package. See `Additional Tips `__ for more information. .. only:: esp32s2 To use the USB for flashing the {IDF_TARGET_NAME}, you need to change the channel for the console output to USB. For the {IDF_TARGET_NAME}, the default console output channel is the UART. ``Component config ---> ESP System Settings ---> Channel for console output`` ``USB CDC``
331
Establish Serial Connection with {IDF_TARGET_NAME} .. only:: not SOC_USB_OTG_SUPPORTED and not SOC_USB_SERIAL_JTAG_SUPPORTED Establishing a serial connection with the {IDF_TARGET_NAME} target device could be done using a USB-to-UART bridge. .. only:: SOC_USB_OTG_SUPPORTED or SOC_USB_SERIAL_JTAG_SUPPORTED Establishing a serial connection with the {IDF_TARGET_NAME} target device could be done using USB-to-UART bridge or USB peripheral supported in {IDF_TARGET_NAME}. Some development boards have the USB-to-UART bridge installed. If a board does not have a bridge then an external bridge may be used. .. only:: SOC_USB_OTG_SUPPORTED or SOC_USB_SERIAL_JTAG_SUPPORTED Supported USB Peripheral The {IDF_TARGET_NAME} supports the USB peripheral. In this case, the USB-to-UART bridge is not needed and the device can be flashed directly. .. blockdiag:: :scale: 70% :caption: SoC with Supported USB :align: center blockdiag usb_capable_esp { node_height = 80; span_width = 160; span_height = 140; default_fontsize = 16 # labels of diagram nodes PC [label="Personal\n Computer"]; CHIP [label="{IDF_TARGET_NAME}", width=120]; DUMMY [shape=none, width=1] # node connections PC CHIP [fontsize=14]; group { shape = line; style = dotted; color = "#FF0000"; label = "Development Board\n\n\n"; CHIP; DUMMY; } } Apart from the USB peripheral, some development boards also include the USB-to-UART bridge.
332
USB-to-UART Bridge on Development Board For boards with an installed USB-to-UART bridge, the connection between the personal computer and the bridge is USB and between the bridge and {IDF_TARGET_NAME} is UART. .. blockdiag:: :caption: Development Board with USB-to-UART Bridge :align: center blockdiag esp_dev_board_with_usb_to_uart_bridge { node_height = 80; span_width = 160; span_height = 140; default_fontsize = 16 # labels of diagram nodes PC [label="Personal\nComputer"]; BRIDGE [label="USB-to-UART\n Bridge"]; CHIP [label="{IDF_TARGET_NAME}", width=120]; # node connections PC BRIDGE [label = "USB", fontsize=14]; BRIDGE CHIP [label = "UART", fontsize=14]; group { shape = line; style = dotted; color = "#FF0000"; label = "Development Board\n\n\n"; BRIDGE; CHIP; } } External USB-to-UART Bridge Sometimes the USB-to-UART bridge is external.
332
This is often used in small development boards or finished products when space and costs are crucial. .. blockdiag:: :caption: External USB-to-UART Bridge :align: center blockdiag external_usb_to_uart_bridge_to_esp { node_height = 80; span_width = 160; span_height = 140; default_fontsize = 16 # labels of diagram nodes PC [label="Personal\n Computer"]; BRIDGE [label="USB-to-UART\n Bridge", width=180]; CHIP [label="{IDF_TARGET_NAME}", width=120]; DUMMY [shape=none, width=1] # node connections PC BRIDGE [label = "USB", fontsize=14]; BRIDGE CHIP [fontsize=14]; group { shape = line; style = dotted; color = "#FF0000"; label = "Programmer Board\n\n\n"; BRIDGE } group { shape = line; style = dotted; color = "#FF0000"; label = "Development Board\n\n\n"; CHIP; DUMMY; } } .
332
. only:: SOC_USB_OTG_SUPPORTED or SOC_USB_SERIAL_JTAG_SUPPORTED Flash Using USB For the {IDF_TARGET_NAME}, the USB peripheral is available, allowing you to flash the binaries without the need for an external USB-to-UART bridge. {IDF_TARGET_USB_PIN_DM:default="Not Updated!", esp32c3="GPIO18", esp32s3="GPIO19", esp32s2="GPIO19", esp32c6="GPIO12", esp32h2="GPIO26"} {IDF_TARGET_USB_PIN_DP:default="Not Updated!", esp32c3="GPIO19", esp32s3="GPIO20", esp32s2="GPIO20", esp32c6="GPIO13", esp32h2="GPIO27"} The USB on the {IDF_TARGET_NAME} uses the **{IDF_TARGET_USB_PIN_DP}** for **D+** and **{IDF_TARGET_USB_PIN_DM}** for **D-**. .. only:: SOC_USB_SERIAL_JTAG_SUPPORTED and not esp32s3 .. note:: The {IDF_TARGET_NAME} supports only *USB CDC and JTAG*. If you are flashing for the first time, you need to get the {IDF_TARGET_NAME} into the download mode manually. To do so, press and hold the ``BOOT`` button and then press the ``RESET`` button once. After that release the ``BOOT`` button.
332
.. only:: esp32s3 If you are flashing for the first time, you need to get the {IDF_TARGET_NAME} into the download mode manually. To do so, press and hold the ``BOOT`` button and then press the ``RESET`` button once. After that release the ``BOOT`` button. .. only:: esp32s2 After flashing the binaries, a manual reset is needed. Flash Using UART This section provides guidance on how to establish a serial connection between {IDF_TARGET_NAME} and PC using USB-to-UART Bridge, either installed on the development board or external. Connect {IDF_TARGET_NAME} to PC Connect the {IDF_TARGET_NAME} board to the PC using the USB cable. If device driver does not install automatically, identify USB-to-UART bridge on your {IDF_TARGET_NAME} board (or external converter dongle), search for drivers in internet and install them. Below is the list of USB to serial converter chips installed on most of the {IDF_TARGET_NAME} boards produced by Espressif together with links to the drivers: Please check the board user guide for specific USB-to-UART bridge chip used.
332
The drivers above are primarily for reference. Under normal circumstances, the drivers should be bundled with an operating system and automatically installed upon connecting the board to the PC. For devices downloaded using a USB-to-UART bridge, you can run the following command including the optional argument to define the baud rate. .. code-block:: bash idf.py -p PORT [-b BAUD] flash Replace ``PORT`` with the device name for the serial port of your {IDF_TARGET_NAME} board. Please note that ``-b`` is an optional argument. If you do not specify the baud rate, the default baud rate is ``460800``. If you need to specify the baud rate, replace ``BAUD`` with the baud rate you need. To check the port name on Windows, please refer to `check-port-on-windows`_. For Linux and macOS users, please see `check-port-on-linux-and-macos`_. For example, if the port name is ``COM3`` on Windows and your desired baud rate is ``115200``, you can run the following command to flash the device: ..
332
code-block:: bash idf.py -p COM3 -b 115200 flash For Linux users, if the port name is ``/dev/ttyUSB0`` and the desired baud rate is ``115200``, you can run the following command to flash the device: .. code-block:: bash idf.py -p /dev/ttyUSB0 -b 115200 flash For macOS users, if the port name is ``/dev/cu.usbserial-1401`` and the desired baud rate is ``115200``, you can run the following command to flash the device: .. code-block:: bash idf.py -p /dev/cu.usbserial-1401 -b 115200 flash .. note:: If the device does not support the auto download mode, you need to get into the download mode manually. To do so, press and hold the ``BOOT`` button and then press the ``RESET`` button once. After that release the ``BOOT`` button. .. _check-port-on-windows: Check Port on Windows Check the list of identified COM ports in the Windows Device Manager. Disconnect {IDF_TARGET_NAME} and connect it back, to verify which port disappears from the list and then shows back again.
332
Figures below show serial port for ESP32 DevKitC and ESP32 WROVER KIT .. figure:: ../../_static/esp32-devkitc-in-device-manager.png :align: center :alt: USB to UART bridge of ESP32-DevKitC in Windows Device Manager :figclass: align-center USB to UART bridge of ESP32-DevKitC in Windows Device Manager .. figure:: ../../_static/esp32-wrover-kit-in-device-manager.png :align: center :alt: Two USB Serial Ports of ESP-WROVER-KIT in Windows Device Manager :figclass: align-center Two USB Serial Ports of ESP-WROVER-KIT in Windows Device Manager .. _check-port-on-linux-and-macos: Check Port on Linux and macOS To check the device name for the serial port of your {IDF_TARGET_NAME} board (or external converter dongle), run this command two times, first with the board/dongle unplugged, then with plugged in. The port which appears the second time is the one you need: Linux :: ls /dev/tty* macOS :: ls /dev/cu.* .. note:: macOS users: if you do not see the serial port then check you have the USB/serial drivers installed.
332
See Section `Connect {IDF_TARGET_NAME} to PC`_ for links to drivers. For macOS High Sierra (10.13), you may also have to explicitly allow the drivers to load. Open System Preferences -> Security & Privacy -> General and check if there is a message shown here about "System Software from developer ..." where the developer name is Silicon Labs or FTDI. .. _linux-dialout-group: Adding User to ``dialout`` or ``uucp`` on Linux The currently logged user should have read and write access the serial port over USB. On most Linux distributions, this is done by adding the user to ``dialout`` group with the following command:: sudo usermod -a -G dialout $USER on Arch Linux this is done by adding the user to ``uucp`` group with the following command:: sudo usermod -a -G uucp $USER Make sure you re-login to enable read and write permissions for the serial port. Verify Serial Connection Now verify that the serial connection is operational. You can do this using a serial terminal program by checking if you get any output on the terminal after resetting {IDF_TARGET_NAME}.
332
.. only:: esp32c2 The default console baud rate on ESP32-C2 is 115200 when a 40 MHz XTAL is used, or 74880 when a 26 MHz XTAL is used. .. only:: not esp32c2 The default console baud rate on {IDF_TARGET_NAME} is 115200. Windows and Linux In this example, we use `PuTTY SSH Client `_ that is available for both Windows and Linux. You can use other serial programs and set communication parameters like below. Run terminal and set identified serial port. Baud rate = 115200 (if needed, change this to the default baud rate of the chip in use), data bits = 8, stop bits = 1, and parity = N. Below are example screenshots of setting the port and such transmission parameters (in short described as 115200-8-1-N) on Windows and Linux. Remember to select exactly the same serial port you have identified in steps above. .. figure:: ../../_static/putty-settings-windows.png :align: center :alt: Setting Serial Communication in PuTTY on Windows :figclass: align-center Setting Serial Communication in PuTTY on Windows .
332
. figure:: ../../_static/putty-settings-linux.png :align: center :alt: Setting Serial Communication in PuTTY on Linux :figclass: align-center Setting Serial Communication in PuTTY on Linux Then open serial port in terminal and check, if you see any log printed out by {IDF_TARGET_NAME}. The log contents depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. Reset the board if no log has been printed out. .. note:: Close the serial terminal after verification that communication is working. If you keep the terminal session open, the serial port will be inaccessible for uploading firmware later. .. note:: If there is no log output, check - if the required power is supplied to {IDF_TARGET_NAME} - if the board was reset after starting the terminal program - if the selected serial port is the correct one by using the method stated in `Check Port on Windows`_ and `Check Port on Linux and macOS`_ - if the serial port is not being used by another program - if the identified port has been selected in serial terminal programs you are using, as stated in `Windows and Linux`_ - if settings of the serial port in serial terminal programs are applicable to corresponding applications - if the correct USB connector (UART) is used on the development board - if your application is expected to output some log - if the log output has not been disabled (use :example:`hello world application ` to test) macOS To spare you the trouble of installing a serial terminal program, macOS offers the **screen** command.
332
- As discussed in `Check port on Linux and macOS`_, run:: ls /dev/cu.* - You should see similar output:: /dev/cu.Bluetooth-Incoming-Port /dev/cu.SLAB_USBtoUART /dev/cu.SLAB_USBtoUART7 - The output varies depending on the type and the number of boards connected to your PC. Then pick the device name of your board and run (if needed, change "115200" to the default baud rate of the chip in use):: screen /dev/cu.device_name 115200 Replace ``device_name`` with the name found running ``ls /dev/cu.*``. - What you are looking for is some log displayed by the **screen**. The log contents depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. To exit the current **screen** session, type ``Ctrl-A + K``. .. note:: Do not forget to **exit the current screen session** after verifying that the communication is working. If you fail to do it and just close the terminal window, the serial port will be inaccessible for uploading firmware later. Example Output An example log is shown below.
332
Reset the board if you do not see anything. .. highlight:: none :: ets Jun 8 2016 00:22:57 rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0008,len:8 load:0x3fff0010,len:3464 load:0x40078000,len:7828 load:0x40080000,len:252 entry 0x40080034 I (44) boot: ESP-IDF v2.0-rc1-401-gf9fba35 2nd stage bootloader I (45) boot: compile time 18:48:10 ... If you can see readable log output, it means serial connection is working and you are ready to proceed with installation and finally upload an application to {IDF_TARGET_NAME}. .. note:: For some serial port wiring configurations, the serial RTS & DTR pins need to be disabled in the terminal program before the {IDF_TARGET_NAME} booting and producing serial output.
332
This depends on the hardware itself, most development boards (including all Espressif boards) *do not* have this issue. The issue is present if RTS & DTR are wired directly to the EN & GPIO0 pins. See the `esptool documentation`_ for more details. If you got here from :ref:`get-started-connect` when installing s/w for {IDF_TARGET_NAME} development, then you can continue with :ref:`get-started-configure`. .. _esptool documentation: https://docs.espressif.com/projects/esptool/en/latest/advanced-topics/boot-mode-selection.html#automatic-bootloader
332
Now since all requirements are met, the next topic will guide you on how to start your first project. This guide helps you on the first steps using ESP-IDF. Follow this guide to start a new project on the {IDF_TARGET_NAME} and build, flash, and monitor the device output. .. note:: If you have not yet installed ESP-IDF, please go to :ref:`get-started-step-by-step` and follow the instruction in order to get all the software needed to use this guide. Start a Project Now you are ready to prepare your application for {IDF_TARGET_NAME}. You can start with :example:`get-started/hello_world` project from :idf:`examples` directory in ESP-IDF. .. important:: The ESP-IDF build system does not support spaces in the paths to either ESP-IDF or to projects. Copy the project :example:`get-started/hello_world` to ``~/esp`` directory: .. code-block:: bash cd ~/esp cp -r $IDF_PATH/examples/get-started/hello_world . .. note:: There is a range of example projects in the :idf:`examples` directory in ESP-IDF.
333
You can copy any project in the same way as presented above and run it. It is also possible to build examples in-place without copying them first. Connect Your Device Now connect your {IDF_TARGET_NAME} board to the computer and check under which serial port the board is visible. Serial ports have the following naming patterns: - **Linux**: starting with ``/dev/tty`` - **macOS**: starting with ``/dev/cu.`` If you are not sure how to check the serial port name, please refer to :doc:`establish-serial-connection` for full details. .. note:: Keep the port name handy as it is needed in the next steps. Configure Your Project Navigate to your ``hello_world`` directory, set {IDF_TARGET_NAME} as the target, and run the project configuration utility ``menuconfig``. .. code-block:: bash cd ~/esp/hello_world idf.py set-target {IDF_TARGET_PATH_NAME} idf.py menuconfig After opening a new project, you should first set the target with ``idf.py set-target {IDF_TARGET_PATH_NAME}``.
333
Note that existing builds and configurations in the project, if any, are cleared and initialized in this process. The target may be saved in the 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 :align: center :alt: Project configuration - Home window Project configuration - Home window 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_world", since this example runs with default configuration. .. only:: esp32 .. attention:: If you use ESP32-DevKitC board with the **ESP32-SOLO-1** module, or ESP32-DevKitM-1 board with the **ESP32-MIN1-1/1U** module, please enable single core mode (:ref:`CONFIG_FREERTOS_UNICORE`) in menuconfig before flashing examples.
333
.. 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. .. only:: esp32 or esp32s2 or esp32s3 If you are using one of the supported development boards, you can speed up your development by using Board Support Package. See `Additional Tips `__ for more information. .. only:: esp32s2 Console Output Configuration If you are using the USB for flashing the {IDF_TARGET_NAME}, you need to change the channel for the console output from UART (default) to USB. ``Component config`` > ``ESP System Settings`` > ``Channel for console output`` ``USB CDC``
333
Flashing Troubleshooting Failed to Connect {IDF_TARGET_STRAP_GPIO:default="[NEEDS TO BE UPDATED]", esp32="GPIO0", esp32s2="GPIO0", esp32s3="GPIO0", esp32c2="GPIO9", esp32c3="GPIO9", esp32c6="GPIO9", esp32h2="GPIO9"} If you run the given command and see errors such as "Failed to connect", there might be several reasons for this. One of the reasons might be issues encountered by ``esptool.py``, the utility that is called by the build system to reset the chip, interact with the ROM bootloader, and flash firmware. One simple solution to try is to manually reset as described below. If it does not help, you can find more details about possible issues in the `esptool troubleshooting `_ page. ``esptool.py`` resets {IDF_TARGET_NAME} automatically by asserting DTR and RTS control lines of the USB-to-UART bridge, i.e., FTDI or CP210x (for more information, see :doc:`establish-serial-connection`). The DTR and RTS control lines are in turn connected to ``{IDF_TARGET_STRAP_GPIO}`` and ``CHIP_PU`` (EN) pins of {IDF_TARGET_NAME}, thus changes in the voltage levels of DTR and RTS will boot {IDF_TARGET_NAME} into Firmware Download mode.
334
As an example, check the `schematic `_ for the ESP32 DevKitC development board. In general, you should have no problems with the `official esp-idf development boards `_. However, ``esptool.py`` is not able to reset your hardware automatically in the following cases: - Your hardware does not have the DTR and RTS lines connected to ``{IDF_TARGET_STRAP_GPIO}`` and ``CHIP_PU``. - The DTR and RTS lines are configured differently. - There are no such serial control lines at all. Depending on the kind of hardware you have, it may also be possible to manually put your {IDF_TARGET_NAME} board into Firmware Download mode (reset). - For development boards produced by Espressif, this information can be found in the respective getting started guides or user guides. For example, to manually reset an ESP-IDF development board, hold down the ``Boot`` button (``{IDF_TARGET_STRAP_GPIO}``) and press the ``EN`` button (``CHIP_PU``). - For other types of hardware, try pulling ``{IDF_TARGET_STRAP_GPIO}`` down.
334
334
Hardware Reference .. toctree:: :maxdepth: 1 Technical Reference Manual (PDF) :esp32: Chip Datasheet (PDF) :esp32s2: Chip Datasheet (PDF) :esp32s3: Chip Datasheet (PDF) :esp32c2: Chip Datasheet (PDF) :esp32c3: Chip Datasheet (PDF) :esp32c6: Chip Datasheet (PDF) :esp32h2: Chip Datasheet (PDF) :esp32: Hardware Design Guidelines (PDF) :esp32s2: Hardware Design Guidelines (PDF) :esp32s3: Hardware Design Guidelines (PDF) :esp32c2: Hardware Design Guidelines (PDF) :esp32c3: Hardware Design Guidelines (PDF) :esp32c6: Hardware Design Guidelines (PDF) :esp32h2: Hardware Design Guidelines (PDF) :esp32: Silicon Errata (PDF) :esp32s2: Silicon Errata (PDF) :esp32s3: Silicon Errata (PDF) :esp32c3: Silicon Errata (PDF) :esp32c2: Silicon Errata (PDF) Chip Variants Modules Development Boards Espressif KiCad Library ESP Product Selector Regulatory Certificates Chip Series Comparison User Forum (Hardware)
335
This user guide will help you get started with ESP32-C3-DevKitM-1 and will also provide more in-depth information. ESP32-C3-DevKitM-1 is an entry-level development board based on `ESP32-C3-MINI-1 `_, a module named for its small size. This board integrates complete Wi-Fi and Bluetooth® Low Energy functions. Most of the I/O pins on the ESP32-C3-MINI-1 module are broken out to the pin headers on both sides of this board for easy interfacing. Developers can either connect peripherals with jumper wires or mount ESP32-C3-DevKitM-1 on a breadboard. .. figure:: ../../../_static/esp32-c3-devkitm-1-v1-isometric.png :align: center :alt: ESP32-C3-DevKitM-1 :figclass: align-center ESP32-C3-DevKitM-1 The document consists of the following major sections: - `Getting Started`_: Overview of ESP32-C3-DevKitM-1 and hardware/software setup instructions to get started. - `Hardware Reference`_: More detailed information about the ESP32-C3-DevKitM-1's hardware. - `Hardware Revision Details`_: Revision history, known issues, and links to user guides for previous versions (if any) of ESP32-C3-DevKitM-1.
336
- `Related Documents`_: Links to related documentation. Getting Started This section provides a brief introduction of ESP32-C3-DevKitM-1, instructions on how to do the initial hardware setup and how to flash firmware onto it. Description of Components .. _user-guide-c3-devkitm-1-v1-board-front: .. figure:: ../../../_static/esp32-c3-devkitm-1-v1-annotated-photo.png :align: center :alt: ESP32-C3-DevKitM-1 - front :figclass: align-center ESP32-C3-DevKitM-1 - front The key components of the board are described in a counter-clockwise direction. .. list-table:: :widths: 30 70 :header-rows: 1 - Description - ESP32-C3-MINI-1 is a general-purpose Wi-Fi and Bluetooth Low Energy combo module that comes with a PCB antenna. At the core of this module is `ESP32-C3FN4 `_, a chip that has an embedded flash of 4 MB. Since flash is packaged in the ESP32-C3FN4 chip, rather than integrated into the module, ESP32-C3-MINI-1 has a smaller package size. - Power regulator that converts a 5 V supply into a 3.
336
3 V output. - Turns on when the USB power is connected to the board. - All available GPIO pins (except for the SPI bus for flash) are broken out to the pin headers on the board. For details, please see :ref:`user-guide-c3-devkitm-1-v1-header-blocks`. - Download button. Holding down **Boot** and then pressing **Reset** initiates Firmware Download mode for downloading firmware through the serial port. - USB interface. Power supply for the board as well as the communication interface between a computer and the ESP32-C3FN4 chip. - Press this button to restart the system. - Single USB-UART bridge chip provides transfer rates up to 3 Mbps. - Addressable RGB LED, driven by GPIO8. Start Application Development Before powering up your ESP32-C3-DevKitM-1, please make sure that it is in good condition with no obvious signs of damage. Required Hardware - ESP32-C3-DevKitM-1 - USB 2.0 cable (Standard-A to Micro-B) - Computer running Windows, Linux, or macOS .
336
. note:: Be sure to use an appropriate USB cable. Some cables are for charging only and do not provide the needed data lines nor work for programming the boards. Software Setup Please proceed to :doc:`../../get-started/index`, where Section :ref:`get-started-step-by-step` will quickly help you set up the development environment and then flash an application example onto your ESP32-C3-DevKitM-1. Contents and Packaging Retail Orders If you order one or several samples, each ESP32-C3-DevKitM-1 comes in an individual package in either antistatic bag or any packaging depending on your retailer. For retail orders, please go to https://www.espressif.com/en/contact-us/get-samples. Wholesale Orders If you order in bulk, the boards come in large cardboard boxes. For wholesale orders, please go to https://www.espressif.com/en/contact-us/sales-questions. Hardware Reference Block Diagram The block diagram below shows the components of ESP32-C3-DevKitM-1 and their interconnections.
336
.. figure:: ../../../_static/esp32-c3-devkitm-1-v1-block-diagram.png :align: center :scale: 70% :alt: ESP32-C3-DevKitM-1 (click to enlarge) :figclass: align-center ESP32-C3-DevKitM-1 (click to enlarge) Power Supply Options There are three mutually exclusive ways to provide power to the board: - Micro-USB Port, default power supply - 5V and GND pin headers - 3V3 and GND pin headers It is recommended to use the first option: Micro-USB Port. .. _user-guide-c3-devkitm-1-v1-header-blocks: Header Block The two tables below provide the **Name** and **Function** of the pin headers on both sides of the board (J1 and J3). The pin header names are shown in :ref:`user-guide-c3-devkitm-1-v1-board-front`. The numbering is the same as in the `ESP32-C3-DevKitM-1 Schematic`_ (PDF). J1 ^^^ === No. Name Type [1]_ Function === 1 GND G Ground 2 3V3 P 3.3 V power supply 3 3V3 P 3.3 V power supply 4 IO2 I/O/T GPIO2 [2]_, ADC1_CH2, FSPIQ 5 IO3 I/O/T GPIO3, ADC1_CH3 6 GND G Ground 7 RST I CHIP_PU 8 GND G Ground 9 IO0 I/O/T GPIO0, ADC1_CH0, XTAL_32K_P 10 IO1 I/O/T GPIO1, ADC1_CH1, XTAL_32K_N 11 IO10 I/O/T GPIO10, FSPICS0 12 GND G Ground 13 5V P 5 V power supply 14 5V P 5 V power supply 15 GND G Ground === J3 ^^^ === No.
336
Name Type [1]_ Function === 1 GND G Ground 2 TX I/O/T GPIO21, U0TXD 3 RX I/O/T GPIO20, U0RXD 4 GND G Ground 5 IO9 I/O/T GPIO9 [2]_ 6 IO8 I/O/T GPIO8 [2]_, RGB LED 7 GND G Ground 8 IO7 I/O/T GPIO7, FSPID, MTDO 9 IO6 I/O/T GPIO6, FSPICLK, MTCK 10 IO5 I/O/T GPIO5, ADC2_CH0, FSPIWP, MTDI 11 IO4 I/O/T GPIO4, ADC1_CH4, FSPIHD, MTMS 12 GND G Ground 13 IO18 I/O/T GPIO18, USB_D- 14 IO19 I/O/T GPIO19, USB_D+ 15 GND G Ground === .. [1] P: Power supply; I: Input; O: Output; T: High impedance. .. [2] GPIO2, GPIO8, and GPIO9 are strapping pins of the ESP32-C3FN4 chip. These pins are used to control several chip functions depending on binary voltage values applied to the pins during chip power-up or system reset. For description and application of the strapping pins, please refer to Section Strapping Pins in `ESP32-C3 Datasheet`_.
336
Pin Layout .. figure:: ../../../_static/esp32-c3-devkitm-1-v1-pinout.png :align: center :scale: 45% :alt: ESP32-C3-DevKitM-1 (click to enlarge) ESP32-C3-DevKitM-1 Pin Layout (click to enlarge) Hardware Revision Details No previous versions available. Related Documents For further design documentation for the board, please contact us at `sales@espressif.com `_. .. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf .. _ESP32-C3-MINI-1 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3-mini-1_datasheet_en.pdf .. _ESP32-C3-DevKitM-1 Schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-C3-DEVKITM-1_V1_20200915A.pdf .. _ESP32-C3-DevKitM-1 PCB Layout: https://dl.espressif.com/dl/schematics/PCB_ESP32-C3-DEVKITM-1_V1_20200915AA.pdf .. _ESP32-C3-DevKitM-1 Dimensions: https://dl.espressif.com/dl/schematics/DIMENSION_ESP32-C3-DEVKITM-1_V1_20200915AA.pdf .. _ESP32-C3-DevKitM-1 Dimensions source file: https://dl.
336
espressif.com/dl/schematics/DIMENSION_ESP32-C3-DEVKITM-1_V1_20200915AA.dxf
336
This user guide will help you get started with ESP32-C3-DevKitC-02 and will also provide more in-depth information. ESP32-C3-DevKitC-02 is an entry-level development board based on `ESP32-C3-WROOM-02 `_, a general-purpose module with 4 MB SPI flash. This board integrates complete Wi-Fi and Bluetooth® Low Energy functions. Most of the I/O pins are broken out to the pin headers on both sides for easy interfacing. Developers can either connect peripherals with jumper wires or mount ESP32-C3-DevKitC-02 on a breadboard. .. figure:: ../../../_static/esp32-c3-devkitc-02-v1-isometric.png :align: center :alt: ESP32-C3-DevKitC-02 :figclass: align-center ESP32-C3-DevKitC-02 The document consists of the following major sections: - `Getting Started`_: Overview of ESP32-C3-DevKitC-02 and hardware/software setup instructions to get started. - `Hardware Reference`_: More detailed information about the ESP32-C3-DevKitC-02's hardware. - `Hardware Revision Details`_: Revision history, known issues, and links to user guides for previous versions (if any) of ESP32-C3-DevKitC-02.
337
- `Related Documents`_: Links to related documentation. Getting Started This section provides a brief introduction of ESP32-C3-DevKitC-02, instructions on how to do the initial hardware setup and how to flash firmware onto it. Description of Components .. _user-guide-c3-devkitc-02-v1-board-front: .. figure:: ../../../_static/esp32-c3-devkitc-02-v1-annotated-photo.png :align: center :alt: ESP32-C3-DevKitC-02 - front :figclass: align-center ESP32-C3-DevKitC-02 - front The key components of the board are described in a counter-clockwise direction. .. list-table:: :widths: 30 70 :header-rows: 1 - Description - ESP32-C3-WROOM-02 from Espressif is a powerful and general-purpose module that offers Wi-Fi and Bluetooth Low Energy coexistence. It has a PCB antenna and a 4 MB SPI flash. - Power regulator that converts a 5 V supply into a 3.3 V output. - Turns on when the USB power is connected to the board. - All available GPIO pins (except for the SPI bus for flash) are broken out to the pin headers on the board.
337
For details, please see :ref:`user-guide-c3-devkitc-02-v1-header-blocks`. - Download button. Holding down **Boot** and then pressing **Reset** initiates Firmware Download mode for downloading firmware through the serial port. - USB interface. Power supply for the board as well as the communication interface between a computer and the ESP32-C3 chip. - Press this button to restart the system. - Single USB-to-UART bridge chip provides transfer rates up to 3 Mbps. - Addressable RGB LED, driven by GPIO8. Start Application Development Before powering up your ESP32-C3-DevKitC-02, please make sure that it is in good condition with no obvious signs of damage. Required Hardware - ESP32-C3-DevKitC-02 - USB 2.0 cable (Standard-A to Micro-B) - Computer running Windows, Linux, or macOS .. note:: Be sure to use an appropriate USB cable. Some cables are for charging only and do not provide the needed data lines nor work for programming the boards. Software Setup Please proceed to :doc:`.
337
./../get-started/index`, where Section :ref:`get-started-step-by-step` will quickly help you set up the development environment and then flash an application example into your ESP32-C3-DevKitC-02. Contents and Packaging Retail Orders If you order a few samples, each ESP32-C3-DevKitC-02 comes in an individual package in either antistatic bag or any packaging depending on your retailer. For retail orders, please go to https://www.espressif.com/en/contact-us/get-samples. Wholesale Orders If you order in bulk, the boards come in large cardboard boxes. For wholesale orders, please go to https://www.espressif.com/en/contact-us/sales-questions. Hardware Reference Block Diagram The block diagram below shows the components of ESP32-C3-DevKitC-02 and their interconnections. .. figure:: ../../../_static/esp32-c3-devkitc-02-v1-block-diags.png :align: center :scale: 70% :alt: ESP32-C3-DevKitC-02 (click to enlarge) :figclass: align-center ESP32-C3-DevKitC-02 (click to enlarge) Power Supply Options There are three mutually exclusive ways to provide power to the board: - Micro-USB Port, default power supply - 5V and GND pin headers - 3V3 and GND pin headers It is recommended to use the first option: Micro-USB Port.
337
.. _user-guide-c3-devkitc-02-v1-header-blocks: Header Block The two tables below provide the **Name** and **Function** of the pin headers on both sides of the board (J1 and J3). The pin header names are shown in :ref:`user-guide-c3-devkitc-02-v1-board-front`. The numbering is the same as in the `ESP32-C3-DevKitC-02 Schematic`_ (PDF). J1 ^^^ === No. Name Type [1]_ Function === 1 G G Ground 2 3V3 P 3.3 V power supply 3 3V3 P 3.3 V power supply 4 RST I CHIP_PU 5 G G Ground 6 4 I/O/T GPIO4, ADC1_CH4, FSPIHD, MTMS 7 5 I/O/T GPIO5, ADC2_CH0, FSPIWP, MTDI 8 6 I/O/T GPIO6, FSPICLK, MTCK 9 7 I/O/T GPIO7, FSPID, MTDO 10 G G Ground 11 8 I/O/T GPIO8 [2]_, RGB LED 12 9 I/O/T GPIO9 [2]_ 13 5V P 5 V power supply 14 5V P 5 V power supply 15 G G Ground === J3 ^^^ === No.
337
Name Type [1]_ Function === 1 G G Ground 2 0 I/O/T GPIO0, ADC1_CH0, XTAL_32K_P 3 1 I/O/T GPIO1, ADC1_CH1, XTAL_32K_N 4 2 I/O/T GPIO2 [2]_, ADC1_CH2, FSPIQ 5 3 I/O/T GPIO3, ADC1_CH3 6 G G Ground 7 10 I/O/T GPIO10, FSPICS0 8 G G Ground 9 RX I/O/T GPIO20, U0RXD 10 TX I/O/T GPIO21, U0TXD 11 G G Ground 12 18 I/O/T GPIO18 13 19 I/O/T GPIO19 14 G G Ground 15 G G Ground === .. [1] P: Power supply; I: Input; O: Output; T: High impedance. .. [2] GPIO2, GPIO8, and GPIO9 are strapping pins of the ESP32-C3 chip. These pins are used to control several chip functions depending on binary voltage values applied to the pins during chip power-up or system reset. For description and application of the strapping pins, please refer to Section Strapping Pins in `ESP32-C3 Datasheet`_. Pin Layout .
337
. figure:: ../../../_static/esp32-c3-devkitc-02-v1-pinout.png :align: center :scale: 50% :alt: ESP32-C3-DevKitC-02 (click to enlarge) :figclass: align-center ESP32-C3-DevKitC-02 Pin Layout (click to enlarge) Hardware Revision Details No previous versions available. Related Documents For further design documentation for the board, please contact us at `sales@espressif.com `_. .. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf .. _ESP32-C3-WROOM-02 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3-wroom-02_datasheet_en.pdf .. _ESP32-C3-DevKitC-02 Schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-C3-DEVKITC-02_V1_1_20210126A.pdf
337
ESP32-Ethernet-Kit V1.0 Getting Started Guide This guide shows how to get started with the ESP32-Ethernet-Kit development board and also provides information about its functionality and configuration options. The :ref:`ESP32-Ethernet-Kit ` is an Ethernet-to-Wi-Fi development board that enables Ethernet devices to be interconnected over Wi-Fi. At the same time, to provide more flexible power supply options, the ESP32-Ethernet-Kit also supports power over Ethernet (PoE). What You Need You can skip the introduction sections and go directly to Section `Start Application Development`_. Overview ESP32-Ethernet-Kit is an ESP32-based development board produced by `Espressif `_. It consists of two development boards, the Ethernet board A and the PoE board B. The :ref:`Ethernet board (A) ` contains Bluetooth®/Wi-Fi dual-mode ESP32-WROVER-B module and IP101GRI, a Single Port 10/100 Fast Ethernet Transceiver (PHY). The :ref:`PoE board (B) ` provides power over Ethernet functionality.
338
The A board can work independently, without the board B installed. .. _get-started-esp32-ethernet-kit-b-v1.0: .. figure:: ../../../_static/esp32-ethernet-kit-v1.0.png :align: center :alt: ESP32-Ethernet-Kit V1.0 :figclass: align-center ESP32-Ethernet-Kit V1.0 For the application loading and monitoring the Ethernet board (A) also features FTDI FT2232H chip - an advanced multi-interface USB bridge. This chip enables to use JTAG for direct debugging of ESP32 through the USB interface without a separate JTAG debugger. Functionality Overview The block diagram below shows the main components of ESP32-Ethernet-Kit and their interconnections. .. figure:: ../../../_static/esp32-ethernet-kit-block-diagram.png :align: center :scale: 50% :alt: ESP32-Ethernet-Kit block diagram (click to enlarge) :figclass: align-center ESP32-Ethernet-Kit block diagram (click to enlarge) Functional Description The following two figures and tables describe the key components, interfaces, and controls of the ESP32-Ethernet-Kit.
338
.. _get-started-esp32-ethernet-kit-a-v1.0-layout: Ethernet Board (A) .. figure:: ../../../_static/esp32-ethernet-kit-a-v1.0-layout.png :align: center :scale: 80% :alt: ESP32-Ethernet-Kit - Ethernet board (A) layout :figclass: align-center ESP32-Ethernet-Kit - Ethernet board (A) layout (click to enlarge) The table below provides description starting from the picture's top right corner and going clockwise. Key Component Description ESP32-WROVER-B This ESP32 module features 64-Mbit PSRAM for flexible extended storage and data processing capabilities. GPIO Header 2 Five unpopulated through-hole solder pads to provide access to selected GPIOs of ESP32. For details, see `GPIO Header 2`_. Flow Control A jumper header with access to the board signals. For details, see `Flow Control`_. Function Switch A DIP switch used to configure the functionality of selected GPIOs of ESP32. For details, see `Function Switch`_. Tx/Rx LEDs Two LEDs to show the status of UART transmission.
338
GPIO Header 3 Provides access to some GPIOs of ESP32 that can be used depending on the position of the `Function Switch`_. FT2232H The FT2232H chip serves as a multi-protocol USB-to-serial bridge which can be programmed and controlled via USB to provide communication with ESP32. FT2232H also features USB-to-JTAG interface which is available on channel A of the chip, while USB-to-serial is on channel B. The FT2232H chip enhances user-friendliness in terms of application development and debugging. See `ESP32-Ethernet-Kit V1.0 Ethernet board (A) schematic`_. USB Port USB interface. Power supply for the board as well as the communication interface between a computer and the board. Power Switch Power On/Off Switch. Toggling toward the **Boot** button powers the board on, toggling away from **Boot** powers the board off. 5V Input The 5V power supply interface can be more convenient when the board is operating autonomously (not connected to a computer).
338
5V Power On LED This red LED turns on when power is supplied to the board, either from USB or 5 V Input. DC/DC Converter Provided DC 5 V to 3.3 V conversion, output current up to 2 A. Board B Connectors A pair male header pins for mounting the :ref:`PoE board (B) `. IP101GRI (PHY) The physical layer (PHY) connection to the Ethernet cable is implemented using the `IP101GRI `_ chip. The connection between PHY and ESP32 is done through the reduced media-independent interface (RMII), a variant of the media-independent interface `(MII) `_ standard. The PHY supports the IEEE 802.3/802.3u standard of 10/100 Mbps. RJ45 Port Ethernet network data transmission port. Magnetics Module The Magnetics are part of the Ethernet specification to protect against faults and transients, including rejection of common mode signals between the transceiver IC and the cable. The magnetics also provide galvanic isolation between the transceiver and the Ethernet device. Link/Activity LEDs Two LEDs (green and red) that respectively indicate the "Link" and "Activity" statuses of the PHY.
338
BOOT Button Download button. Holding down **BOOT** and then pressing **CH_PU** initiates Firmware Download mode for downloading firmware through the serial port. CH_PU Button Reset button. GPIO Header 1 This header provides six unpopulated through-hole solder pads connected to spare GPIOs of ESP32. For details, see `GPIO Header 1`_. .. _get-started-esp32-ethernet-kit-b-v1.0-layout: PoE Board (B) This board coverts power delivered over the Ethernet cable (PoE) to provide a power supply for the Ethernet board (A). The main components of the PoE board (B) are shown on the block diagram under `Functionality Overview`_. The PoE board (B) has the following features: To take advantage of the PoE functionality the **RJ45 Port** of the Ethernet board (A) should be connected with an Ethernet cable to a switch that supports PoE. When the Ethernet board (A) detects 5 V power output from the PoE board (B), the USB power will be automatically cut off. .. figure:: .
338
./../../_static/esp32-ethernet-kit-b-v1.0-layout.png :align: center :scale: 80% :alt: ESP32-Ethernet-Kit - PoE board (B) :figclass: align-center ESP32-Ethernet-Kit - PoE board (B) layout (click to enlarge) Key Component Description Board A Connector Four female header pins for mounting this board onto :ref:`Ethernet board (A) `. External Power Terminals Optional power supply to the PoE board (B). .. _get-started-esp32-ethernet-kit-b-v1.0-setup-options: Setup Options This section describes options to configure the ESP32-Ethernet-Kit hardware. Function Switch The functions for specific GPIO pins can be selected with the **Function Switch**. DIP SW GPIO Pin Pin Functionality if DIP SW is ON 1 GPIO14 Connected to FT2232H to provide JTAG functionality 2 GPIO12 Connected to FT2232H to provide JTAG functionality 3 GPIO13 Connected to FT2232H to provide JTAG functionality 4 GPIO15 Connected to FT2232H to provide JTAG functionality 5 GPIO4 Connected to FT2232H to provide JTAG functionality 6 GPIO2 Connected to on-board 25 MHz oscillator 7 GPIO5 Connected to RESET_N input of IP101GRI 8 n/a You can make a certain GPIO pin available for other purposes by putting its DIP SW to the Off position.
338
Flow Control This is a 2 x 2 jumper pin header intended for the UART flow control. . Signal Comment 1 MTDO GPIO13, see also `Function Switch`_ 2 MTCK GPIO15, see also `Function Switch`_ 3 RTS RTS signal of FT2232H 4 CTS CTS signal of FT2232H GPIO Allocation This section describes allocation of ESP32 GPIOs to specific interfaces or functions of the ESP32-Ethernet-Kit. IP101GRI (PHY) Interface The allocation of the ESP32 (MAC) pins to IP101GRI (PHY) is shown in the table below. Implementation of ESP32-Ethernet-Kit defaults to Reduced Media-Independent Interface (RMII). . ESP32 Pin (MAC) IP101GRI (PHY) *RMII Interface* 1 GPIO21 TX_EN 2 GPIO19 TXD[0] 3 GPIO22 TXD[1] 4 GPIO25 RXD[0] 5 GPIO26 RXD[1] 6 GPIO27 CRS_DV 7 GPIO0 REF_CLK *Serial Management Interface* 8 GPIO23 MDC 9 GPIO18 MDIO *PHY Reset* 10 GPIO5 Reset_N .
338
. note:: Except for REF_CLK, the allocation of all pins under the *RMII Interface* is fixed and cannot be changed either through IOMUX or GPIO Matrix. GPIO Header 1 This header exposes some GPIOs that are not used elsewhere on the ESP32-Ethernet-Kit. . ESP32 Pin 1 GPIO32 2 GPIO33 3 GPIO34 4 GPIO35 5 GPIO36 6 GPIO39 GPIO Header 2 This header contains the GPIOs with specific MII functionality (except GPIO2), as opposed to Reduced Media-Independent Interface (RMII) functionality implemented on ESP32-Ethernet-Kit board by default, see `IP101GRI (PHY) Interface`_. Depending on the situation, if MMI is used, specific Ethernet applications might require this functionality. . ESP32 Pin MII Function Comments 1 GPIO17 EMAC_CLK_180 See note 1 2 GPIO16 EMAC_CLK_OUT See note 1 3 GPIO4 EMAC_TX_ER 4 GPIO2 n/a See note 2 5 GPIO5 EMAC_RX_CLK See note 2 .
338
. note:: GPIO Header 3 The functionality of GPIOs connected to this header depends on the settings of the `Function Switch`_. . ESP32 Pin 1 GPIO15 2 GPIO13 3 GPIO12 4 GPIO14 5 GND 6 3V3 GPIO Allocation Summary .. csv-table:: :header: ESP32-WROVER-B,IP101GRI,UART,JTAG,GPIO, Comments S_VP,,,,IO36, S_VN,,,,IO39, IO34,,,,IO34, IO35,,,,IO35, IO32,,,,IO32, IO33,,,,IO33, IO25,RXD[0],,,, IO26,RXD[1],,,, IO27,CRS_DV,,,, IO14,,,TMS,IO14, IO12,,,TDI,IO12, IO13,,RTS,TCK,IO13, IO15,,CTS,TDO,IO15, IO2,,,,IO2,See notes 1 and 3 below IO0,REF_CLK,,,,See notes 2 and 3 below IO4,,,nTRST,IO4, IO16,,,,IO16 (NC),See note 4 below IO17,,,,IO17 (NC),See note 4 below IO5,Reset_N,,,IO5, IO18,MDIO,,,, IO19,TXD[0],,,, IO21,TX_EN,,,, RXD0,,RXD,,, TXD0,,TXD,,, IO22,TXD[1],,,, IO23,MDC,,,, .. note:: Start Application Development Before powering up your ESP32-Ethernet-Kit, please make sure that the board is in good condition with no obvious signs of damage.
338
Initial Setup Now to Development Proceed to :doc:`../../get-started/index`, where Section :ref:`get-started-step-by-step` will quickly help you set up the development environment and then flash an example project onto your board. To use the older GNU Make compilation system, please refer to :ref:`get-started-step-by-step` section. Move on to the next section only if you have successfully completed all the above steps. Configure and Load the Ethernet Example After setting up the development environment and testing the board, you can configure and flash the :example:`ethernet/basic` example. This example has been created for testing Ethernet functionality. It supports different PHY, including **IP101GRI** installed on :ref:`ESP32-Ethernet-Kit V1.0 board `. Related Documents For other design documentation for the board, please contact us at sales@espressif.com. .. _ESP32-Ethernet-Kit V1.0 Ethernet board (A) schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-ETHERNET-KIT_A_V1.
338
0_20190517.pdf .. _ESP32-Ethernet-Kit V1.0 PoE board (B) schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-ETHERNET-KIT_B_V1.0_20190517.pdf .. _IP101GRI: http://www.bdtic.com/DataSheet/ICplus/IP101G_DS_R01_20121224.pdf .. _MII: https://en.wikipedia.org/wiki/Media-independent_interface
338
ESP32-Ethernet-Kit V1.1 Getting Started Guide This guide shows how to get started with the ESP32-Ethernet-Kit development board and also provides information about its functionality and configuration options. The :ref:`ESP32-Ethernet-Kit ` is an Ethernet-to-Wi-Fi development board that enables Ethernet devices to be interconnected over Wi-Fi. At the same time, to provide more flexible power supply options, the ESP32-Ethernet-Kit also supports power over Ethernet (PoE). What You Need You can skip the introduction sections and go directly to Section `Start Application Development`_. Overview ESP32-Ethernet-Kit is an ESP32-based development board produced by `Espressif `_. It consists of two development boards, the Ethernet board A and the PoE board B. The :ref:`Ethernet board (A) ` contains Bluetooth®/Wi-Fi dual-mode ESP32-WROVER-B module and IP101GRI, a Single Port 10/100 Fast Ethernet Transceiver (PHY). The `PoE board (B)`_ provides power over Ethernet functionality. The A board can work independently, without the board B installed.
339
.. _get-started-esp32-ethernet-kit-v1.1: .. figure:: ../../../_static/esp32-ethernet-kit-v1.1.png :align: center :alt: ESP32-Ethernet-Kit V1.1 :figclass: align-center ESP32-Ethernet-Kit V1.1 For the application loading and monitoring, the Ethernet board (A) also features FTDI FT2232H chip - an advanced multi-interface USB bridge. This chip enables to use JTAG for direct debugging of ESP32 through the USB interface without a separate JTAG debugger. Functionality Overview The block diagram below shows the main components of ESP32-Ethernet-Kit and their interconnections. .. figure:: ../../../_static/esp32-ethernet-kit-v1.1-block-diagram.png :align: center :scale: 60% :alt: ESP32-Ethernet-Kit block diagram (click to enlarge) :figclass: align-center ESP32-Ethernet-Kit block diagram (click to enlarge) Functional Description The following figures and tables describe the key components, interfaces, and controls of the ESP32-Ethernet-Kit. .. _get-started-esp32-ethernet-kit-a-v1.
339
1-layout: Ethernet Board (A) .. figure:: ../../../_static/esp32-ethernet-kit-a-v1.1-layout.png :align: center :scale: 80% :alt: ESP32-Ethernet-Kit - Ethernet board (A) layout :figclass: align-center ESP32-Ethernet-Kit - Ethernet board (A) layout (click to enlarge) The table below provides description starting from the picture's top right corner and going clockwise. .. list-table:: Table 1 Component Description :widths: 40 150 :header-rows: 1 - Description - This ESP32 module features 64-Mbit PSRAM for flexible extended storage and data processing capabilities. - Five unpopulated through-hole solder pads to provide access to selected GPIOs of ESP32. For details, see `GPIO Header 2`_. - A 4-bit DIP switch used to configure the functionality of selected GPIOs of ESP32. Please note that placement of GPIO pin number marking on the board's silkscreen besides the DIP switch is incorrect. For details and correct pin allocation see `Function Switch`_.
339
- Two LEDs to show the status of UART transmission. - The FT2232H chip serves as a multi-protocol USB-to-serial bridge which can be programmed and controlled via USB to provide communication with ESP32. FT2232H also features USB-to-JTAG interface which is available on channel A of the chip, while USB-to-serial is on channel B. The FT2232H chip enhances user-friendliness in terms of application development and debugging. See `ESP32-Ethernet-Kit V1.1 Ethernet board (A) schematic`_. - USB interface. Power supply for the board as well as the communication interface between a computer and the board. - Power On/Off Switch. Toggling the switch to **5V0** position powers the board on, toggling to **GND** position powers the board off. - The 5 V power supply interface can be more convenient when the board is operating autonomously (not connected to a computer). - This red LED turns on when power is supplied to the board, either from USB or 5 V Input. - Provided DC 5 V to 3.
339
3 V conversion, output current up to 2 A. - A pair male and female header pins for mounting the `PoE board (B)`_. - The physical layer (PHY) connection to the Ethernet cable is implemented using the `IP101GRI `_ chip. The connection between PHY and ESP32 is done through the reduced media-independent interface (RMII), a variant of the media-independent interface `(MII) `_ standard. The PHY supports the IEEE 802.3/802.3u standard of 10/100 Mbps. - Ethernet network data transmission port. - The Magnetics are part of the Ethernet specification to protect against faults and transients, including rejection of common mode signals between the transceiver IC and the cable. The magnetics also provide galvanic isolation between the transceiver and the Ethernet device. - Two LEDs (green and red) that respectively indicate the "Link" and "Activity" statuses of the PHY. - Download button. Holding down **BOOT** and then pressing **EN** initiates Firmware Download mode for downloading firmware through the serial port.
339
- Reset button. - This header provides six unpopulated through-hole solder pads connected to spare GPIOs of ESP32. For details, see `GPIO Header 1`_. PoE Board (B) This board coverts power delivered over the Ethernet cable (PoE) to provide a power supply for the Ethernet board (A). The main components of the PoE board (B) are shown on the block diagram under `Functionality Overview`_. The PoE board (B) has the following features: To take advantage of the PoE functionality the **RJ45 Port** of the Ethernet board (A) should be connected with an Ethernet cable to a switch that supports PoE. When the Ethernet board (A) detects 5 V power output from the PoE board (B), the USB power will be automatically cut off. .. figure:: ../../../_static/esp32-ethernet-kit-b-v1.0-layout.png :align: center :scale: 80% :alt: ESP32-Ethernet-Kit - PoE board (B) :figclass: align-center ESP32-Ethernet-Kit - PoE board (B) layout (click to enlarge) .. list-table:: Table PoE board (B) :widths: 40 150 :header-rows: 1 - Description - Four female (left) and four male (right) header pins for connecting the PoE board (B) to :ref:`Ethernet board (A) `.
339
The pins on the left accept power coming from a PoE switch. The pins on the right deliver 5 V power supply to the Ethernet board (A). - Optional power supply (26.6 ~ 54 V) to the PoE board (B). .. _get-started-esp32-ethernet-kit-v1.1-setup-options: Setup Options This section describes options to configure the ESP32-Ethernet-Kit hardware. Function Switch When in On position, this DIP switch is routing listed GPIOs to FT2232H to provide JTAG functionality. When in Off position, the GPIOs may be used for other purposes. DIP SW GPIO Pin 1 GPIO13 2 GPIO12 3 GPIO15 4 GPIO14 .. note:: Placement of GPIO pin number marking on the board's silkscreen besides the DIP switch is incorrect. Please use instead the pin order as in the table above. RMII Clock Selection The ethernet MAC and PHY under RMII working mode need a common 50 MHz reference clock (i.e., RMII clock) that can be provided either externally, or generated from internal ESP32 APLL.
339
.. note:: For additional information on the RMII clock selection, please refer to `ESP32-Ethernet-Kit V1.1 Ethernet board (A) schematic`_, sheet 2, location D2. RMII Clock Sourced Externally by PHY """""""""""""""""""""""""""""""""""" By default, the ESP32-Ethernet-Kit is configured to provide RMII clock for the IP101GRI PHY's 50M_CLKO output. The clock signal is generated by the frequency multiplication of 25 MHz crystal connected to the PHY. For details, please see the figure below. .. figure:: ../../../_static/esp32-ethernet-kit-rmii-clk-from-phy.png :align: center :scale: 80% :alt: RMII Clock from IP101GRI PHY :figclass: align-center RMII Clock from IP101GRI PHY Please note that the PHY is reset on power up by pulling the RESET_N signal down with a resistor. ESP32 should assert RESET_N high with GPIO5 to enable PHY. Only this can ensure the power-up of system. Otherwise ESP32 may enter download mode (when the clock signal of REF_CLK_50M is at a high logic level during the GPIO0 power-up sampling phase).
339
RMII Clock Sourced Internally from ESP32's APLL """"""""""""""""""""""""""""""""""""""""""""""" Another option is to source the RMII Clock from internal ESP32 APLL, see figure below. The clock signal coming from GPIO0 is first inverted, to account for transmission line delay, and then supplied to the PHY. .. figure:: ../../../_static/esp32-ethernet-kit-rmii-clk-to-phy.png :align: center :scale: 80% :alt: RMII Clock from ESP Internal APLL :figclass: align-center RMII Clock from ESP Internal APLL To implement this option, users need to remove or add some RC components on the board. For details please refer to `ESP32-Ethernet-Kit V1.1 Ethernet board (A) schematic`_, sheet 2, location D2. Please note that if the APLL is already used for other purposes (e.g., I2S peripheral), then you have no choice but use an external RMII clock. GPIO Allocation This section describes allocation of ESP32 GPIOs to specific interfaces or functions of the ESP32-Ethernet-Kit. IP101GRI (PHY) Interface The allocation of the ESP32 (MAC) pins to IP101GRI (PHY) is shown in the table below.
339
Implementation of ESP32-Ethernet-Kit defaults to Reduced Media-Independent Interface (RMII). . ESP32 Pin (MAC) IP101GRI (PHY) *RMII Interface* 1 GPIO21 TX_EN 2 GPIO19 TXD[0] 3 GPIO22 TXD[1] 4 GPIO25 RXD[0] 5 GPIO26 RXD[1] 6 GPIO27 CRS_DV 7 GPIO0 REF_CLK *Serial Management Interface* 8 GPIO23 MDC 9 GPIO18 MDIO *PHY Reset* 10 GPIO5 Reset_N .. note:: Except for REF_CLK, the allocation of all pins under the ESP32's *RMII Interface* is fixed and cannot be changed either through IOMUX or GPIO Matrix. GPIO Header 1 This header exposes some GPIOs that are not used elsewhere on the ESP32-Ethernet-Kit. . ESP32 Pin 1 GPIO32 2 GPIO33 3 GPIO34 4 GPIO35 5 GPIO36 6 GPIO39 GPIO Header 2 This header contains GPIOs that may be used for other purposes depending on scenarios described in column "Comments".
339
. ESP32 Pin Comments 1 GPIO17 See note 1 2 GPIO16 See note 1 3 GPIO4 4 GPIO2 5 GPIO13 See note 2 6 GPIO12 See note 2 7 GPIO15 See note 2 8 GPIO14 See note 2 9 GND Ground 10 3V3 3.3 V power supply .. note:: GPIO Allocation Summary .. csv-table:: :header: ESP32-WROVER-B,IP101GRI,UART,JTAG,GPIO,Comments S_VP,,,,IO36, S_VN,,,,IO39, IO34,,,,IO34, IO35,,,,IO35, IO32,,,,IO32, IO33,,,,IO33, IO25,RXD[0],,,, IO26,RXD[1],,,, IO27,CRS_DV,,,, IO14,,,TMS,IO14, IO12,,,TDI,IO12, IO13,,RTS,TCK,IO13, IO15,,CTS,TDO,IO15, IO2,,,,IO2, IO0,REF_CLK,,,,See note 1 IO4,,,,IO4, IO16,,,,IO16 (NC),See note 2 IO17,,,,IO17 (NC),See note 2 IO5,Reset_N,,,,See note 1 IO18,MDIO,,,, IO19,TXD[0],,,, IO21,TX_EN,,,, RXD0,,RXD,,, TXD0,,TXD,,, IO22,TXD[1],,,, IO23,MDC,,,, .. note:: Start Application Development Before powering up your ESP32-Ethernet-Kit, please make sure that the board is in good condition with no obvious signs of damage.
339
Initial Setup Now to Development Proceed to :doc:`../../get-started/index`, where Section :ref:`get-started-step-by-step` will quickly help you set up the development environment and then flash an example project onto your board. Move on to the next section only if you have successfully completed all the above steps. Configure and Load the Ethernet Example After setting up the development environment and testing the board, you can configure and flash the :example:`ethernet/basic` example. This example has been created for testing Ethernet functionality. It supports different PHY, including **IP101GRI** installed on :ref:`get-started-esp32-ethernet-kit-v1.1`. Summary of Changes from ESP32-Ethernet-Kit V1.0 Other Versions of ESP32-Ethernet-Kit Related Documents For other design documentation for the board, please contact us at sales@espressif.com. .. _ESP32-Ethernet-Kit V1.1 Ethernet board (A) schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-ETHERNET-KIT_A_V1.
339
1_20190711.pdf .. _ESP32-Ethernet-Kit V1.0 PoE board (B) schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-ETHERNET-KIT_B_V1.0_20190517.pdf .. _ESP32-Ethernet-Kit V1.0 Ethernet board (A) schematic: https://dl.espressif.com/dl/schematics/SCH_ESP32-ETHERNET-KIT_A_V1.0_20190517.pdf .. toctree:: :hidden: get-started-ethernet-kit-v1.0.rst
339
This user guide provides information on ESP32-DevKitS(-R), an ESP32-based flashing board produced by Espressif. ESP32-DevKitS(-R) is a combination of two board names: ESP32-DevKitS and ESP32-DevKitS-R. S stands for springs, and R stands for WROVER. +++ | |ESP32-DevKitS| | |ESP32-DevKitS-R| | +++ | ESP32-DevKitS | ESP32-DevKitS-R | +++ .. |ESP32-DevKitS| image:: ../../../_static/esp32-devkits-v1.1-layout-isometric-raw.png .. |ESP32-DevKitS-R| image:: ../../../_static/esp32-devkits-r-v1.1-layout-isometric-raw.png The document consists of the following major sections: - `Getting Started`_: Provides an overview of ESP32-DevKitS(-R) and hardware/software setup instructions to get started. - `Hardware Reference`_: Provides more detailed information about ESP32-DevKitS(-R)'s hardware. - `Related Documents`_: Gives links to related documentation. Getting Started This section describes how to get started with ESP32-DevKitS(-R). It begins with a few introductory sections about ESP32-DevKitS(-R), then Section `How to Flash a Board`_ provides instructions on how to mount a module onto ESP32-DevKitS(-R), get it ready, and flash firmware onto it.
340
Overview ESP32-DevKitS(-R) is Espressif's flashing board designed specifically for ESP32. It can be used to flash an ESP32 module without soldering the module to the power supply and signal lines. With a module mounted, ESP32-DevKitS(-R) can also be used as a mini development board like ESP32-DevKitC. ESP32-DevKitS and ESP32-DevKitS-R boards vary only in layout of spring pins to fit the following ESP32 modules. - ESP32-DevKitS: - ESP32-WROOM-32 - ESP32-WROOM-32D - ESP32-WROOM-32U - ESP32-SOLO-1 - ESP32-WROOM-32E - ESP32-WROOM-32UE - ESP32-DevKitS-R: - ESP32-WROVER (PCB & IPEX) - ESP32-WROVER-B (PCB & IPEX) - ESP32-WROVER-E - ESP32-WROVER-IE For information about above modules, please refer to `ESP32 Series Modules `_. Description of Components .. figure:: ../../../_static/esp32-devkits-v1.1-layout-front.png :align: center :alt: ESP32-DevKitS - front :figclass: align-center ESP32-DevKitS - front .. figure:: ../../../_static/esp32-devkits-r-v1.
340
1-layout-front.png :align: center :alt: ESP32-DevKitS-R - front :figclass: align-center ESP32-DevKitS-R - front .. list-table:: :widths: 30 70 :header-rows: 1 - Description - Click the module in. The pins will fit into the module's castellated holes. - These female headers are connected to pins of the module mounted on this board. For description of female headers, please refer to `Header Blocks`_. - Single-chip USB to UART bridge provides transfer rates of up to 3 Mbps. - 5V-to-3.3V low-dropout voltage regulator (LDO). - USB interface. Power supply for the board as well as the communication interface between a computer and the board. - Reset button. - Download button. Holding down **Boot** and then pressing **EN** initiates Firmware Download mode for downloading firmware through the serial port. - Turns on when the USB or power supply is connected to the board. How to Flash a Board Before powering up your ESP32-DevKitS(-R), please make sure that it is in good condition with no obvious signs of damage.
340
Required Hardware - An ESP32 module of your choice - USB 2.0 cable (Standard-A to Micro-B) - Computer running Windows, Linux, or macOS Hardware Setup Please mount a module of your choice onto your ESP32-DevKitS(-R) according to the following steps: - Gently put your module on the ESP32-DevKitS(-R) board. Make sure that castellated holes on your module are aligned with spring pins on the board. - Press your module down into the board until it clicks. - Check whether all spring pins are inserted into castellated holes. If there are some misaligned spring pins, place them into castellated holes with tweezers. Software Setup Preferred Method ++++++++++++++++ The ESP-IDF development framework provides a preferred way of flashing binaries onto ESP32-DevKitS(-R). Please proceed to :doc:`../../get-started/index`, where Section :ref:`get-started-step-by-step` will quickly help you set up the development environment and then flash an application example onto your ESP32-DevKitS(-R).
340
Alternative Method ++++++++++++++++++ As an alternative, Windows users can flash binaries using the `Flash Download Tool `_. Just download it, unzip it, and follow the instructions inside the *doc* folder. .. note:: Board Dimensions .. figure:: ../../../_static/esp32-devkits-v1.1-dimensions-back.png :align: center :alt: ESP32-DevKitS :figclass: align-center ESP32-DevKitS board dimensions - back .. figure:: ../../../_static/esp32-devkits-r-v1.1-dimensions-back.png :align: center :alt: ESP32-DevKitS-R :figclass: align-center ESP32-DevKitS-R board dimensions - back Contents and Packaging Retail Orders If you order a few samples, each ESP32-DevKitS(-R) comes in an individual package in either antistatic bag or any packaging depending on a retailer. For retail orders, please go to https://www.espressif.com/en/contact-us/get-samples. Wholesale Orders If you order in bulk, the boards come in large cardboard boxes. For wholesale orders, please go to https://www.
340
espressif.com/en/contact-us/sales-questions. Hardware Reference Block Diagram A block diagram below shows the components of ESP32-DevKitS(-R) and their interconnections. .. figure:: ../../../_static/esp32-devkits-r-v1.1-block_diagram.png :align: center :scale: 70% :alt: ESP32-DevKitS(-R) - block diagram (click to enlarge) :figclass: align-center ESP32-DevKitS(-R) (click to enlarge) Power Supply Options There are three mutually exclusive ways to provide power to the board: - Micro USB port, default power supply - 5V and GND header pins - 3V3 and GND header pins It is advised to use the first option: micro USB port. Header Blocks . Label Signal L1 3V3 VDD 3V3 L2 EN CHIP_PU L3 VP SENSOR_VP L4 VN SENSOR_VN L5 34 GPIO34 L6 35 GPIO35 L7 32 GPIO32 L8 33 GPIO33 L9 25 GPIO25 L10 26 GPIO26 L11 27 GPIO27 L12 14 GPIO14 L13 12 GPIO12 L14 GND GND L15 13 GPIO13 L16 D2 SD_DATA2 L17 D3 SD_DATA3 L18 CMD SD_CMD L19 5V External 5V R1 GND GND R2 23 GPIO23 R3 22 GPIO22 R4 TX U0TXD R5 RX U0RXD R6 21 GPIO21 R7 GND GND R8 19 GPIO19 R9 18 GPIO18 R10 5 GPIO5 R11 17 GPIO17 R12 16 GPIO16 R13 4 GPIO4 R14 0 GPIO0 R15 2 GPIO2 R16 15 GPIO15 R17 D1 SD_DATA1 R18 D0 SD_DATA0 R19 CLK SD_CLK For the image of header blocks, please refer to `Description of Components`_.
340
Related Documents - `ESP32-DevKitS(-R) Schematics `_ (PDF) - `ESP32 Datasheet `_ (PDF) - `ESP32-WROOM-32 Datasheet `_ (PDF) - `ESP32-WROOM-32D & ESP32-WROOM-32U Datasheet `_ (PDF) - `ESP32-SOLO-1 Datasheet `_ (PDF) - `ESP32-WROVER Datasheet `_ (PDF) - `ESP32-WROVER-B Datasheet `_ (PDF) - `ESP Product Selector `_
340
ESP32-PICO-DevKitM-2 Overview ESP32-PICO-DevKitM-2 is an ESP32-based development board produced by `Espressif `_. The core of this board is `ESP32-PICO-MINI-02/02U `_ module with complete Wi-Fi and Bluetooth® functionalities. The development board features a USB-to-UART Bridge circuit which allows developers to connect the board to a computer's USB port for flashing and debugging. All the IO signals and system power on ESP32-PICO-MINI-02/02U are led out to two rows of 18 x 0.1" header pads on both sides of the development board for easy access. For compatibility with Dupont wires, all header pads are populated with two rows of male pin headers. .. note:: ESP32-PICO-DevKitM-2 comes with male headers by default. ESP32-PICO-DevKitM-2 provides the users with hardware for development of applications based on the ESP32, making it easier for users to explore ESP32 functionalities. .. figure:: ../../../_static/esp32-pico-devkitm-2-overview.png :align: center :scale: 70% :alt: ESP32-PICO-DevKitM-2 (click to enlarge) :figclass: align-center ESP32-PICO-DevKitM-2 Overview (click to enlarge) This guide covers: - `Getting Started`_: Provides an overview of the ESP32-PICO-DevKitM-2 and software setup instructions to get started.
341