Skip to content

Update doc: Arduino as IDF component; fixes #5833 #6299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Deleted mention about HAL locks from doc
  • Loading branch information
PilnyTomas committed Feb 16, 2022
commit a92758b8ef433516d6ae47731af9cf470c1d9626
26 changes: 9 additions & 17 deletions docs/source/esp-idf_component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ESP32 Arduino lib-builder

For a simplified method, see `Installing using Boards Manager <https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-boards-manager>`_.

To build your own Arduino core see `Arduino lib builder <https://github.com/espressif/esp32-arduino-lib-builder>`_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not build the Arduino core. It builds ESP-IDF and collects all necessary headers, libraries and bootloaders. Basically everything inside tools/sdk.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used when you need to have some specific ESP-IDF option that differs from what is already compiled in Arduino.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should the line be?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arduino Lib Builder is the tool that integrates ESP-IDF into Arduino. It allows you to customize the default settings used by Espressif and try them in Arduino IDE.



Installation
------------
Expand All @@ -33,6 +35,13 @@ Configuration
-------------

Depending on one the two following options, in the menuconfig set the appropriate settings.
Go to section ``Arduino Configuration --->``

1. For usage of ``app_main()`` function - Turn off ``Autostart Arduino setup and loop on boot``
2. For usage of ``setup()`` and ``loop()`` functions - Turn on ``Autostart Arduino setup and loop on boot``

Experienced users can explore other options in the Arduino section.

After the setup you can save and exit:

- Save [S]
Expand All @@ -46,12 +55,6 @@ After the setup you can save and exit:
Option 1. Using Arduino setup() and loop()
******************************************

While in the menuconfig go to `Arduino Configuration --->`

- Turn on ``Autostart Arduino setup and loop on boot``
- Turn off ``Disable mutex locks for HAL``
- Save and exit

- In main folder rename file `main.c` to `main.cpp`.

- In main folder open file `CMakeList.txt` and change `main.c` to `main.cpp` as described below.
Expand All @@ -75,12 +78,6 @@ While in the menuconfig go to `Arduino Configuration --->`
Option 2. Using ESP-IDF appmain()
*********************************

While in the menuconfig go to `Arduino Configuration --->`

- Turn off ``Autostart Arduino setup and loop on boot``
- Turn on ``Disable mutex locks for HAL``
- Save and exit

In main.c or main cpp you need to implement ``app_main()`` and call ``initArduino();`` in it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing . (period) between main and cpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching this. I will commit fix later if there is nothing else to be fixed.


Keep in mind that setup() and loop() will not be called in this case.
Expand All @@ -107,11 +104,6 @@ Furthermore the ``app_main()`` is single execution as normal function so if you
// WARNING: if program reaches end of function app_main() the MCU will restart.
}

- "Disable mutex locks for HAL"

- If enabled, there will be no protection on the drivers from concurently accessing them from another thread/interrupt/core


Build, flash and monitor
************************

Expand Down