Merge branch 'feature/explain_hello_world_files' into 'master'

docs: Add explanation of hello_world folder contents

Closes DOC-456

See merge request espressif/esp-idf!10319
This commit is contained in:
Krzysztof Budzynski 2020-09-10 22:29:27 +08:00
commit 0640181b46
3 changed files with 61 additions and 15 deletions

View File

@ -50,17 +50,16 @@ Hardware:
Software:
You have a choice to either download and install the following software manually
.. note::
* **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**
If you are using our official `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin>`_ or `VSCode Extension <https://github.com/espressif/vscode-esp-idf-extension>`_ then you can skip downloading esp-idf and toolchain manually and instead follow onboarding process from the IDEs itself, `Eclipse Plugin Installing IDF Plugin <https://github.com/espressif/idf-eclipse-plugin#installing-idf-plugin-using-update-site-url>`_ or `VSCode Extension Onboarding <https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/ONBOARDING.md>`_
* **IDE** of your choice to write programs in C, we have official support for `Eclipse Plugin <https://github.com/espressif/idf-eclipse-plugin>`_ and :doc:`VSCode Extension <vscode-setup>`
* **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**
**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 +277,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 +405,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 +413,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 +536,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/VSCode IDE instead of running ``idf.py``, check out the :doc:`Eclipse guide <eclipse-setup>`, :doc:`VSCode guide <vscode-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:

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``

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.