Merge branch 'docs/update_get-started' into 'master'

Docs: Update format issues for  EN and CN files under get-started folder

Closes DOC-5616

See merge request espressif/esp-idf!24425
This commit is contained in:
Cai Xin Ying 2023-07-11 15:03:50 +08:00
commit de3d690bde
16 changed files with 143 additions and 143 deletions

View File

@ -136,7 +136,7 @@ Sometimes the USB-to-UART bridge is external. This is often used in small develo
.. only:: SOC_USB_OTG_SUPPORTED or SOC_USB_SERIAL_JTAG_SUPPORTED
Flash using USB
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.
@ -160,7 +160,7 @@ Sometimes the USB-to-UART bridge is external. This is often used in small develo
After flashing the binaries, a manual reset is needed.
Flash using UART
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.
@ -189,7 +189,7 @@ You can change the flasher baud rate by replacing ``BAUD`` with the baud rate yo
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.
@ -210,7 +210,7 @@ Figures below show serial port for ESP32 DevKitC and ESP32 WROVER KIT
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:
@ -225,11 +225,11 @@ macOS ::
.. note::
macOS users: if you don't see the serial port then check you have the USB/serial drivers installed. 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.
macOS users: if you do not see the serial port then check you have the USB/serial drivers installed. 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`` on Linux
Adding User to ``dialout`` 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::
@ -242,7 +242,7 @@ on Arch Linux this is done by adding the user to ``uucp`` group with the followi
Make sure you re-login to enable read and write permissions for the serial port.
Verify serial connection
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}.
@ -258,7 +258,7 @@ Now verify that the serial connection is operational. You can do this using a se
Windows and Linux
^^^^^^^^^^^^^^^^^
In this example we will use `PuTTY SSH Client <https://www.putty.org/>`_ that is available for both Windows and Linux. You can use other serial programs and set communication parameters like below.
In this example, we use `PuTTY SSH Client <https://www.putty.org/>`_ 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.
@ -276,7 +276,7 @@ Run terminal and set identified serial port. Baud rate = 115200 (if needed, chan
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 will depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_.
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`_.
.. note::
@ -295,13 +295,13 @@ To spare you the trouble of installing a serial terminal program, macOS offers t
/dev/cu.Bluetooth-Incoming-Port /dev/cu.SLAB_USBtoUART /dev/cu.SLAB_USBtoUART7
- The output will vary 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)::
- 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 will depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. To exit the **screen** session type Ctrl-A + \\ .
- 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 **screen** session type Ctrl-A + \\ .
.. note::
@ -338,7 +338,7 @@ If you can see readable log output, it means serial connection is working and yo
.. 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} will boot and produce serial output. 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.
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. 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`.

View File

@ -25,12 +25,12 @@ These are the steps for setting up the ESP-IDF for your {IDF_TARGET_NAME}.
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 will help you on getting everything installed on Linux and macOS based systems.
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 will need to get the following packages. The command to run depends on which distribution of Linux you are using:
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::
@ -47,13 +47,13 @@ CentOS 7 is still supported but CentOS version 8 is recommended for a better use
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 doesn't have one.
- 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 will use the version of Python installed by default on macOS.
ESP-IDF uses the version of Python installed by default on macOS.
- Install CMake & Ninja build:
@ -74,7 +74,7 @@ ESP-IDF will use the version of Python installed by default on macOS.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Then you will need to install the XCode command line tools to continue. You can install these by running ``xcode-select --install``.
Then you need to install the XCode command line tools to continue. You can install these by running ``xcode-select --install``.
Apple M1 Users
~~~~~~~~~~~~~~
@ -88,7 +88,7 @@ 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 will need to install Apple Rosetta 2 by running
Then you need to install Apple Rosetta 2 by running
.. code-block:: bash
@ -98,11 +98,11 @@ Then you will need to install Apple Rosetta 2 by running
Installing Python 3
~~~~~~~~~~~~~~~~~~~
Based on macOS `Catalina 10.15 release notes`_, use of Python 2.7 is not recommended and Python 2.7 will not be included by default in future versions of macOS. Check what Python you currently have::
Based on macOS `Catalina 10.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 isn't already installed on your computer::
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
@ -131,13 +131,13 @@ Open Terminal, and run the following commands:
.. include-build-file:: inc/git-clone-bash.inc
ESP-IDF will be downloaded into ``~/esp/esp-idf``.
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
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}.
@ -194,7 +194,7 @@ 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 doesn't change the URLs used to access any Git repositories.
.. 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``:
@ -204,7 +204,7 @@ To prefer the Espressif download server when installing tools, use the following
export IDF_GITHUB_ASSETS="dl.espressif.com/github_assets"
./install.sh
Customizing the tools installation path
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, 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.
@ -213,7 +213,7 @@ If changing the ``IDF_TOOLS_PATH``, make sure it is set to the same value every
.. _get-started-set-up-env:
Step 4. Set up the environment variables
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.

View File

@ -1,6 +1,6 @@
Now since all requirements are met, the next topic will guide you on how to start your first project.
This guide will help 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.
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::
@ -38,7 +38,7 @@ If you are not sure how to check the serial port name, please refer to :doc:`est
.. note::
Keep the port name handy as you will need it in the next steps.
Keep the port name handy as it is needed in the next steps.
Configure Your Project
======================
@ -51,7 +51,7 @@ Navigate to your ``hello_world`` directory, set {IDF_TARGET_NAME} as the target,
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, will be 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.
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. 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:
@ -88,7 +88,7 @@ You are using this menu to set up project specific variables, e.g., Wi-Fi networ
``Component config`` > ``ESP System Settings`` > ``Channel for console output``
2. Change to the option (the default will be always UART):
2. Change to the option (the default is always UART):
``USB CDC``

View File

@ -11,7 +11,7 @@ Build the project by running:
idf.py build
This command will compile the application and all ESP-IDF components, then it will generate the bootloader, partition table, and application binaries.
This command compiles the application and all ESP-IDF components, then it generates the bootloader, partition table, and application binaries.
.. code-block:: none
@ -33,7 +33,7 @@ This command will compile the application and all ESP-IDF components, then it wi
../../../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 will finish by generating the firmware binary .bin files.
If there are no errors, the build finishes by generating the firmware binary .bin files.
Flash onto the Device
@ -362,7 +362,7 @@ When flashing, you will see the output log similar to the following:
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'd like to use the Eclipse or VS Code IDE instead of running ``idf.py``, check out `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_, `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md>`_.
If you would like to use the Eclipse or VS Code IDE instead of running ``idf.py``, check out `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_, `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md>`_.
Monitor the Output
==================
@ -433,7 +433,7 @@ See also:
- :doc:`IDF Monitor <../api-guides/tools/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's all that you need to get started with {IDF_TARGET_NAME}!**
**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.
@ -474,7 +474,7 @@ ESP-IDF supports Python 3.7 or newer. It is recommended to upgrade your operatin
.. only:: esp32
**Here's an example of how to add ESP-WROVER-KIT BSP to your project:**
**Here is an example of how to add ESP-WROVER-KIT BSP to your project:**
.. code-block:: bash
@ -482,7 +482,7 @@ ESP-IDF supports Python 3.7 or newer. It is recommended to upgrade your operatin
.. only:: esp32s2
**Here's an example of how to add ESP32-S2-Kaluga-Kit BSP to your project:**
**Here is an example of how to add ESP32-S2-Kaluga-Kit BSP to your project:**
.. code-block:: bash
@ -490,7 +490,7 @@ ESP-IDF supports Python 3.7 or newer. It is recommended to upgrade your operatin
.. only:: esp32s3
**Here's an example of how to add ESP-BOX BSP to your project:**
**Here is an example of how to add ESP-BOX BSP to your project:**
.. code-block:: bash

View File

@ -1,12 +1,12 @@
*********************************
Updating ESP-IDF tools on Windows
Updating ESP-IDF Tools on Windows
*********************************
:link_to_translation:`zh_CN:[中文]`
.. _get-started-install_bat-windows:
Install ESP-IDF tools using a script
Install ESP-IDF Tools Using a Script
====================================
From the Windows Command Prompt, change to the directory where ESP-IDF is installed. Then run::
@ -17,16 +17,16 @@ For Powershell, change to the directory where ESP-IDF is installed. Then run::
install.ps1
This will download and install 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``.
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
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 wasn't started using that shortcut. If this is the case, follow the instructions below to add ESP-IDF tools to PATH.
In some cases, you may want to work with ESP-IDF in a Command Prompt window which was not started using that shortcut. 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``::

View File

@ -9,7 +9,7 @@ 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're going to use the Command Prompt, but after ESP-IDF is installed you can use `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_ or another graphical IDE with CMake support instead.
For this Getting Started we are going to use the Command Prompt, but after ESP-IDF is installed you can use `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_ or another graphical IDE with CMake support instead.
.. note::
Limitations:
@ -17,7 +17,7 @@ For this Getting Started we're going to use the Command Prompt, but after ESP-ID
- 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 and reboot the computer.
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.
.. _get-started-windows-tools-installer:
@ -39,7 +39,7 @@ The easiest way to install ESP-IDF's prerequisites is to download one of ESP-IDF
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 will download only necessary dependencies including `Git For Windows`_ during the installation process. The installer stores downloaded files in the cache directory ``%userprofile%\.espressif``
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`_ .
@ -59,7 +59,7 @@ The installer also allows reusing the existing directory with ESP-IDF. The recom
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 will launch ESP-IDF environment in selected prompt.
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``:
@ -96,7 +96,7 @@ At the end of the installation process you can check out option ``Run ESP-IDF Po
Using the Command Prompt
========================
For the remaining Getting Started steps, we're going to use the Windows 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.

View File

@ -1,6 +1,6 @@
Now since all requirements are met, the next topic will guide you on how to start your first project.
Now since all requirements are met, the next topic guides you on how to start your first project.
This guide will help 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.
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::
@ -35,7 +35,7 @@ If you are not sure how to check the serial port name, please refer to :doc:`est
.. note::
Keep the port name handy as you will need it in the next steps.
Keep the port name handy as it is needed in the next steps.
Configure Your Project
======================
@ -51,7 +51,7 @@ Windows
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, will be 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.
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. 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:
@ -85,7 +85,7 @@ You are using this menu to set up project specific variables, e.g., Wi-Fi networ
``Component config ---> ESP System Settings ---> Channel for console output``
2. Change to the option (the default will be always UART):
2. Change to the option (the default is always UART):
``USB CDC``

View File

@ -177,7 +177,7 @@
以上驱动仅供参考,请查看开发板用户指南,了解开发板具体使用的 USB 至 UART 桥芯片。一般情况下,当 {IDF_TARGET_NAME} 开发板与 PC 连接时,对应驱动程序应该已经被打包在操作系统中,并已经自动安装。
对于使用 USB 至 UART 桥下载的设备,可以运行以下命令,包括定义波特率的可选参数。
对于使用 USB 至 UART 桥下载的设备,可以运行以下命令,包括定义波特率的可选参数。
.. code-block:: bash
@ -232,7 +232,7 @@ macOS::
在 Linux 中添加用户到 ``dialout``
-----------------------------------
当前登录用户应当可以通过 USB 对串口进行读写操作。在多数 Linux 版本中,都可以通过以下命令,将用户添加到 ``dialout`` 组,从而获许读写权限::
当前登录用户应当可以通过 USB 对串口进行读写操作。在多数 Linux 版本中,都可以通过以下命令,将用户添加到 ``dialout`` 组,从而获许读写权限::
sudo usermod -a -G dialout $USER
@ -258,7 +258,7 @@ macOS::
Windows 和 Linux 操作系统
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
在本示例中,我们将使用 `PuTTY SSH Client <https://www.putty.org/>`_ `PuTTY SSH Client <https://www.putty.org/>`_ 既可用于 Windows 也可用于 Linux。也可以使用其他串口程序并设置如下的通信参数。
在本示例中,我们将使用 `PuTTY SSH Client <https://www.putty.org/>`_`PuTTY SSH Client <https://www.putty.org/>`_ 既可用于 Windows 也可用于 Linux。也可以使用其他串口程序并设置如下的通信参数。
运行终端,配置在上述步骤中确认的串口:波特率 = 115200如有需要请更改为使用芯片的默认波特率数据位 = 8停止位 = 1奇偶校验 = N。以下截屏分别展示了如何在 Windows 和 Linux 中配置串口和上述通信参数(如 115200-8-1-N。注意这里一定要选择在上述步骤中确认的串口进行配置。
@ -280,28 +280,28 @@ Windows 和 Linux 操作系统
.. 注解::
请在验证完串口通信正常后,关闭串口终端。如果您让终端一直保持打开的状态,之后上传固件时将无法访问串口。
请在验证完串口通信正常后,关闭串口终端。如果终端一直保持打开的状态,之后上传固件时将无法访问串口。
macOS 操作系统
^^^^^^^^^^^^^^^^^
macOS 提供了 **屏幕** 命令,因此您不用安装串口终端程序。
macOS 提供了 **屏幕** 命令,因此无需安装串口终端程序。
- 参考 `在 Linux 和 macOS 上查看端口`_,运行以下命令::
ls /dev/cu.*
- 会看到类似如下输出::
- 会看到类似如下输出::
/dev/cu.Bluetooth-Incoming-Port /dev/cu.SLAB_USBtoUART /dev/cu.SLAB_USBtoUART7
- 根据连接到电脑上的开发板类型和数量输出结果会有所不同。请选择开发板的设备名称并运行以下命令如有需要请将“115200”更改为使用芯片的默认波特率::
- 根据连接到电脑上的开发板类型和数量输出结果会有所不同。请选择开发板的设备名称并运行以下命令如有需要请将“115200”更改为使用芯片的默认波特率::
screen /dev/cu.device_name 115200
``device_name`` 替换为运行 ``ls /dev/cu.*`` 后出现的设备串口号。
- 您需要的正是 **屏幕** 显示的日志。日志内容取决于加载到 {IDF_TARGET_NAME} 的应用程序,请参考 `输出示例`_。请使用 Ctrl-A + \\ 键退出 **屏幕** 会话。
- **屏幕** 显示的日志即为所需内容。日志内容取决于加载到 {IDF_TARGET_NAME} 的应用程序,请参考 `输出示例`_。请使用 Ctrl-A + \\ 键退出 **屏幕** 会话。
.. 注解::
@ -334,12 +334,12 @@ macOS 提供了 **屏幕** 命令,因此您不用安装串口终端程序。
I (45) boot: compile time 18:48:10
...
如果打印出的日志是可读的(而不是乱码),则表示串口连接正常。此时,可以继续进行安装,并最终将应用程序上载到 {IDF_TARGET_NAME}。
如果打印出的日志是可读的(而不是乱码),则表示串口连接正常。此时,可以继续进行安装,并最终将应用程序上载到 {IDF_TARGET_NAME}。
.. 注解::
在某些串口接线方式下,在 {IDF_TARGET_NAME} 启动并开始打印串口日志前,需要在终端程序中禁用串口 RTS DTR 管脚。该问题仅存在于将 RTS DTR 管脚直接连接到 EN GPIO0 管脚上的情况,绝大多数开发板(包括乐鑫所有的开发板)都没有这个问题。更多详细信息,请参考 `esptool 文档`_
在安装 {IDF_TARGET_NAME} 硬件开发的软件环境时,从 :ref:`get-started-connect` 跳转到了这里,请从 :ref:`get-started-configure` 继续阅读。
如在安装 {IDF_TARGET_NAME} 硬件开发的软件环境时,从 :ref:`get-started-connect` 跳转到了这里,请从 :ref:`get-started-configure` 继续阅读。
.. _esptool 文档: https://docs.espressif.com/projects/esptool/en/latest/advanced-topics/boot-mode-selection.html#automatic-bootloader

View File

@ -14,11 +14,11 @@
一般来说,使用官方的 ESP-IDF 开发板不会出现问题。但是, ``esptool.py`` 在以下情况下不能自动重置硬件:
- 您的硬件没有连接到 ``{IDF_TARGET_STRAP_GPIO}````CIHP_PU`` 的 DTR 和 RTS 控制线。
- 硬件未连接到 ``{IDF_TARGET_STRAP_GPIO}````CIHP_PU`` 的 DTR 和 RTS 控制线。
- DTR 和 RTS 控制线的配置方式不同。
- 不存在这样的串行控制线路。
根据硬件的种类,也可以将您的 {IDF_TARGET_NAME} 开发板手动设置为固件下载模式(复位)。
根据硬件的种类,也可以将 {IDF_TARGET_NAME} 开发板手动设置为固件下载模式(复位)。
- 对于乐鑫开发板,可以参考对应开发板的入门指南或用户指南。例如,可以通过按住 ``Boot`` 按钮 (``{IDF_TARGET_STRAP_GPIO}``) 再按住 ``EN`` 按钮 (``CHIP_PU``) 来手动复位 ESP-IDF 开发板。
- 对于乐鑫开发板,可以参考对应开发板的入门指南或用户指南。例如,可以通过按住 ``Boot`` 按钮 (``{IDF_TARGET_STRAP_GPIO}``) 再按住 ``EN`` 按钮 (``CHIP_PU``) 来手动复位 ESP-IDF 开发板。
- 对于其他类型的硬件,可以尝试将 ``{IDF_TARGET_STRAP_GPIO}`` 拉低。

View File

@ -87,10 +87,10 @@
~~~~~~~~~~~~~~~~
* 一款 **{IDF_TARGET_NAME}** 开发板
* **USB 数据线** (A 转 Micro-B)
* **USB 数据线** A 转 Micro-B
* 电脑Windows、Linux 或 macOS
.. note:: 目前一些开发板使用的是 USB Type C 接口。请确保使用合适的数据线来连接开发板!
.. note:: 目前一些开发板使用的是 USB Type C 接口。请确保使用合适的数据线来连接开发板
以下是 {IDF_TARGET_NAME} 官方开发板,点击链接可了解更多硬件信息。
@ -172,12 +172,12 @@
安装
============
我们提供以下方法帮助安装所有需要的软件,可根据需要选择其中之一。
为安装所需软件,乐鑫提供了以下方法,可根据需要选择其中之一。
IDE
~~~~~~
.. note:: 建议通过自己喜欢的集成开发环境 (IDE) 安装 ESP-IDF。
.. note:: 建议通过自己喜欢的集成开发环境 (IDE) 安装 ESP-IDF。
* `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md>`_
* `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md>`_
@ -185,7 +185,7 @@ IDE
手动安装
~~~~~~~~~~~~~~~~~~~
请根据您的操作系统选择对应的手动安装流程。
请根据操作系统选择对应的手动安装流程。
.. toctree::
:maxdepth: 1
@ -196,6 +196,6 @@ IDE
编译第一个工程
===================
如果您已经安装好 ESP-IDF 且没有使用集成开发环境 (IDE),请在命令提示行中按照 :ref:`在 Windows 中开始创建工程 <get-started-windows-first-steps>`:ref:`在 Linux 和 macOS 中开始创建工程 <get-started-linux-macos-first-steps>` 编译第一个工程。
如果已经安装好 ESP-IDF且没有使用集成开发环境 (IDE),请在命令提示行中按照 :ref:`在 Windows 中开始创建工程 <get-started-windows-first-steps>`:ref:`在 Linux 和 macOS 中开始创建工程 <get-started-linux-macos-first-steps>` 编译第一个工程。
.. _Stable version: https://docs.espressif.com/projects/esp-idf/en/stable/

View File

@ -25,7 +25,7 @@ Linux 和 macOS 平台工具链的标准设置
第一步:安装准备
=============================
为了在 {IDF_TARGET_NAME} 中使用 ESP-IDF需要根据操作系统安装一些软件包。以下安装指南可协助您安装 Linux 和 macOS 的系统上所有需要的软件包。
为了在 {IDF_TARGET_NAME} 中使用 ESP-IDF需要根据操作系统安装一些软件包。可以参考以下安装指南,安装 Linux 和 macOS 的系统上所有需要的软件包。
Linux 用户
~~~~~~~~~~~~~~~~~~~~
@ -48,7 +48,7 @@ Linux 用户
.. note::
- 使用 ESP-IDF 需要 CMake 3.16 或以上版本。较早的 Linux 发行版可能需要升级自身的软件源仓库,或开启 backports 套件库,或安装 "cmake3" 软件包(不是安装 "cmake")。
- 如果上述列表中没有您使用的系统,请参考您所用系统的相关文档,查看安装软件包所用的命令。
- 如果上述列表中没有当前所用系统,请参考所用系统的相关文档,查看安装软件包所用的命令。
macOS 用户
~~~~~~~~~~~~~~~
@ -57,11 +57,11 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。
- 安装 CMake 和 Ninja 编译工具:
- 若有 HomeBrew_可以运行::
- 若有 HomeBrew_可以运行::
brew install cmake ninja dfu-util
- 若有 MacPorts_可以运行::
- 若有 MacPorts_可以运行::
sudo port install cmake ninja dfu-util
@ -70,7 +70,7 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。
- 强烈建议同时安装 ccache_ 以获得更快的编译速度。如有 HomeBrew_可通过 MacPorts_ 上的 ``brew install ccache````sudo port install ccache`` 完成安装。
.. note::
在上述任何步骤中遇到以下错误::
如在上述任何步骤中遇到以下错误::
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
@ -79,7 +79,7 @@ ESP-IDF 将使用 macOS 上默认安装的 Python 版本。
Apple M1 用户
~~~~~~~~~~~~~~~~~~
如果使用的是 Apple M1 系列且看到如下错误提示::
如果使用的是 Apple M1 系列且看到如下错误提示::
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.
@ -88,7 +88,7 @@ Apple M1 用户
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
您需要运行如下命令来安装 Apple Rosetta 2
运行如下命令,安装 Apple Rosetta 2
.. code-block:: bash
@ -98,11 +98,11 @@ Apple M1 用户
安装 Python 3
---------------------------------------------
`Catalina 10.15 发布说明`_ 中表示不推荐使用 Python 2.7 版本,在未来的 macOS 版本中也不会默认包含 Python 2.7。执行以下命令来检查当前使用的 Python 版本::
`Catalina 10.15 发布说明`_ 中表示不推荐使用 Python 2.7 版本,在未来的 macOS 版本中也不会默认包含 Python 2.7。执行以下命令来检查当前使用的 Python 版本::
python --version
如果输出结果是 ``Python 2.7.17``,则代表您的默认解析器是 Python 2.7。这时需要运行以下命令检查电脑上是否已经安装过 Python 3::
如果输出结果是 ``Python 2.7.17``,则代表默认解析器是 Python 2.7。这时需要运行以下命令检查电脑上是否已经安装过 Python 3::
python3 --version
@ -125,7 +125,7 @@ Apple M1 用户
在围绕 {IDF_TARGET_NAME} 构建应用程序之前,请先获取乐鑫提供的软件库文件 `ESP-IDF 仓库 <https://github.com/espressif/esp-idf>`_
获取 ESP-IDF 的本地副本:打开终端,切换到要保存 ESP-IDF 的工作目录,使用 ``git clone`` 命令克隆远程仓库。针对不同操作系统的详细步骤,请见下文。
获取 ESP-IDF 的本地副本:打开终端,切换到要保存 ESP-IDF 的工作目录,使用 ``git clone`` 命令克隆远程仓库。针对不同操作系统的详细步骤,请见下文。
打开终端,运行以下命令:
@ -140,7 +140,7 @@ ESP-IDF 将下载至 ``~/esp/esp-idf``。
第三步:设置工具
=================================
除了 ESP-IDF 本身,还需要为支持 {IDF_TARGET_NAME} 的项目安装 ESP-IDF 使用的各种工具比如编译器、调试器、Python 包等。
除了 ESP-IDF 本身,还需要为支持 {IDF_TARGET_NAME} 的项目安装 ESP-IDF 使用的各种工具比如编译器、调试器、Python 包等。
.. code-block:: bash
@ -183,11 +183,11 @@ ESP-IDF 将下载至 ``~/esp/esp-idf``。
./install.fish all
.. note::
对于 macOS 用户,如在上述任何步骤中遇到以下错误::
对于 macOS 用户,如在上述任何步骤中遇到以下错误::
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:xxx)
可运行电脑 Python 文件夹中的 ``Install Certificates.command`` 安装证书。了解更多信息,请参考 `安装 ESP-IDF 工具时出现的下载错误 <https://github.com/espressif/esp-idf/issues/4775>`_
可运行电脑 Python 文件夹中的 ``Install Certificates.command`` 安装证书。了解更多信息,请参考 `安装 ESP-IDF 工具时出现的下载错误 <https://github.com/espressif/esp-idf/issues/4775>`_
下载工具备选方案
~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -207,16 +207,16 @@ ESP-IDF 工具安装器会下载 Github 发布版本中附带的一些工具,
自定义工具安装路径
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
本步骤中介绍的脚本将 ESP-IDF 所需的编译工具默认安装在用户的根目录中,即 Linux 系统中的 ``$HOME/.espressif`` 目录。可以选择将工具安装到其他目录中,但请在运行安装脚本前,重新设置环境变量 ``IDF_TOOLS_PATH``。注意,请确保您的用户账号已经具备了读写该路径的权限。
本步骤中介绍的脚本将 ESP-IDF 所需的编译工具默认安装在用户的根目录中,即 Linux 系统中的 ``$HOME/.espressif`` 目录。可以选择将工具安装到其他目录中,但请在运行安装脚本前,重新设置环境变量 ``IDF_TOOLS_PATH``。注意,请确保用户账号已经具备了读写该路径的权限。
如果修改了 ``IDF_TOOLS_PATH`` 变量,请确保该变量在每次执行安装脚本 (``install.bat````install.ps1````install.sh``) 和导出脚本 (``export.bat````export.ps1````export.sh``) 均保持一致。
如果修改了 ``IDF_TOOLS_PATH`` 变量,请确保该变量在每次执行安装脚本``install.bat````install.ps1````install.sh``)和导出脚本(``export.bat````export.ps1````export.sh``)均保持一致。
.. _get-started-set-up-env:
第四步:设置环境变量
=======================================
此时,刚刚安装的工具尚未添加至 PATH 环境变量,无法通过“命令窗口”使用这些工具。因此,必须设置一些环境变量。这可以通过 ESP-IDF 提供的另一个脚本进行设置。
此时,刚刚安装的工具尚未添加至 PATH 环境变量,无法通过“命令窗口”使用这些工具。因此,必须设置一些环境变量。这可以通过 ESP-IDF 提供的另一个脚本进行设置。
请在需要运行 ESP-IDF 的终端窗口运行以下命令:
@ -232,7 +232,7 @@ ESP-IDF 工具安装器会下载 Github 发布版本中附带的一些工具,
注意,命令开始的 "." 与路径之间应有一个空格!
如果需要经常运行 ESP-IDF可以为执行 ``export.sh`` 创建一个别名,具体步骤如下:
如果需要经常运行 ESP-IDF可以为执行 ``export.sh`` 创建一个别名,具体步骤如下:
1. 复制并粘贴以下命令到 shell 配置文件中(``.profile````.bashrc````.zprofile`` 等)
@ -242,9 +242,9 @@ ESP-IDF 工具安装器会下载 Github 发布版本中附带的一些工具,
2. 通过重启终端窗口或运行 ``source [path to profile]``,如 ``source ~/.bashrc`` 来刷新配置文件。
现在可以在任何终端窗口中运行 ``get_idf`` 来设置或刷新 esp-idf 环境。
现在可以在任何终端窗口中运行 ``get_idf`` 来设置或刷新 ESP-IDF 环境。
不建议直接将 ``export.sh`` 添加到 shell 的配置文件。这样做会导致在每个终端会话中都激活 IDF 虚拟环境(包括无需使用 IDF 的会话)。这违背了使用虚拟环境的目的,还可能影响其他软件的使用。
不建议直接将 ``export.sh`` 添加到 shell 的配置文件。这样做会导致在每个终端会话中都激活 IDF 虚拟环境(包括无需使用 ESP-IDF 的会话)。这违背了使用虚拟环境的目的,还可能影响其他软件的使用。
.. _get-started-start-a-project:
.. _get-started-build:
@ -261,11 +261,11 @@ ESP-IDF 工具安装器会下载 Github 发布版本中附带的一些工具,
建议:更新 ESP-IDF
======================
乐鑫会不时推出新版本的 ESP-IDF修复 bug 或提供新的功能。请注意EESP-IDF 的每个主要版本和次要版本都有相应的支持期限。支持期限满后,版本停止更新维护,用户可将项目升级到最新的 ESP-IDF 版本。更多关于支持期限的信息,请参考 :doc:`ESP-IDF 版本 <../versions>`
乐鑫会不时推出新版本的 ESP-IDF修复 bug 或提供新的功能。请注意ESP-IDF 的每个主要版本和次要版本都有相应的支持期限。支持期限满后,版本停止更新维护,用户可将项目升级到最新的 ESP-IDF 版本。更多关于支持期限的信息,请参考 :doc:`ESP-IDF 版本 <../versions>`
因此,在使用时,也应注意更新本地版本。最简单的方法是:直接删除本地的 ``esp-idf`` 文件夹,然后按照 :ref:`get-started-get-esp-idf` 中的指示,重新完成克隆。
因此,在使用时,也应注意更新本地版本。最简单的方法是:直接删除本地的 ``esp-idf`` 文件夹,然后按照 :ref:`get-started-get-esp-idf` 中的指示,重新完成克隆。
另一种方法是仅更新变更的部分。具体方式,请前往 :ref:`更新 ESP-IDF <updating>` 章节查看。具体更新步骤会根据使用的 ESP-IDF 版本有所不同。
另一种方法是仅更新变更的部分,具体方式请前往 :ref:`更新 ESP-IDF <updating>` 章节查看。具体更新步骤会根据使用的 ESP-IDF 版本有所不同。
注意,更新完成后,请再次运行安装脚本,以防新版 ESP-IDF 所需的工具也有所更新。具体请参考 :ref:`get-started-set-up-tools`

View File

@ -1,33 +1,33 @@
现在已经具备了使用 ESP-IDF 的所有条件,接下来将介绍如何开始您的第一个工程。
现在已经具备了使用 ESP-IDF 的所有条件,接下来将介绍如何开始第一个工程。
本指南将帮助您完成使用 ESP-IDF 的第一步。按照本指南,您将使用 {IDF_TARGET_NAME} 创建第一个工程,并构建、烧录和监控设备输出。
本指南将介绍如何初步上手 ESP-IDF包括如何使用 {IDF_TARGET_NAME} 创建第一个工程,并构建、烧录和监控设备输出。
.. note::
如果还未安装 ESP-IDF请参照 :ref:`get-started-step-by-step` 中的步骤,获取使用本指南所需的所有软件。
如果还未安装 ESP-IDF请参照 :ref:`get-started-step-by-step` 中的步骤,获取使用本指南所需的所有软件。
开始创建工程
================
现在,可以准备开发 {IDF_TARGET_NAME} 应用程序了。可以从 ESP-IDF 中 :idf:`examples` 目录下的 :example:`get-started/hello_world` 工程开始。
现在,可以准备开发 {IDF_TARGET_NAME} 应用程序了。可以从 ESP-IDF 中 :idf:`examples` 目录下的 :example:`get-started/hello_world` 工程开始。
.. important::
ESP-IDF 编译系统不支持 ESP-IDF 路径或其工程路径中带有空格。
:example:`get-started/hello_world` 工程复制至本地的 ``~/esp`` 目录下:
:example:`get-started/hello_world` 工程复制至本地的 ``~/esp`` 目录下:
.. code-block:: bash
cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
.. note:: ESP-IDF 的 :idf:`examples` 目录下有一系列示例工程,可以按照上述方法复制并运行其中的任何示例,也可以直接编译示例,无需进行复制。
.. note:: ESP-IDF 的 :idf:`examples` 目录下有一系列示例工程,可以按照上述方法复制并运行其中的任何示例,也可以直接编译示例,无需进行复制。
连接设备
==============
现在,请将您的 {IDF_TARGET_NAME} 开发板连接到 PC并查看开发板使用的串口。
现在,请将 {IDF_TARGET_NAME} 开发板连接到 PC并查看开发板使用的串口。
通常,串口在不同操作系统下显示的名称有所不同:
@ -38,7 +38,7 @@
.. note::
请记住串口名,您会在后续步骤中使用。
请记住串口名,以便后续使用。
配置工程
=============
@ -51,7 +51,7 @@
idf.py set-target {IDF_TARGET_PATH_NAME}
idf.py menuconfig
打开一个新工程后,应首先使用 ``idf.py set-target {IDF_TARGET_PATH_NAME}`` 设置“目标”芯片。注意,此操作将清除并初始化项目之前的编译和配置(如有)。也可以直接将“目标”配置为环境变量(此时可跳过该步骤)。更多信息,请见 :ref:`selecting-idf-target`
打开一个新工程后,应首先使用 ``idf.py set-target {IDF_TARGET_PATH_NAME}`` 设置“目标”芯片。注意,此操作将清除并初始化项目之前的编译和配置(如有)。也可以直接将“目标”配置为环境变量(此时可跳过该步骤)。更多信息,请见 :ref:`selecting-idf-target`
正确操作上述步骤后,系统将显示以下菜单:
@ -61,21 +61,21 @@
工程配置 — 主窗口
可以通过此菜单设置项目的具体变量,包括 Wi-Fi 网络名称、密码和处理器速度等。``hello_world`` 示例项目会以默认配置运行,因此在这一项目中,可以跳过使用 ``menuconfig`` 进行项目配置这一步骤。
可以通过此菜单设置项目的具体变量,包括 Wi-Fi 网络名称、密码和处理器速度等。``hello_world`` 示例项目会以默认配置运行,因此在这一项目中,可以跳过使用 ``menuconfig`` 进行项目配置这一步骤。
.. only:: esp32
.. attention::
如果使用的是 ESP32-DevKitC板载 ESP32-SOLO-1 模组)或 ESP32-DevKitM-1板载 ESP32-MINI-1(1U) 模组),请在烧写示例程序前,前往 ``menuconfig`` 中使能单核模式(:ref:`CONFIG_FREERTOS_UNICORE`)。
如果使用的是 ESP32-DevKitC板载 ESP32-SOLO-1 模组)或 ESP32-DevKitM-1板载 ESP32-MINI-1(1U) 模组),请在烧写示例程序前,前往 ``menuconfig`` 中使能单核模式(:ref:`CONFIG_FREERTOS_UNICORE`)。
.. note::
终端窗口中显示出的菜单颜色可能会与上图不同。可以通过选项 ``--style`` 来改变外观。请运行 ``idf.py menuconfig --help`` 命令,获取更多信息。
终端窗口中显示出的菜单颜色可能会与上图不同。可以通过选项 ``--style`` 来改变外观。请运行 ``idf.py menuconfig --help`` 命令,获取更多信息。
.. only:: esp32 or esp32s2 or esp32s3
如果使用的是支持的开发板,可以通过板级支持包 (BSP) 来协助您的开发。更多信息,请见 `其他提示 <#additional-tips>`__
如果使用的是支持的开发板,可以通过板级支持包 (BSP) 来协助开发。更多信息,请见 `其他提示 <#additional-tips>`__
.. only:: esp32s2

View File

@ -39,7 +39,7 @@
烧录到设备
=============================
请运行以下命令,将刚刚生成的二进制文件烧录至您的 {IDF_TARGET_NAME} 开发板:
请运行以下命令,将刚刚生成的二进制文件烧录至 {IDF_TARGET_NAME} 开发板:
.. code-block:: bash
@ -58,7 +58,7 @@
常规操作
~~~~~~~~~~~~~~~~
在烧录过程中,会看到类似如下的输出日志:
在烧录过程中,会看到类似如下的输出日志:
.. only:: esp32
@ -362,12 +362,12 @@
如果一切顺利,烧录完成后,开发板将会复位,应用程序 "hello_world" 开始运行。
如果希望使用 Eclipse 或是 VS Code IDE而非 ``idf.py``,请参考 `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README_CN.md>`_以及 `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md>`_。
如果希望使用 Eclipse 或是 VS Code IDE而非 ``idf.py``,请参考 `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README_CN.md>`_以及 `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md>`_。
监视输出
===============
可以使用 ``idf.py -p PORT monitor`` 命令,监视 “hello_world” 工程的运行情况。注意,不要忘记将 PORT 替换为的串口名称。
可以使用 ``idf.py -p PORT monitor`` 命令,监视 “hello_world” 工程的运行情况。注意,不要忘记将 PORT 替换为自己的串口名称。
运行该命令后,:doc:`IDF 监视器 <../api-guides/tools/idf-monitor>` 应用程序将启动:::
@ -382,7 +382,7 @@
ets Jun 8 2016 00:22:57
...
此时,就可以在启动日志和诊断日志之后,看到打印的 “Hello world!” 了。
此时,就可以在启动日志和诊断日志之后,看到打印的 “Hello world!” 了。
.. code-block:: none
@ -395,18 +395,18 @@
Restarting in 8 seconds...
Restarting in 7 seconds...
您可使用快捷键 ``Ctrl+]``退出 IDF 监视器。
使用快捷键 ``Ctrl+]``退出 ESP-IDF 监视器。
.. only:: esp32 or esp32c2
如果 IDF 监视器在烧录后很快发生错误,或打印信息全是乱码(如下),很有可能是因为您的开发板采用了 26 MHz 晶振,而 ESP-IDF 默认支持大多数开发板使用的 40 MHz 晶振。
如果 ESP-IDF 监视器在烧录后很快发生错误,或打印信息全是乱码(如下),很有可能是因为开发板采用了 26 MHz 晶振,而 ESP-IDF 默认支持大多数开发板使用的 40 MHz 晶振。
.. figure:: ../../_static/get-started-garbled-output.png
:align: center
:alt: 乱码输出
:figclass: align-center
此时,可以:
此时,可以:
1. 退出监视器。
2. 返回 ``menuconfig``
@ -424,18 +424,18 @@
.. note::
也可以运行以下命令,一次性执行构建、烧录和监视过程:
也可以运行以下命令,一次性执行构建、烧录和监视过程:
``idf.py -p PORT flash monitor``
此外,
- 请前往 :doc:`IDF 监视器 <../api-guides/tools/idf-monitor>`,了解更多使用 IDF 监视器的快捷键和其他详情。
- 请前往 :doc:`IDF 监视器 <../api-guides/tools/idf-monitor>`,了解更多使用 ESP-IDF 监视器的快捷键和其他详情。
- 请前往 :ref:`idf.py`,查看更多 ``idf.py`` 命令和选项。
**恭喜,您已完成 {IDF_TARGET_NAME} 的入门学习!**
**恭喜完成 {IDF_TARGET_NAME} 的入门学习!**
现在,可以尝试一些其他 :idf:`examples`,或者直接开发自己的应用程序。
现在,可以尝试一些其他 :idf:`examples`,或者直接开发自己的应用程序。
.. 重要::
@ -466,11 +466,11 @@ ESP-IDF 支持 Python 3.7 及以上版本,建议升级操作系统到最新版
上手板级支持包
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
可以使用 `板级支持包 (BSP) <https://github.com/espressif/esp-bsp>`_,协助在开发板上的原型开发。仅需要调用几个函数,便可以完成对特定开发板的初始化。
可以使用 `板级支持包 (BSP) <https://github.com/espressif/esp-bsp>`_,协助在开发板上的原型开发。仅需要调用几个函数,便可以完成对特定开发板的初始化。
一般来说BSP 支持开发板上所有硬件组件。除了管脚定义和初始化功能外BSP 还附带如传感器、显示器、音频编解码器等外部元件的驱动程序。
BSP 通过 :doc:`IDF 组件管理器 </api-guides/tools/idf-component-manager>` 发布,可以前往 `IDF 组件注册器 <https://components.espressif.com>`_ 进行下载。
BSP 通过 :doc:`IDF 组件管理器 </api-guides/tools/idf-component-manager>` 发布,可以前往 `IDF 组件注册器 <https://components.espressif.com>`_ 进行下载。
.. only:: esp32

View File

@ -17,16 +17,16 @@
install.ps1
该命令可下载并安装 ESP-IDF 所需的工具。如已经安装了某个版本的工具,则该命令将无效。该工具的下载安装位置由 ESP-IDF 工具安装器的设置决定,默认情况下为: ``C:\Users\username\.espressif``
该命令可下载并安装 ESP-IDF 所需的工具。如已经安装了某个版本的工具,则该命令将无效。该工具的下载安装位置由 ESP-IDF 工具安装器的设置决定,默认情况下为: ``C:\Users\username\.espressif``
.. _get-started-export_bat-windows:
使用“导出脚本”将 ESP-IDF 工具添加至 PATH 环境变量
=================================================================================
ESP-IDF 工具安装器将在“开始菜单”为 “ESP-IDF 命令提示符”创建快捷方式。点击该快捷方式可打开 Windows 命令提示符窗口,可在该窗口使用所有已安装的工具。
ESP-IDF 工具安装器将在“开始菜单”为 “ESP-IDF 命令提示符”创建快捷方式。点击该快捷方式可打开 Windows 命令提示符窗口,可在该窗口使用所有已安装的工具。
有些情况下,正在使用的命令提示符窗口并不是通过快捷方式打开的,此时如果想要在该窗口使用 ESP-IDF可以根据下方步骤将 ESP-IDF 工具添加至 PATH 环境变量。
有些情况下,正在使用的命令提示符窗口并不是通过快捷方式打开的,此时如果想要在该窗口使用 ESP-IDF可以根据下方步骤将 ESP-IDF 工具添加至 PATH 环境变量。
首先,请打开需要使用 ESP-IDF 的命令提示符窗口,切换至安装 ESP-IDF 的目录,然后执行 ``export.bat``,具体命令如下::
@ -38,4 +38,4 @@ ESP-IDF 工具安装器将在“开始菜单”为 “ESP-IDF 命令提示符”
cd ~/esp/esp-idf
export.ps1
运行完成后,就可以通过命令提示符使用 ESP-IDF 工具了。
运行完成后,就可以通过命令提示符使用 ESP-IDF 工具了。

View File

@ -9,7 +9,7 @@ Windows 平台工具链的标准设置
ESP-IDF 需要安装一些必备工具,才能围绕 {IDF_TARGET_NAME} 构建固件,包括 Python、Git、交叉编译器、CMake 和 Ninja 编译工具等。
在本入门指南中,我们通过 **命令提示符** 进行有关操作。不过,您在安装 ESP-IDF 后还可以使用 `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README_CN.md>`_ 或其他支持 CMake 的图形化工具 IDE。
本入门指南介绍了如何通过 **命令提示符** 进行有关操作。不过,安装 ESP-IDF 后还可以使用 `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin/blob/master/README_CN.md>`_ 或其他支持 CMake 的图形化工具 IDE。
.. note::
限定条件:
@ -17,7 +17,7 @@ ESP-IDF 需要安装一些必备工具,才能围绕 {IDF_TARGET_NAME} 构建
- Python 或 ESP-IDF 的安装路径中一定不能包含空格或括号。
- 除非操作系统配置为支持 Unicode UTF-8否则 Python 或 ESP-IDF 的安装路径中也不能包括特殊字符(非 ASCII 码字符)
系统管理员可以通过如下方式将操作系统配置为支持 Unicode UTF-8控制面板-更改日期、时间或数字格式-管理选项卡-更改系统地域-勾选选项 “Beta使用 Unicode UTF-8 支持全球语言”-点击确定-重启电脑。
系统管理员可以通过如下方式将操作系统配置为支持 Unicode UTF-8``Control Panel`` > 更改 ``date````time``、或 ``number`` 格式 > ``Administrative tab`` > 更改 ``system locale`` > 勾选选项 ``Beta: Use Unicode UTF-8 for worldwide language support`` > ``Ok`` > 重启电脑。
.. _get-started-windows-tools-installer:
@ -96,15 +96,15 @@ ESP-IDF 工具安装器
使用命令提示符
========================
在后续步骤中,我们将使用 Windows 的命令提示符进行操作。
在后续步骤中,将介绍如何使用 Windows 的命令提示符进行操作。
ESP-IDF 工具安装器可在“开始”菜单中,创建一个打开 ESP-IDF 命令提示符窗口的快捷方式。本快捷方式可以打开 Windows 命令提示符(即 cmd.exe并运行 ``export.bat`` 脚本以设置各环境变量(比如 ``PATH````IDF_PATH`` 等)。此外,您可还以通过 Windows 命令提示符使用各种已经安装的工具。
ESP-IDF 工具安装器可在“开始”菜单中,创建一个打开 ESP-IDF 命令提示符窗口的快捷方式。本快捷方式可以打开 Windows 命令提示符(即 cmd.exe并运行 ``export.bat`` 脚本以设置各环境变量(比如 ``PATH````IDF_PATH`` 等)。此外,还可以通过 Windows 命令提示符使用各种已经安装的工具。
注意,本快捷方式仅适用 ESP-IDF 工具安装器中指定的 ESP-IDF 路径。如果您的电脑上存在多个 ESP-IDF 路径(比如需要不同版本的 ESP-IDF有以下两种解决方法:
注意,本快捷方式仅适用 ESP-IDF 工具安装器中指定的 ESP-IDF 路径。如果电脑上存在多个 ESP-IDF 路径(比如需要不同版本的 ESP-IDF有以下两种解决方法
1. 为 ESP-IDF 工具安装器创建的快捷方式创建一个副本,并将新快捷方式的 ESP-IDF 工作路径指定为希望使用的 ESP-IDF 路径。
1. 为 ESP-IDF 工具安装器创建的快捷方式创建一个副本,并将新快捷方式的 ESP-IDF 工作路径指定为希望使用的 ESP-IDF 路径。
2. 或者,可以运行 ``cmd.exe``,并切换至希望使用的 ESP-IDF 目录,然后运行 ``export.bat``。注意,这种方法要求 ``PATH`` 中存在 Python 和 Git。如果在使用时遇到有关“找不到 Python 或 Git”的错误信息请使用第一种方法。
2. 或者,可以运行 ``cmd.exe``,并切换至希望使用的 ESP-IDF 目录,然后运行 ``export.bat``。注意,这种方法要求 ``PATH`` 中存在 Python 和 Git。如果在使用时遇到有关“找不到 Python 或 Git”的错误信息请使用第一种方法。
开始使用 ESP-IDF
========================

View File

@ -1,33 +1,33 @@
现在已经具备了使用 ESP-IDF 的所有条件,接下来将介绍如何开始您的第一个工程。
现在已经具备了使用 ESP-IDF 的所有条件,接下来将介绍如何开始第一个工程。
本指南将帮助您完成使用 ESP-IDF 的第一步。按照本指南,您将使用 {IDF_TARGET_NAME} 创建第一个工程,并构建、烧录和监控设备输出。
本指南将介绍如何初步上手 ESP-IDF包括如何使用 {IDF_TARGET_NAME} 创建第一个工程,并构建、烧录和监控设备输出。
.. note::
如果还未安装 ESP-IDF请参照 :ref:`get-started-step-by-step` 中的步骤,获取使用本指南所需的所有软件。
如果还未安装 ESP-IDF请参照 :ref:`get-started-step-by-step` 中的步骤,获取使用本指南所需的所有软件。
开始创建工程
================
现在,可以准备开发 {IDF_TARGET_NAME} 应用程序了。可以从 ESP-IDF 中 :idf:`examples` 目录下的 :example:`get-started/hello_world` 工程开始。
现在,可以准备开发 {IDF_TARGET_NAME} 应用程序了。可以从 ESP-IDF 中 :idf:`examples` 目录下的 :example:`get-started/hello_world` 工程开始。
.. important::
ESP-IDF 编译系统不支持 ESP-IDF 路径或其工程路径中带有空格。
:example:`get-started/hello_world` 工程复制至本地的 ``~/esp`` 目录下:
:example:`get-started/hello_world` 工程复制至本地的 ``~/esp`` 目录下:
.. code-block:: batch
cd %userprofile%\esp
xcopy /e /i %IDF_PATH%\examples\get-started\hello_world hello_world
.. note:: ESP-IDF 的 :idf:`examples` 目录下有一系列示例工程,可以按照上述方法复制并运行其中的任何示例,也可以直接编译示例,无需进行复制。
.. note:: ESP-IDF 的 :idf:`examples` 目录下有一系列示例工程,可以按照上述方法复制并运行其中的任何示例,也可以直接编译示例,无需进行复制。
连接设备
==============
现在,请将您的 {IDF_TARGET_NAME} 开发板连接到 PC并查看开发板使用的串口。
现在,请将 {IDF_TARGET_NAME} 开发板连接到 PC并查看开发板使用的串口。
在 Windows 操作系统中,串口名称通常以 ``COM`` 开头。
@ -35,7 +35,7 @@
.. note::
请记住串口名,您会在后续步骤中使用。
请记住串口名,以便后续使用。
配置工程
=============
@ -51,7 +51,7 @@ Windows
idf.py set-target {IDF_TARGET_PATH_NAME}
idf.py menuconfig
打开一个新工程后,应首先使用 ``idf.py set-target {IDF_TARGET_PATH_NAME}`` 设置“目标”芯片。注意,此操作将清除并初始化项目之前的编译和配置(如有)。也可以直接将“目标”配置为环境变量(此时可跳过该步骤)。更多信息,请见 :ref:`selecting-idf-target`
打开一个新工程后,应首先使用 ``idf.py set-target {IDF_TARGET_PATH_NAME}`` 设置“目标”芯片。注意,此操作将清除并初始化项目之前的编译和配置(如有)。也可以直接将“目标”配置为环境变量(此时可跳过该步骤)。更多信息,请见 :ref:`selecting-idf-target`
正确操作上述步骤后,系统将显示以下菜单:
@ -61,21 +61,21 @@ Windows
工程配置 — 主窗口
可以通过此菜单设置项目的具体变量,包括 Wi-Fi 网络名称、密码和处理器速度等。``hello_world`` 示例项目会以默认配置运行,因此在这一项目中,可以跳过使用 ``menuconfig`` 进行项目配置这一步骤。
可以通过此菜单设置项目的具体变量,包括 Wi-Fi 网络名称、密码和处理器速度等。``hello_world`` 示例项目会以默认配置运行,因此在这一项目中,可以跳过使用 ``menuconfig`` 进行项目配置这一步骤。
.. only:: esp32
.. attention::
如果使用的是 ESP32-DevKitC板载 ESP32-SOLO-1 模组)或 ESP32-DevKitM-1板载 ESP32-MINI-1(1U) 模组),请在烧写示例程序前,前往 ``menuconfig`` 中使能单核模式(:ref:`CONFIG_FREERTOS_UNICORE`)。
如果使用的是 ESP32-DevKitC板载 ESP32-SOLO-1 模组)或 ESP32-DevKitM-1板载 ESP32-MINI-1(1U) 模组),请在烧写示例程序前,前往 ``menuconfig`` 中使能单核模式(:ref:`CONFIG_FREERTOS_UNICORE`)。
.. note::
终端窗口中显示出的菜单颜色可能会与上图不同。可以通过选项 ``--style`` 来改变外观。请运行 ``idf.py menuconfig --help`` 命令,获取更多信息。
终端窗口中显示出的菜单颜色可能会与上图不同。可以通过选项 ``--style`` 来改变外观。请运行 ``idf.py menuconfig --help`` 命令,获取更多信息。
.. only:: esp32 or esp32s2 or esp32s3
如果使用的是支持的开发板,可以通过板级支持包 (BSP) 来协助您的开发。更多信息,请见 `其他提示 <#additional-tips>`__
如果使用的是支持的开发板,可以通过板级支持包 (BSP) 来协助开发。更多信息,请见 `其他提示 <#additional-tips>`__
.. only:: esp32s2