index.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. ***********
  2. Get Started
  3. ***********
  4. :link_to_translation:`zh_CN:[中文]`
  5. .. Please keep README.md in sync with these instructions.
  6. This document is intended to help you set up the software development environment for the hardware based on the {IDF_TARGET_NAME} chip by Espressif.
  7. After that, a simple example will show you how to use ESP-IDF (Espressif IoT Development Framework) for menu configuration, then for building and flashing firmware onto an {IDF_TARGET_NAME} board.
  8. .. include-build-file:: inc/version-note.inc
  9. Introduction
  10. ============
  11. {IDF_TARGET_NAME} is a system on a chip that integrates the following features:
  12. .. only:: esp32
  13. * Wi-Fi (2.4 GHz band)
  14. * Bluetooth
  15. * Dual high performance cores
  16. * Ultra Low Power co-processor
  17. * Multiple peripherals
  18. .. only:: esp32s2
  19. * Wi-Fi (2.4 GHz band)
  20. * High performance single-core
  21. * Ultra Low Power co-processor running either RISC-V or FSM core
  22. * Multiple peripherals
  23. * Built-in security hardware
  24. * USB OTG interface
  25. Powered by 40 nm technology, {IDF_TARGET_NAME} provides a robust, highly integrated platform, which helps meet the continuous demands for efficient power usage, compact design, security, high performance, and reliability.
  26. Espressif provides basic hardware and software resources to help application developers realize their ideas using the {IDF_TARGET_NAME} series hardware. The software development framework by Espressif is intended for development of Internet-of-Things (IoT) applications with Wi-Fi, Bluetooth, power management and several other system features.
  27. What You Need
  28. =============
  29. Hardware:
  30. * An **{IDF_TARGET_NAME}** board
  31. * **USB cable** - USB A / micro USB B
  32. * **Computer** running Windows, Linux, or macOS
  33. Software:
  34. You have a choice to either download and install the following software manually
  35. * **Toolchain** to compile code for {IDF_TARGET_NAME}
  36. * **Build tools** - CMake and Ninja to build a full **Application** for {IDF_TARGET_NAME}
  37. * **ESP-IDF** that essentially contains API (software libraries and source code) for {IDF_TARGET_NAME} and scripts to operate the **Toolchain**
  38. **or** get through the onboarding process using the following official plugins for integrated development environments (IDE) described in separate documents
  39. * `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin>`_ (`installation link <https://github.com/espressif/idf-eclipse-plugin#installing-idf-plugin-using-update-site-url>`_)
  40. * `VS Code Extension <https://github.com/espressif/vscode-esp-idf-extension>`_ (`onboarding <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/ONBOARDING.md>`_)
  41. .. figure:: ../../_static/what-you-need.png
  42. :align: center
  43. :alt: Development of applications for {IDF_TARGET_NAME}
  44. :figclass: align-center
  45. Development of applications for {IDF_TARGET_NAME}
  46. Development Board Overviews
  47. ===========================
  48. If you have one of {IDF_TARGET_NAME} development boards listed below, you can click on the link to learn more about its hardware.
  49. .. only:: esp32
  50. .. toctree::
  51. :maxdepth: 1
  52. ESP32-DevKitC <../hw-reference/esp32/get-started-devkitc>
  53. ESP-WROVER-KIT <../hw-reference/esp32/get-started-wrover-kit>
  54. ESP32-PICO-KIT <../hw-reference/esp32/get-started-pico-kit>
  55. ESP32-Ethernet-Kit <../hw-reference/esp32/get-started-ethernet-kit>
  56. ESP32-DevKit-S(-R) <../hw-reference/esp32/user-guide-devkits-r-v1.1>
  57. .. only:: esp32s2
  58. .. toctree::
  59. :maxdepth: 1
  60. ESP32-S2-Saola-1 <../hw-reference/esp32s2/user-guide-saola-1-v1.2>
  61. ESP32-S2-Kaluga-Kit <../hw-reference/esp32s2/user-guide-esp32-s2-kaluga-1-kit>
  62. .. _get-started-step-by-step:
  63. Installation Step by Step
  64. =========================
  65. This is a detailed roadmap to walk you through the installation process.
  66. Setting up Development Environment
  67. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68. * :ref:`get-started-get-prerequisites` for :doc:`Windows <windows-setup>`, :doc:`Linux <linux-setup>`, or :doc:`macOS <macos-setup>`
  69. * :ref:`get-started-get-esp-idf`
  70. * :ref:`get-started-set-up-tools`
  71. * :ref:`get-started-set-up-env`
  72. Creating Your First Project
  73. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. * :ref:`get-started-start-project`
  75. * :ref:`get-started-connect`
  76. * :ref:`get-started-configure`
  77. * :ref:`get-started-build`
  78. * :ref:`get-started-flash`
  79. * :ref:`get-started-build-monitor`
  80. .. _get-started-get-prerequisites:
  81. Step 1. Install prerequisites
  82. =============================
  83. Some tools need to be installed on the computer before proceeding to the next steps. Follow the links below for the instructions for your OS:
  84. .. toctree::
  85. :hidden:
  86. Windows <windows-setup>
  87. Linux <linux-setup>
  88. macOS <macos-setup>
  89. +-------------------+-------------------+-------------------+
  90. | |windows-logo| | |linux-logo| | |macos-logo| |
  91. +-------------------+-------------------+-------------------+
  92. | `Windows`_ | `Linux`_ | `mac OS`_ |
  93. +-------------------+-------------------+-------------------+
  94. .. |windows-logo| image:: ../../_static/windows-logo.png
  95. :target: ../get-started/windows-setup.html
  96. .. |linux-logo| image:: ../../_static/linux-logo.png
  97. :target: ../get-started/linux-setup.html
  98. .. |macos-logo| image:: ../../_static/macos-logo.png
  99. :target: ../get-started/macos-setup.html
  100. .. _Windows: ../get-started/windows-setup.html
  101. .. _Linux: ../get-started/linux-setup.html
  102. .. _mac OS: ../get-started/macos-setup.html
  103. .. _get-started-get-esp-idf:
  104. Step 2. Get ESP-IDF
  105. ===================
  106. To build applications for the {IDF_TARGET_NAME}, you need the software libraries provided by Espressif in `ESP-IDF repository <https://github.com/espressif/esp-idf>`_.
  107. To get ESP-IDF, navigate to your installation directory and clone the repository with ``git clone``, following instructions below specific to your operating system.
  108. .. note::
  109. This guide uses the directory ``~/esp`` on Linux and macOS or ``%userprofile%\esp`` on Windows as an installation folder for ESP-IDF. You can use any directory, but you will need to adjust paths for the commands respectively. Keep in mind that ESP-IDF does not support spaces in paths.
  110. Linux and macOS
  111. ~~~~~~~~~~~~~~~
  112. Open Terminal, and run the following commands:
  113. .. include-build-file:: inc/git-clone-bash.inc
  114. ESP-IDF will be downloaded into ``~/esp/esp-idf``.
  115. Consult :doc:`/versions` for information about which ESP-IDF version to use in a given situation.
  116. Windows
  117. ~~~~~~~
  118. In addition to installing the tools, :ref:`get-started-windows-tools-installer` for Windows introduced in Step 1 can also download a copy of ESP-IDF.
  119. Consult :doc:`/versions` for information about which ESP-IDF version to use in a given situation.
  120. If you wish to download ESP-IDF without the help of ESP-IDF Tools Installer, refer to these :ref:`instructions <get-esp-idf-windows-command-line>`.
  121. .. _get-started-set-up-tools:
  122. Step 3. Set up the tools
  123. ========================
  124. Aside from the ESP-IDF, you also need to install the tools used by ESP-IDF, such as the compiler, debugger, Python packages, etc.
  125. Windows
  126. ~~~~~~~
  127. :ref:`get-started-windows-tools-installer` for Windows introduced in Step 1 installs all the required tools.
  128. If you want to install the tools without the help of ESP-IDF Tools Installer, open the Command Prompt and follow these steps:
  129. .. code-block:: batch
  130. cd %userprofile%\esp\esp-idf
  131. install.bat
  132. or with Windows PowerShell
  133. .. code-block:: powershell
  134. cd ~/esp/esp-idf
  135. ./install.ps1
  136. Linux and macOS
  137. ~~~~~~~~~~~~~~~
  138. .. code-block:: bash
  139. cd ~/esp/esp-idf
  140. ./install.sh
  141. Customizing the tools installation path
  142. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143. The scripts introduced in this step install compilation tools required by ESP-IDF inside the user home directory: ``$HOME/.espressif`` on Linux and macOS, ``%USERPROFILE%\.espressif`` on Windows. If you wish to install the tools into a different directory, set 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.
  144. If changing the ``IDF_TOOLS_PATH``, make sure it is set to the same value every time the Install script (``install.bat``, ``install.ps1`` or ``install.sh``) and an Export script (``export.bat``, ``export.ps1`` or ``export.sh``) are executed.
  145. .. _get-started-set-up-env:
  146. Step 4. Set up the environment variables
  147. ========================================
  148. 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.
  149. Windows
  150. ~~~~~~~
  151. :ref:`get-started-windows-tools-installer` for Windows creates an "ESP-IDF Command Prompt" shortcut in the Start Menu. This shortcut opens the Command Prompt and sets up all the required environment variables. You can open this shortcut and proceed to the next step.
  152. Alternatively, if you want to use ESP-IDF in an existing Command Prompt window, you can run:
  153. .. code-block:: batch
  154. %userprofile%\esp\esp-idf\export.bat
  155. or with Windows PowerShell
  156. .. code-block:: powershell
  157. .$HOME/esp/esp-idf/export.ps1
  158. Linux and macOS
  159. ~~~~~~~~~~~~~~~
  160. In the terminal where you are going to use ESP-IDF, run:
  161. .. code-block:: bash
  162. . $HOME/esp/esp-idf/export.sh
  163. Note the space between the leading dot and the path!
  164. If you plan to use esp-idf frequently, you can create an alias for executing ``export.sh``:
  165. 1. Copy and paste the following command to your shell's profile (``.profile``, ``.bashrc``, ``.zprofile``, etc.)
  166. .. code-block:: bash
  167. alias get_idf='. $HOME/esp/esp-idf/export.sh'
  168. 2. Refresh the configuration by restarting the terminal session or by running ``source [path to profile]``, for example, ``source ~/.bashrc``.
  169. Now you can run ``get_idf`` to set up or refresh the esp-idf environment in any terminal session.
  170. 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.
  171. .. _get-started-start-project:
  172. Step 5. Start a Project
  173. =======================
  174. 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 IDF.
  175. Copy the project :example:`get-started/hello_world` to ``~/esp`` directory:
  176. Linux and macOS
  177. ~~~~~~~~~~~~~~~
  178. .. code-block:: bash
  179. cd ~/esp
  180. cp -r $IDF_PATH/examples/get-started/hello_world .
  181. Windows
  182. ~~~~~~~
  183. .. code-block:: batch
  184. cd %userprofile%\esp
  185. xcopy /e /i %IDF_PATH%\examples\get-started\hello_world hello_world
  186. There is a range of example projects in the :idf:`examples` directory in ESP-IDF. You can copy any project in the same way as presented above and run it.
  187. It is also possible to build examples in-place, without copying them first.
  188. .. important::
  189. The ESP-IDF build system does not support spaces in the paths to either ESP-IDF or to projects.
  190. .. _get-started-connect:
  191. Step 6. Connect Your Device
  192. ===========================
  193. Now connect your {IDF_TARGET_NAME} board to the computer and check under what serial port the board is visible.
  194. Serial ports have the following patterns in their names:
  195. - **Windows**: names like ``COM1``
  196. - **Linux**: starting with ``/dev/tty``
  197. - **macOS**: starting with ``/dev/cu.``
  198. If you are not sure how to check the serial port name, please refer to :doc:`establish-serial-connection` for full details.
  199. .. note::
  200. Keep the port name handy as you will need it in the next steps.
  201. .. _get-started-configure:
  202. Step 7. Configure
  203. =================
  204. Navigate to your ``hello_world`` directory from :ref:`get-started-start-project`, set {IDF_TARGET_NAME} chip as the target and run the project configuration utility ``menuconfig``.
  205. Linux and macOS
  206. ~~~~~~~~~~~~~~~
  207. .. code-block:: bash
  208. cd ~/esp/hello_world
  209. idf.py set-target {IDF_TARGET_PATH_NAME}
  210. idf.py menuconfig
  211. Windows
  212. ~~~~~~~
  213. .. code-block:: batch
  214. cd %userprofile%\esp\hello_world
  215. idf.py set-target {IDF_TARGET_PATH_NAME}
  216. idf.py menuconfig
  217. Setting the target with ``idf.py set-target {IDF_TARGET_PATH_NAME}`` should be done once, after opening a new project. If the project contains some existing builds and configuration, they will be cleared and initialized. The target may be saved in environment variable to skip this step at all. See :ref:`selecting-idf-target` for additional information.
  218. If the previous steps have been done correctly, the following menu appears:
  219. .. figure:: ../../_static/project-configuration.png
  220. :align: center
  221. :alt: Project configuration - Home window
  222. :figclass: align-center
  223. Project configuration - Home window
  224. You are using this menu to set up project specific variables, e.g. Wi-Fi network name and password, the processor speed, etc. Setting up the project with menuconfig may be skipped for "hello_word". This example will run with default configuration.
  225. .. only:: esp32
  226. .. attention::
  227. If you use ESP32-DevKitC board with the **ESP32-SOLO-1** module, enable single core mode (:ref:`CONFIG_FREERTOS_UNICORE`) in menuconfig before flashing examples.
  228. .. note::
  229. The colors of the menu could be different in your terminal. You can change the appearance with the option
  230. ``--style``. Please run ``idf.py menuconfig --help`` for further information.
  231. .. _get-started-build:
  232. Step 8. Build the Project
  233. =========================
  234. Build the project by running:
  235. .. code-block:: batch
  236. idf.py build
  237. This command will compile the application and all ESP-IDF components, then it will generate the bootloader, partition table, and application binaries.
  238. .. code-block:: none
  239. $ idf.py build
  240. Running cmake in directory /path/to/hello_world/build
  241. Executing "cmake -G Ninja --warn-uninitialized /path/to/hello_world"...
  242. Warn about uninitialized values.
  243. -- Found Git: /usr/bin/git (found version "2.17.0")
  244. -- Building empty aws_iot component due to configuration
  245. -- Component names: ...
  246. -- Component paths: ...
  247. ... (more lines of build system output)
  248. [527/527] Generating hello-world.bin
  249. esptool.py v2.3.1
  250. Project build complete. To flash, run this command:
  251. ../../../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
  252. or run 'idf.py -p PORT flash'
  253. If there are no errors, the build will finish by generating the firmware binary .bin files.
  254. .. _get-started-flash:
  255. Step 9. Flash onto the Device
  256. =============================
  257. Flash the binaries that you just built (bootloader.bin, partition-table.bin and hello-world.bin) onto your {IDF_TARGET_NAME} board by running:
  258. .. code-block:: bash
  259. idf.py -p PORT [-b BAUD] flash
  260. Replace PORT with your {IDF_TARGET_NAME} board's serial port name from :ref:`get-started-connect`.
  261. You can also change the flasher baud rate by replacing BAUD with the baud rate you need. The default baud rate is ``460800``.
  262. For more information on idf.py arguments, see :ref:`idf.py`.
  263. .. note::
  264. The option ``flash`` automatically builds and flashes the project, so running ``idf.py build`` is not necessary.
  265. Encountered Issues While Flashing?
  266. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  267. 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 manual reset described below, and if it does not help you can find more details about possible issues in `Troubleshooting <https://github.com/espressif/esptool#bootloader-wont-respond>`_.
  268. ``esptool.py`` resets {IDF_TARGET_NAME} automatically by asserting DTR and RTS control lines of the USB to serial converter chip, i.e., FTDI or CP210x (for more information, see :doc:`establish-serial-connection`). The DTR and RTS control lines are in turn connected to ``GPIO0`` 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. As an example, check the `schematic <https://dl.espressif.com/dl/schematics/esp32_devkitc_v4-sch-20180607a.pdf>`_ for the ESP32 DevKitC development board.
  269. 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:
  270. - Your hardware does not have the DTR and RTS lines connected to ``GPIO0`` and ``CIHP_PU``
  271. - The DTR and RTS lines are configured differently
  272. - There are no such serial control lines at all
  273. 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).
  274. - 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 (``GPIO0``) and press the **EN** button (``CHIP_PU``).
  275. - For other types of hardware, try pulling ``GPIO0`` down.
  276. Normal Operation
  277. ~~~~~~~~~~~~~~~~
  278. When flashing, you will see the output log similar to the following:
  279. .. only:: esp32
  280. .. code-block:: none
  281. ...
  282. esptool.py --chip esp32 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
  283. esptool.py v3.0-dev
  284. Serial port /dev/ttyUSB0
  285. Connecting........_
  286. Chip is ESP32D0WDQ6 (revision 0)
  287. Features: WiFi, BT, Dual Core, Coding Scheme None
  288. Crystal is 40MHz
  289. MAC: 24:0a:c4:05:b9:14
  290. Uploading stub...
  291. Running stub...
  292. Stub running...
  293. Changing baud rate to 460800
  294. Changed.
  295. Configuring flash size...
  296. Compressed 3072 bytes to 103...
  297. Writing at 0x00008000... (100 %)
  298. Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 5962.8 kbit/s)...
  299. Hash of data verified.
  300. Compressed 26096 bytes to 15408...
  301. Writing at 0x00001000... (100 %)
  302. Wrote 26096 bytes (15408 compressed) at 0x00001000 in 0.4 seconds (effective 546.7 kbit/s)...
  303. Hash of data verified.
  304. Compressed 147104 bytes to 77364...
  305. Writing at 0x00010000... (20 %)
  306. Writing at 0x00014000... (40 %)
  307. Writing at 0x00018000... (60 %)
  308. Writing at 0x0001c000... (80 %)
  309. Writing at 0x00020000... (100 %)
  310. Wrote 147104 bytes (77364 compressed) at 0x00010000 in 1.9 seconds (effective 615.5 kbit/s)...
  311. Hash of data verified.
  312. Leaving...
  313. Hard resetting via RTS pin...
  314. Done
  315. .. only:: esp32s2
  316. .. code-block:: none
  317. ...
  318. esptool.py --chip esp32s2 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
  319. esptool.py v3.0-dev
  320. Serial port /dev/ttyUSB0
  321. Connecting....
  322. Chip is ESP32-S2
  323. Features: WiFi
  324. Crystal is 40MHz
  325. MAC: 18:fe:34:72:50:e3
  326. Uploading stub...
  327. Running stub...
  328. Stub running...
  329. Changing baud rate to 460800
  330. Changed.
  331. Configuring flash size...
  332. Compressed 3072 bytes to 103...
  333. Writing at 0x00008000... (100 %)
  334. Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 3851.6 kbit/s)...
  335. Hash of data verified.
  336. Compressed 22592 bytes to 13483...
  337. Writing at 0x00001000... (100 %)
  338. Wrote 22592 bytes (13483 compressed) at 0x00001000 in 0.3 seconds (effective 595.1 kbit/s)...
  339. Hash of data verified.
  340. Compressed 140048 bytes to 70298...
  341. Writing at 0x00010000... (20 %)
  342. Writing at 0x00014000... (40 %)
  343. Writing at 0x00018000... (60 %)
  344. Writing at 0x0001c000... (80 %)
  345. Writing at 0x00020000... (100 %)
  346. Wrote 140048 bytes (70298 compressed) at 0x00010000 in 1.7 seconds (effective 662.5 kbit/s)...
  347. Hash of data verified.
  348. Leaving...
  349. Hard resetting via RTS pin...
  350. Done
  351. If there are no issues by the end of the flash process, the board will reboot and start up the “hello_world” application.
  352. If you'd like to use the Eclipse or VS Code IDE instead of running ``idf.py``, check out the :doc:`Eclipse guide <eclipse-setup>`, :doc:`VS Code guide <vscode-setup>`.
  353. .. _get-started-build-monitor:
  354. Step 10. Monitor
  355. ================
  356. 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).
  357. This command launches the :doc:`IDF Monitor <../api-guides/tools/idf-monitor>` application::
  358. $ idf.py -p /dev/ttyUSB0 monitor
  359. Running idf_monitor in directory [...]/esp/hello_world/build
  360. Executing "python [...]/esp-idf/tools/idf_monitor.py -b 115200 [...]/esp/hello_world/build/hello-world.elf"...
  361. --- idf_monitor on /dev/ttyUSB0 115200 ---
  362. --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
  363. ets Jun 8 2016 00:22:57
  364. rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
  365. ets Jun 8 2016 00:22:57
  366. ...
  367. After startup and diagnostic logs scroll up, you should see "Hello world!" printed out by the application.
  368. .. code-block:: none
  369. ...
  370. Hello world!
  371. Restarting in 10 seconds...
  372. This is esp32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 2MB external flash
  373. Restarting in 9 seconds...
  374. Restarting in 8 seconds...
  375. Restarting in 7 seconds...
  376. To exit IDF monitor use the shortcut ``Ctrl+]``.
  377. .. only:: esp32
  378. 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.
  379. .. figure:: ../../_static/get-started-garbled-output.png
  380. :align: center
  381. :alt: Garbled output
  382. :figclass: align-center
  383. If you have such a problem, do the following:
  384. 1. Exit the monitor.
  385. 2. Go back to :ref:`menuconfig <get-started-configure>`.
  386. 3. Go to Component config --> ESP32-specific --> Main XTAL frequency, then change :ref:`CONFIG_ESP32_XTAL_FREQ_SEL` to 26 MHz.
  387. 4. After that, :ref:`build and flash <get-started-flash>` the application again.
  388. .. note::
  389. You can combine building, flashing and monitoring into one step by running::
  390. idf.py -p PORT flash monitor
  391. See also:
  392. - :doc:`IDF Monitor <../api-guides/tools/idf-monitor>` for handy shortcuts and more details on using IDF monitor.
  393. - :ref:`idf.py` for a full reference of ``idf.py`` commands and options.
  394. **That's all that you need to get started with {IDF_TARGET_NAME}!**
  395. Now you are ready to try some other :idf:`examples`, or go straight to developing your own applications.
  396. .. important::
  397. Some of examples do not support {IDF_TARGET_NAME} because required hardware is not included in {IDF_TARGET_NAME} so it cannot be supported.
  398. 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}.
  399. Updating ESP-IDF
  400. ================
  401. You should update ESP-IDF from time to time, as newer versions fix bugs and provide new features. 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`.
  402. Another solution is to update only what has changed. :ref:`The update procedure depends on the version of ESP-IDF you are using <updating>`.
  403. 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`.
  404. Once the new tools are installed, update the environment using the Export script. See instructions at :ref:`get-started-set-up-env`.
  405. Related Documents
  406. =================
  407. .. toctree::
  408. :maxdepth: 1
  409. establish-serial-connection
  410. eclipse-setup
  411. vscode-setup
  412. ../api-guides/tools/idf-monitor
  413. toolchain-setup-scratch
  414. :esp32: ../get-started-legacy/index
  415. .. _Stable version: https://docs.espressif.com/projects/esp-idf/en/stable/
  416. .. _Releases page: https://github.com/espressif/esp-idf/releases