Merge branch 'feature/explain_hello_world_files_v4.2' into 'release/v4.2'

docs: Add explanation of hello_world folder contents (v4.2)

See merge request espressif/esp-idf!10775
This commit is contained in:
Krzysztof Budzynski
2020-10-27 12:39:13 +08:00
5 changed files with 100 additions and 11 deletions

View File

@ -50,11 +50,16 @@ Hardware:
Software:
You have a choice to either download and install the following software manually
* **Toolchain** to compile code for {IDF_TARGET_NAME}
* **Build tools** - CMake and Ninja to build a full **Application** for {IDF_TARGET_NAME}
* **ESP-IDF** that essentially contains API (software libraries and source code) for {IDF_TARGET_NAME} and scripts to operate the **Toolchain**
* **Text editor** to write programs (**Projects**) in C, e.g., `Eclipse <https://www.eclipse.org/>`_
**or** get through the onboarding process using the following official plugins for integrated development environments (IDE) described in separate documents
* `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>`_)
* `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>`_)
.. figure:: ../../_static/what-you-need.png
:align: center
@ -278,7 +283,7 @@ Step 5. 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 IDF.
Copy :example:`get-started/hello_world` to ``~/esp`` directory:
Copy the project :example:`get-started/hello_world` to ``~/esp`` directory:
Linux and macOS
~~~~~~~~~~~~~~~
@ -406,7 +411,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 file.
If there are no errors, the build will finish by generating the firmware binary .bin files.
.. _get-started-flash:
@ -414,7 +419,7 @@ If there are no errors, the build will finish by generating the firmware binary
Step 9. Flash onto the Device
=============================
Flash the binaries that you just built onto your {IDF_TARGET_NAME} board by running:
Flash the binaries that you just built (bootloader.bin, partition-table.bin and hello-world.bin) onto your {IDF_TARGET_NAME} board by running:
.. code-block:: bash
@ -537,7 +542,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 IDE instead of running ``idf.py``, check out the :doc:`Eclipse guide <eclipse-setup>`.
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>`.
.. _get-started-build-monitor:
@ -631,6 +636,7 @@ Related Documents
establish-serial-connection
eclipse-setup
vscode-setup
../api-guides/tools/idf-monitor
toolchain-setup-scratch
:esp32: ../get-started-legacy/index

View File

@ -0,0 +1,34 @@
********************************
Getting Started with VS Code IDE
********************************
We have official support for VS Code and we aim to provide complete end to end support for all actions related to ESP-IDF namely build, flash, monitor, debug, tracing, core-dump, System Trace Viewer, etc.
Quick Install Guide
===================
Recommended way to install ESP-IDF Visual Studio Code Extension is by downloading it from `VS Code Marketplace <https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension>`_ or following `Quick Installation Guide <https://github.com/espressif/vscode-esp-idf-extension/#quick-installation-guide>`_.
Supported Features
==================
* **Onboarding**, will help you to quickly install ESP-IDF and its relevant toolchain with just few clicks.
* **Build**, with one click build and multi target build, you can easily build and deploy your applications.
* **Flash**, with both UART and JTAG flash out of the box.
* **Monitoring** comes with inbuilt terminal where you can trigger IDF Monitor Commands from within VS Code as you are used to in traditional terminals.
* **Debugging**, with out of box hardware debugging and also support for postmortem debugging like core-dump, you can analyze the bugs with convenience.
* **GUI Menu Config**, provides with simplified UI for configuring your chip.
* **App & Heap Tracing**, provides support for collecting traces from your application and simplified UI for analyzing them.
* **System View Tracing Viewer**, aims to read and display the *.svdat* files into trace UI, we also support multiple core tracing views.
* **IDF Size Analysis Overview** presents an UI for binary size analysis.
* **`Rainmaker Cloud <https://rainmaker.espressif.com/>`_**, we have inbuilt Rainmaker Cloud support where you can edit/read state of your connected IoT devices easily.
* **Code Coverage**, we have inbuilt code coverage support which shall highlight in color which line have been covered. We also render the existing HTML report directly inside the IDE.
Bugs & Feature Requests
=======================
If you face an issue with certain feature of VS Code or VS Code in general we recommend to ask your question in the `forum <http://esp32.com/viewforum.php?f=40>`_, or open a `github issue <https://github.com/espressif/vscode-esp-idf-extension/issues/new/choose>`_ for our dev teams to review.
We also welcome new feature request, most of the features we have today is result of people asking it to implement, or improve certain aspect of the extension, `raise your feature request on github <http://github.com/espressif/vscode-esp-idf-extension/issues/new/choose>`_.

View File

@ -395,7 +395,7 @@ Windows 操作系统
第九步:烧录到设备
=============================
请使用以下命令,将刚刚生成的二进制文件烧录至您的 {IDF_TARGET_NAME} 开发板:
请使用以下命令,将刚刚生成的二进制文件烧录 (bootloader.bin, partition-table.bin 和 hello-world.bin) 至您的 {IDF_TARGET_NAME} 开发板:
``idf.py -p PORT [-b BAUD] flash``
@ -531,6 +531,7 @@ Windows 操作系统
establish-serial-connection
eclipse-setup
vscode-setup
../api-guides/tools/idf-monitor
toolchain-setup-scratch
:esp32: ../get-started-legacy/index

View File

@ -0,0 +1 @@
.. include:: ../../en/get-started/vscode-setup.rst

View File

@ -1,5 +1,52 @@
# Hello World Example
Starts a FreeRTOS task to print "Hello World"
Starts a FreeRTOS task to print "Hello World".
See the README.md file in the upper level 'examples' directory for more information about examples.
(See the README.md file in the upper level 'examples' directory for more information about examples.)
## How to use example
Follow detailed instructions provided specifically for this example.
Select the instructions depending on Espressif chip installed on your development board:
- [ESP32 Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/stable/get-started/index.html)
- [ESP32-S2 Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html)
## Example folder contents
The project **hello_world** contains one source file in C language [hello_world_main.c](main/hello_world_main.c). The file is located in folder [main](main).
ESP-IDF projects are build using CMake. The project build configuration is contained in `CMakeLists.txt` files that provide set of directives and instructions describing the project's source files and targets (executable, library, or both).
Below is short explanation of remaining files in the project folder.
```
├── CMakeLists.txt
├── example_test.py Python script used for automated example testing
├── main
│   ├── CMakeLists.txt
│   ├── component.mk Component make file
│   └── hello_world_main.c
├── Makefile Makefile used by legacy GNU Make
└── README.md This is the file you are currently reading
```
For more information on structure and contents of ESP-IDF projects, please refer to Section [Build System](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html) of the ESP-IDF Programming Guide.
## Troubleshooting
* Program upload failure
* Hardware connection is not correct: run `idf.py -p PORT monitor`, and reboot your board to see if there are any output logs.
* The baud rate for downloading is too high: lower your baud rate in the `menuconfig` menu, and try again.
## Technical support and feedback
Please use the following feedback channels:
* For technical queries, go to the [esp32.com](https://esp32.com/) forum
* For a feature request or bug report, create a [GitHub issue](https://github.com/espressif/esp-idf/issues)
We will get back to you as soon as possible.