Merge branch 'doc/eclipse_setup_v3.1' into 'release/v3.1'
doc: eclipse setup (v3.1 backport) See merge request idf/esp-idf!2679
This commit is contained in:
commit
3e5053b778
4 changed files with 37 additions and 16 deletions
|
@ -43,7 +43,7 @@ Project Properties
|
||||||
|
|
||||||
* Click on the "C/C++ Build" properties page (top-level):
|
* Click on the "C/C++ Build" properties page (top-level):
|
||||||
|
|
||||||
* Uncheck "Use default build command" and enter this for the custom build command: ``python ${IDF_PATH}/tools/windows/eclipse_make.py``.
|
* Uncheck "Use default build command" and enter this for the custom build command: ``python ${IDF_PATH}/tools/windows/eclipse_make.py``
|
||||||
|
|
||||||
* Click on the "Environment" properties page under "C/C++ Build":
|
* Click on the "Environment" properties page under "C/C++ Build":
|
||||||
|
|
||||||
|
@ -57,12 +57,14 @@ Project Properties
|
||||||
|
|
||||||
* Click the "Providers" tab
|
* Click the "Providers" tab
|
||||||
|
|
||||||
* In the list of providers, click "CDT GCC Built-in Compiler Settings Cygwin". Under "Command to get compiler specs", replace the text ``${COMMAND}`` at the beginning of the line with ``xtensa-esp32-elf-gcc``. This means the full "Command to get compiler specs" should be ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
|
* In the list of providers, click "CDT Cross GCC Built-in Compiler Settings". Change "Command to get compiler specs" to ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
|
||||||
|
|
||||||
* In the list of providers, click "CDT GCC Build Output Parser" and type ``xtensa-esp32-elf-`` at the beginning of the Compiler command pattern, and wrap remaining part with brackets. This means the full Compiler command pattern should be ``xtensa-esp32-elf-((g?cc)|([gc]\+\+)|(clang))``
|
* In the list of providers, click "CDT GCC Build Output Parser" and change the "Compiler command pattern" to ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
|
||||||
|
|
||||||
Navigate to "C/C++ General" -> "Indexer" property page:
|
Navigate to "C/C++ General" -> "Indexer" property page:
|
||||||
|
|
||||||
|
* Check "Enable project specific settings" to enable the rest of the settings on this page.
|
||||||
|
|
||||||
* Uncheck "Allow heuristic resolution of includes". When this option is enabled Eclipse sometimes fails to find correct header directories.
|
* Uncheck "Allow heuristic resolution of includes". When this option is enabled Eclipse sometimes fails to find correct header directories.
|
||||||
|
|
||||||
Building in Eclipse
|
Building in Eclipse
|
||||||
|
|
|
@ -59,12 +59,14 @@ Navigate to "C/C++ General" -> "Preprocessor Include Paths" property page:
|
||||||
|
|
||||||
* Click the "Providers" tab
|
* Click the "Providers" tab
|
||||||
|
|
||||||
* In the list of providers, click "CDT Cross GCC Built-in Compiler Settings". Under "Command to get compiler specs", replace the text ``${COMMAND}`` at the beginning of the line with ``xtensa-esp32-elf-gcc``. This means the full "Command to get compiler specs" should be ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
|
* In the list of providers, click "CDT Cross GCC Built-in Compiler Settings". Change "Command to get compiler specs" to ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
|
||||||
|
|
||||||
* In the list of providers, click "CDT GCC Build Output Parser" and type ``xtensa-esp32-elf-`` at the beginning of the Compiler command pattern. This means the full Compiler command pattern should be ``xtensa-esp32-elf-(g?cc)|([gc]\+\+)|(clang)``
|
* In the list of providers, click "CDT GCC Build Output Parser" and change the "Compiler command pattern" to ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
|
||||||
|
|
||||||
Navigate to "C/C++ General" -> "Indexer" property page:
|
Navigate to "C/C++ General" -> "Indexer" property page:
|
||||||
|
|
||||||
|
* Check "Enable project specific settings" to enable the rest of the settings on this page.
|
||||||
|
|
||||||
* Uncheck "Allow heuristic resolution of includes". When this option is enabled Eclipse sometimes fails to find correct header directories.
|
* Uncheck "Allow heuristic resolution of includes". When this option is enabled Eclipse sometimes fails to find correct header directories.
|
||||||
|
|
||||||
.. _eclipse-build-project:
|
.. _eclipse-build-project:
|
||||||
|
|
|
@ -40,17 +40,17 @@ Windows 平台上的 Eclipse 配置
|
||||||
项目属性
|
项目属性
|
||||||
----------
|
----------
|
||||||
|
|
||||||
* 新项目将出现在 “Project Explorer” 下。请右键选择该项目,并在菜单中选择顶层 “Properties”。
|
* 新项目将出现在 “Project Explorer” 下。请右键选择该项目,并在菜单中选 “Properties”。
|
||||||
|
|
||||||
* 点击 “C/C++ Build” 属性页。
|
* 点击 “C/C++ Build” 属性页。
|
||||||
|
|
||||||
* 取消选中 “Use default build command”,然后输入命令:``python ${IDF_PATH}/tools/windows/eclipse_make.py``,开始自定义创建。
|
* 取消选中 “Use default build command”,然后输入命令开始自定义创建:``python ${IDF_PATH}/tools/windows/eclipse_make.py``
|
||||||
|
|
||||||
* 点击 “C/C++ Build” 下的 “Environment” 属性页面。
|
* 点击 “C/C++ Build” 下的 “Environment” 属性页面。
|
||||||
|
|
||||||
* 选择 “Add...”,并在对应位置输入 ``BATCH_BUILD`` 和 ``1``。
|
* 选择 “Add...”,并在对应位置输入 ``BATCH_BUILD`` 和 ``1``。
|
||||||
|
|
||||||
* 再次点击 “Add...”,输入名称 ``IDF_PATH``,并填写 ESP-IDF 的完整安装路径。``IDF_PATH`` 目录路径应使用正斜杠,而非反斜线,即 ``C:/Users/MyUser/Development/esp-idf``。
|
* 再次点击 “Add...”,输入名称 ``IDF_PATH``,并填写 ESP-IDF 的完整安装路径。``IDF_PATH`` 目录路径应使用正斜杠,而非反斜线,例如 ``C:/Users/MyUser/Development/esp-idf``。
|
||||||
|
|
||||||
* 选择 PATH 环境变量,删除默认值,并将其替换为 ``C:\msys32\usr\bin;C:\msys32\mingw32\bin;C:\msys32\opt\xtensa-esp32-elf\bin`` (如果您已经将 msys32 安装到其他目录,这里请自行调整)。
|
* 选择 PATH 环境变量,删除默认值,并将其替换为 ``C:\msys32\usr\bin;C:\msys32\mingw32\bin;C:\msys32\opt\xtensa-esp32-elf\bin`` (如果您已经将 msys32 安装到其他目录,这里请自行调整)。
|
||||||
|
|
||||||
|
@ -59,10 +59,17 @@ Windows 平台上的 Eclipse 配置
|
||||||
|
|
||||||
* 点击 “Providers” 选项卡。
|
* 点击 “Providers” 选项卡。
|
||||||
|
|
||||||
* 从 “Providers” 列表中选择 “CDT GCC Built-in Compiler Settings Cygwin”。在 “Command to get compiler specs” 输入框中,用 ``xtensa-esp32-elf-gcc`` 替换行首的 ``${COMMAND}``,最终完整的 ``Command to get compiler specs`` 应为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``。
|
* 从 “Providers” 列表中选择 “CDT Cross GCC Built-in Compiler Settings”,将 “Command to get compiler specs” 修改为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``
|
||||||
|
|
||||||
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”,然后在 Compiler 命令模式的起始位置输入 ``xtensa-esp32-elf-``,并用括号把剩余部分扩起来。最终的完整 Compiler 命令模式应为 ``xtensa-esp32-elf-((g?cc)|([gc]\+\+)|(clang))``。
|
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”,将 “Compiler command pattern” 修改为 ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
|
||||||
|
|
||||||
|
点击 “C/C++ General" -> "Indexer” 属性页。
|
||||||
|
|
||||||
|
* 选择 “Enable project specific settings” 以启用本页上的其他设置。
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
取消选中 “Allow heuristic resolution of includes”。因为启用此选项时,有时会导致 Eclipse 无法找到正确的头文件目录。
|
||||||
|
|
||||||
在 Eclipse IDE 中创建项目
|
在 Eclipse IDE 中创建项目
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
|
@ -57,14 +57,24 @@ Windows 用户
|
||||||
|
|
||||||
* 前往 “C/C++ General” -> “Preprocessor Include Paths” 属性页面。
|
* 前往 “C/C++ General” -> “Preprocessor Include Paths” 属性页面。
|
||||||
|
|
||||||
* 点击 “Providers” 选项卡。从 “Providers” 列表中选择 “CDT Cross GCC Built-in Compiler Settings”。在 “Command to get compiler specs” 输入框中,用 ``xtensa-esp32-elf-gcc`` 替换行首的 ``${COMMAND}``,最终的完整 “Command to get compiler specs” 应为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``。
|
* 点击 “Providers” 选项卡。
|
||||||
|
|
||||||
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”,然后在 “Compiler command pattern“ 输入框的起始位置输入 ``xtensa-esp32-elf-``,最终的完整编译器命令应为 ``xtensa-esp32-elf-(g?cc)|([gc]\+\+)|(clang)``。
|
* 从 “Providers” 列表中选择 “CDT Cross GCC Built-in Compiler Settings”,将 “Command to get compiler specs” 修改为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``
|
||||||
|
|
||||||
|
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”,将 “Compiler command pattern” 修改为 ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
|
||||||
|
|
||||||
* 前往 “C/C++ General” -> “Indexer” 属性页面。
|
* 前往 “C/C++ General” -> “Indexer” 属性页面。
|
||||||
|
|
||||||
* 去除 "Allow heuristic resolution of includes" 勾选。启用此选项时,Eclipse 有时无法找到正确的头文件目录。
|
* 去除 "Allow heuristic resolution of includes" 勾选。启用此选项时,Eclipse 有时无法找到正确的头文件目录。
|
||||||
|
|
||||||
|
点击 “C/C++ General" -> "Indexer” 属性页。
|
||||||
|
|
||||||
|
* 选择 “Enable project specific settings” 以启用本页上的其他设置。
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
取消选中 “Allow heuristic resolution of includes”。因为启用此选项时,有时会导致 Eclipse 无法找到正确的头文件目录。
|
||||||
|
|
||||||
.. _eclipse-build-project:
|
.. _eclipse-build-project:
|
||||||
|
|
||||||
在 Eclipse IDE 中创建项目
|
在 Eclipse IDE 中创建项目
|
||||||
|
@ -89,11 +99,11 @@ Windows 用户
|
||||||
|
|
||||||
* 打开 “Project Explorer”,并右击您的项目(请注意右击项目本身,而非项目下的子文件,否则 Eclipse 可能会找到错误的 ``Makefile``)。
|
* 打开 “Project Explorer”,并右击您的项目(请注意右击项目本身,而非项目下的子文件,否则 Eclipse 可能会找到错误的 ``Makefile``)。
|
||||||
|
|
||||||
* 从菜单中选择 “Make Targets” -> “Create”。
|
* 从菜单中选择 “Build Targets” -> “Create”。
|
||||||
|
|
||||||
* 输入 “flash” 为目标名称,其他选项使用默认值。
|
* 输入 “flash” 为目标名称,其他选项使用默认值。
|
||||||
|
|
||||||
* 选择 “Project” -> “Make Target” -> “Build (快捷键:Shift + F9)”,创建自定义烧录目标,用于编译、烧录项目。
|
* 选择 “Project” -> “Build Target” -> “Build (快捷键:Shift + F9)”,创建自定义烧录目标,用于编译、烧录项目。
|
||||||
|
|
||||||
注意,您将需要通过 ``make menuconfig``,设置串行端口和其他烧录选项。``make menuconfig`` 仍需通过命令行操作(请见平台的对应指南)。
|
注意,您将需要通过 ``make menuconfig``,设置串行端口和其他烧录选项。``make menuconfig`` 仍需通过命令行操作(请见平台的对应指南)。
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue