Skip to content

Commit b58e7ab

Browse files
Doc addition: How to compile libs with different debug level (espressif#7193)
* Initial commit with guide on building libs wirh higher debug level * Added reference to FAQ * Reword portion of core_debug.rst * Removed extra empty line Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com>
1 parent 9025c68 commit b58e7ab

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docs/source/faq.rst

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ To use the arduino-esp32 core with a modified sdkconfig option, you need to use
1111

1212
Note that modifying ``sdkconfig`` or ``sdkconfig.h`` files found in the arduino-esp32 project tree **does not** result in changes to these options. This is because ESP-IDF libraries are included into the arduino-esp32 project tree as pre-built libraries.
1313

14+
How to compile libs with different debug level?
15+
-----------------------------------------------
16+
17+
The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here <guides/core_debug>

docs/source/guides/core_debug.rst

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
##################################
2+
Compile Arduino libs with ESP_LOGx
3+
##################################
4+
5+
There are 2 primary approaches and both of them involve editing file ``configs/defconfig.common``.
6+
Edit the file directly and then build.
7+
Later you can ``git restore configs/defconfig.common`` to go back.
8+
Copy the file ``cp configs/defconfig.common configs/defconfig.debug`` and edit the debug version.
9+
10+
``vim configs/defconfig.common`` or ``vim configs/defconfig.debug``
11+
12+
Edit **line 44** containing by default ``CONFIG_LOG_DEFAULT_LEVEL_ERROR=y`` to one of the following lines depending on your desired log level:
13+
14+
.. code-block:: bash
15+
16+
CONFIG_LOG_DEFAULT_LEVEL_NONE=y # No output
17+
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y # Errors - default
18+
CONFIG_LOG_DEFAULT_LEVEL_WARN=y # Warnings
19+
CONFIG_LOG_DEFAULT_LEVEL_INFO=y # Info
20+
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y # Debug
21+
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y # Verbose
22+
23+
Then simply build the libs for all SoCs or one specific SoC. Note that building for all SoCs takes a lot of time, so if you are working only with specific SoC(s), build only for those.
24+
25+
.. note::
26+
If you have copied the ``defconfig`` file and the debug settings are in file ``configs/defconfig.debug`` add flag ``debug`` to compilation command.
27+
Example : ``./build.sh debug``
28+
29+
- **Option 1**: Build for all SoCs: ``./build.sh``
30+
- **Option 2**: Build for one SoC: ``./build.sh -t <soc>``. The exact text to choose the SoC:
31+
32+
- ``esp32``
33+
- ``esp32s2``
34+
- ``esp32c3``
35+
- ``esp32s3``
36+
- Example: ``./build.sh -t esp32``
37+
- A wrong format or non-existing SoC will result in the error sed: can't read sdkconfig: No such file or directory
38+
- **Option 3**: Build for multiple SoCs (not all) - simply write them down separated with space: ``./build.sh -t <soc1> <soc2> <soc3>``
39+
40+
- Example: ``./build.sh -t esp32 esp32-c3``
41+

0 commit comments

Comments
 (0)