fix(logging): Add wrapper when using wifi without esp_diagnostics#12188
fix(logging): Add wrapper when using wifi without esp_diagnostics#12188me-no-dev merged 2 commits intoespressif:masterfrom
Conversation
👋 Hello lucasssvaz, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 90 files 90 suites 28m 4s ⏱️ Results for commit 1bdd29f. ♻️ This comment has been updated with latest results. |
9a5c048 to
014d68d
Compare
014d68d to
a65a64a
Compare
There was a problem hiding this comment.
@lucasssvaz - I think that it would be good to add DIAG_USE_EXTERNAL_LOG_WRAP to the KConfig file (https://github.com/espressif/arduino-esp32/blob/master/Kconfig.projbuild).
Not sure which would be the best default value for it.
Please evalutate it.
In case its default value is y, you may just remove it from sdkconfig.defaults file
|
It comes from |
There was a problem hiding this comment.
Pull request overview
This PR adds logging wrapper functions to support WiFi libraries when the esp_diagnostics component is not enabled. Previously, examples relied on CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP to enable diagnostics wrappers, but this PR provides a simpler pass-through wrapper implementation within arduino-esp32 itself.
Key changes:
- Added
esp32-hal-log-wrapper.cwith pass-through wrapper implementations foresp_log_writeandesp_log_writev - Updated build system to conditionally compile and link the wrappers when
CONFIG_DIAG_USE_EXTERNAL_LOG_WRAPis not set - Removed
CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP=yfrom example sdkconfig files, allowing automatic wrapper provisioning
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cores/esp32/esp32-hal-log-wrapper.c | New file providing pass-through wrapper implementations for ESP-IDF logging functions when esp_diagnostics is not enabled |
| CMakeLists.txt | Added the wrapper source file to build and conditionally added linker flags to wrap logging functions |
| idf_component_examples/hw_cdc_hello_world/sdkconfig.defaults | Removed explicit CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP setting, allowing automatic wrapper provisioning |
| idf_component_examples/hello_world/sdkconfig.defaults | Removed explicit CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP setting, allowing automatic wrapper provisioning |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description of Change
This pull request adds support for wrapper functions around ESP-IDF logging APIs to ensure compatibility with WiFi libraries, even when the
esp_diagnosticscomponent is not enabled. The changes introduce a new source file with wrapper implementations and update the build system to include and link these wrappers only when necessary.Build system updates:
cores/esp32/esp32-hal-log-wrapper.cto the build sources so it is compiled as part of the project.CMakeLists.txtto wrapesp_log_writeandesp_log_writevonly whenCONFIG_DIAG_USE_EXTERNAL_LOG_WRAPis not enabled, ensuring the correct wrapper functions are linked.New wrapper implementation:
cores/esp32/esp32-hal-log-wrapper.c, which provides simple pass-through wrappers foresp_log_writeandesp_log_writevwhen the external diagnostics wrapper is not present. This prevents linker errors when WiFi libraries expect these symbols.Test Scenarios
Tested locally