-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[Docs] Added/Updated Lib builder docs #6401
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,37 +2,173 @@ | |
Library Builder | ||
############### | ||
|
||
How to Use Library Builder | ||
-------------------------- | ||
About | ||
----- | ||
|
||
Espressif has provided a `tool <https://github.com/espressif/esp32-arduino-lib-builder>`_ to simplify building your own compiled libraries for use in Arduino IDE (or your favorite IDE). | ||
To generate custom libraries, follow these steps: | ||
Espressif provides a `tool <https://github.com/espressif/esp32-arduino-lib-builder>`_ to simplify building your own compiled libraries for use in Arduino IDE (or your favorite IDE). | ||
|
||
This tool can be used to change the project or a specific configuration according to your needs. | ||
|
||
- Step 1 - Clone the ESP32 Arduino lib builder:: | ||
Installing | ||
---------- | ||
|
||
To install the Library Builder into your environment, please, follow the instructions below. | ||
|
||
- Clone the ESP32 Arduino lib builder: | ||
|
||
.. code-block:: bash | ||
|
||
git clone https://github.com/espressif/esp32-arduino-lib-builder | ||
|
||
- Step 2 - Go to the ``esp32-arduino-lib-builder`` folder:: | ||
- Go to the ``esp32-arduino-lib-builder`` folder: | ||
|
||
.. code-block:: bash | ||
|
||
cd esp32-arduino-lib-builder | ||
|
||
- Step 3 - Run the ``update-components`` script:: | ||
- Build: | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh | ||
|
||
If everyting works, you may see the following message: ``Successfully created esp32 image.`` | ||
|
||
Dependencies | ||
************ | ||
|
||
To build the libraries you will need to install some dependencies. Maybe you already have installed, but it is a good idea to check before building. | ||
|
||
- Install all dependencies (**Ubuntu**): | ||
|
||
.. code-block:: bash | ||
|
||
sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf cmake ninja-build ccache jq | ||
|
||
- Install Python and upgrade pip: | ||
|
||
.. code-block:: bash | ||
|
||
sudo apt-get install python3 | ||
sudo pip install --upgrade pip | ||
|
||
- Install all required packages: | ||
|
||
.. code-block:: bash | ||
|
||
pip install --user setuptools pyserial click cryptography future pyparsing pyelftools | ||
|
||
Building | ||
-------- | ||
|
||
If you have all the dependencies met, it is time to build the libraries. | ||
|
||
To build using the default configuration: | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh | ||
|
||
Custom Build | ||
************ | ||
|
||
There are some options to help you creating the custom libraries. You can use the following options: | ||
|
||
Usage | ||
^^^^^ | ||
|
||
.. code-block:: bash | ||
|
||
build.sh [-s] [-A arduino_branch] [-I idf_branch] [-i idf_commit] [-c path] [-t <target>] [-b <build|menuconfig|idf_libs|copy_bootloader|mem_variant>] [config ...] | ||
|
||
Skip Install/Update | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
Skip installing/updating of ESP-IDF and all components | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -s | ||
|
||
This option can be used if you already have the ESP-IDF and all components already in your environment. | ||
|
||
Set Arduino-ESP32 Branch | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Set which branch of arduino-esp32 to be used for compilation | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -A <arduino_branch> | ||
|
||
Set ESP-IDF Branch | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
Set which branch of ESP-IDF to be used for compilation | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -I <idf_branch> | ||
|
||
Set the ESP-IDF Commit | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Set which commit of ESP-IDF to be used for compilation | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -i <idf_commit> | ||
|
||
Deploy | ||
^^^^^^ | ||
|
||
Deploy the build to github arduino-esp32 | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -d | ||
|
||
Set the Arduino-ESP32 Destination Folder | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Set the arduino-esp32 folder to copy the result to. ex. '$HOME/Arduino/hardware/espressif/esp32' | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -c <path> | ||
|
||
This function is used to copy the compiled libraries to the Arduino folder. | ||
|
||
Set the Target | ||
^^^^^^^^^^^^^^ | ||
|
||
Set the build target(chip). ex. 'esp32s3' | ||
|
||
.. code-block:: bash | ||
|
||
./build.sh -t <target> | ||
|
||
This build command will build for the ESP32-S3 target. You can specify other targets. | ||
|
||
* esp32 | ||
* esp32s2 | ||
* esp32c3 | ||
* esp32s3 | ||
|
||
./tools/update-components.sh` | ||
Set Build Type | ||
^^^^^^^^^^^^^^ | ||
|
||
- Step 4 - Run ``install-esp-idf`` installation script (if you already have an ``$IDF_PATH`` defined, it will use your local copy of the repository):: | ||
Set the build type. ex. 'build' to build the project and prepare for uploading to a board | ||
|
||
./tools/install-esp-idf.sh | ||
.. code-block:: bash | ||
|
||
- Step 5 - Copy the configuration (recommended) or directly edit sdkconfig using ``idf.py menuconfig``:: | ||
./build.sh -b <build|menuconfig|idf_libs|copy_bootloader|mem_variant> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
cp sdkconfig.esp32s2 sdkconfig | ||
Additional Configuration | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
- Step 6 - Build:: | ||
Specify additional configs to be applied. ex. 'qio 80m' to compile for QIO Flash@80MHz. Requires -b | ||
|
||
idf.py build | ||
.. code-block:: bash | ||
|
||
The script automates the process of building `Arduino as an ESP-IDF component <https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md>`_. | ||
Once it is complete, you can cherry pick the needed libraries from ``out/tools/sdk/lib``, or run ``tools/copy-to-arduino.sh`` to copy the entire built system. | ||
``tools/config.sh`` contains a number of variables that control the process, particularly the ``$IDF_BRANCH`` variable. You can adjust this to try building against newer versions, but there are absolutely no guarantees that any components will work or even successfully compile against a newer IDF. | ||
pedrominatel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
./build.sh -b | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends on
-t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL