From e6d7c3be0efb67c19755e1c6a88d0211ef0adadd Mon Sep 17 00:00:00 2001 From: Tomas Pilny Date: Mon, 29 Aug 2022 10:22:20 +0200 Subject: [PATCH 1/4] Initial commit with guide on building libs wirh higher debug level --- docs/source/guides/core_debug.rst | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 docs/source/guides/core_debug.rst diff --git a/docs/source/guides/core_debug.rst b/docs/source/guides/core_debug.rst new file mode 100644 index 00000000000..ecf6f1c75a4 --- /dev/null +++ b/docs/source/guides/core_debug.rst @@ -0,0 +1,42 @@ +################################## +Compile Arduino libs with ESP_LOGx +################################## + +There 2 basic aproaches. Both of them involve editting file ``configs/defconfig.common``. +Edit the file directly and then build. +Later you can ``git restore configs/defconfig.common`` to go back. +Copy the file ``cp configs/defconfig.common configs/defconfig.debug`` and edit the debug version. + +``vim configs/defconfig.common`` or ``vim configs/defconfig.debug`` + +Edit **line 44** containing by default ``CONFIG_LOG_DEFAULT_LEVEL_ERROR=y`` to one of the following lines depending on your desired log level: + +.. code-block:: bash + + CONFIG_LOG_DEFAULT_LEVEL_NONE=y # No output + CONFIG_LOG_DEFAULT_LEVEL_ERROR=y # Errors - default + CONFIG_LOG_DEFAULT_LEVEL_WARN=y # Warnings + CONFIG_LOG_DEFAULT_LEVEL_INFO=y # Info + CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y # Debug + CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y # Verbose + +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. + + +.. note:: + If you have copied the ``defconfig`` file and the debug settings are in file ``configs/defconfig.debug`` add flag ``debug`` to compilation command. + Example : ``./build.sh debug`` + + - **Option 1**: Build for all SoCs: ``./build.sh`` + - **Option 2**: Build for one SoC: ``./build.sh -t ``. The exact text to choose the SoC: + + - ``esp32`` + - ``esp32s2`` + - ``esp32c3`` + - ``esp32s3`` + - Example: ``./build.sh -t esp32`` + - A wrong format or non-existing SoC will result in the error sed: can't read sdkconfig: No such file or directory + - **Option 3**: Build for multiple SoCs (not all) - simply write them down separated with space: ``./build.sh -t `` + + - Example: ``./build.sh -t esp32 esp32-c3`` + From 844d2c148f061a759091a4ed2055570260ad7aca Mon Sep 17 00:00:00 2001 From: Tomas Pilny Date: Mon, 29 Aug 2022 10:34:50 +0200 Subject: [PATCH 2/4] Added reference to FAQ --- docs/source/faq.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index e6872912424..97520b35673 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -11,3 +11,7 @@ To use the arduino-esp32 core with a modified sdkconfig option, you need to use 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. +How to compile libs with different debug level? +----------------------------------------------- + +The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here From 836d0a29ad0c4b0d1876eb67d94d256077041e5d Mon Sep 17 00:00:00 2001 From: Tomas Pilny Date: Fri, 2 Sep 2022 09:11:51 +0200 Subject: [PATCH 3/4] Reword portion of core_debug.rst --- docs/source/guides/core_debug.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/guides/core_debug.rst b/docs/source/guides/core_debug.rst index ecf6f1c75a4..2ff90742cad 100644 --- a/docs/source/guides/core_debug.rst +++ b/docs/source/guides/core_debug.rst @@ -2,7 +2,7 @@ Compile Arduino libs with ESP_LOGx ################################## -There 2 basic aproaches. Both of them involve editting file ``configs/defconfig.common``. +There are 2 primary approaches and both of them involve editing file ``configs/defconfig.common``. Edit the file directly and then build. Later you can ``git restore configs/defconfig.common`` to go back. Copy the file ``cp configs/defconfig.common configs/defconfig.debug`` and edit the debug version. From cb3ac630c294eabddf9adea84ba5a4ecfe2c02c7 Mon Sep 17 00:00:00 2001 From: Tomas Pilny Date: Wed, 14 Sep 2022 10:41:44 +0200 Subject: [PATCH 4/4] Removed extra empty line --- docs/source/guides/core_debug.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/guides/core_debug.rst b/docs/source/guides/core_debug.rst index 2ff90742cad..abd3f0f9de5 100644 --- a/docs/source/guides/core_debug.rst +++ b/docs/source/guides/core_debug.rst @@ -22,7 +22,6 @@ Edit **line 44** containing by default ``CONFIG_LOG_DEFAULT_LEVEL_ERROR=y`` to o 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. - .. note:: If you have copied the ``defconfig`` file and the debug settings are in file ``configs/defconfig.debug`` add flag ``debug`` to compilation command. Example : ``./build.sh debug``