pkg/esp32_sdk: Fix broken rtc_io.h declaration and prevent sys/uio.h inclusion outside RIOT#21408
pkg/esp32_sdk: Fix broken rtc_io.h declaration and prevent sys/uio.h inclusion outside RIOT#21408benpicco merged 2 commits intoRIOT-OS:masterfrom
rtc_io.h declaration and prevent sys/uio.h inclusion outside RIOT#21408Conversation
…d_en_all The implementation of `rtc_gpio_force_hold_all()` was renamed to`rtc_gpio_force_hold_en_all()` in the patch `0022-driver-gpio-fix-undefined-reference-to-rtc_gpio_forc.patch`. This patch corrects the function declaration to match the renamed implementation. Signed-off-by: Jongmin Kim <[email protected]>
The RIOT header `<sys/uio.h>` is not available when using the bundled ESP-IDF outside of RIOT. This patch ensures that `<sys/uio.h>` is only included when `RIOT_VERSION` is defined. Signed-off-by: Jongmin Kim <[email protected]>
rtc_io.h declaration and prevent sys/uio.h inclusion outside RIOT
pkg/esp32_sdk: Fix broken rtc_io.h declaration and prevent sys/uio.h
inclusion outside RIOT
Forwarded: RIOT-OS/RIOT#21408
Signed-off-by: Jongmin Kim <[email protected]>
|
Although I don't see a reasonable use case for using the patched IDF from the RIOT build tree instead of the original IDF for applications that don't use RIOT at all, I would be fine adding these patches if they don't affect RIOT compilation at all. However, this will make the migration to ESP-IDF v5.4 (PR #21261) more difficult, since all the existing patches are removed for the migration and numerous new patches will be added that are completely independent of the previous patches. So this PR would produce conflicts when rebasing PR #21261. Therefore, I am not sure whether we should really include the patches for the old IDF at this time. |
pkg/esp32_sdk: Fix broken rtc_io.h declaration and prevent sys/uio.h
inclusion outside RIOT
Forwarded: RIOT-OS/RIOT#21408
Signed-off-by: Jongmin Kim <[email protected]>
|
This is required when we need to use ESP-IDF functions directly from RIOT OS app — for example, including specific headers and their implementations from ESP-IDF directly. For my employer's need, I have documented how to set the build environment. Currently, without these patches, the build fails: RIOT/build/pkg/esp32_sdk/components/driver/gpio.c: In function 'gpio_force_hold_all':
RIOT/build/pkg/esp32_sdk/components/driver/gpio.c:696:5: error: implicit declaration of function 'rtc_gpio_force_hold_en_all'; did you mean 'rtc_gpio_force_hold_dis_all'? [-Werror=implicit-function-declaration]
rtc_gpio_force_hold_en_all();
^~~~~~~~~~~~~~~~~~~~~~~~~~
rtc_gpio_force_hold_dis_all
cc1: some warnings being treated as errorsIn file included from RIOT/build/pkg/esp32_sdk/components/asio/asio/asio/include/asio/detail/socket_types.hpp:78,
from RIOT/build/pkg/esp32_sdk/components/asio/asio/asio/include/asio/impl/error_code.ipp:29,
from RIOT/build/pkg/esp32_sdk/components/asio/asio/asio/include/asio/impl/src.hpp:23,
from RIOT/build/pkg/esp32_sdk/components/asio/asio/asio/src/asio.cpp:11:
RIOT/build/pkg/esp32_sdk/components/newlib/platform_include/sys/uio.h:9:15: fatal error: sys/uio.h: No such file or directory
#include_next <sys/uio.h>
^~~~~~~~~~~With these patches, all builds complete successfully without any issues. I just noticed that your ESP-IDF 5.4 transition is ongoing #21261, so this PR may complicate your transition work, as you mentioned. I can't make the call myself, so I'll leave the decision up to you, @gschorcht. o/ |
|
Ok, let's merge the PR. It doesn't affect the compilation of RIOT applications, but allows the use of IDF functions if this is required in special use cases. Immediately after that I will rebase PR #21261 and check if these patches are still necessary. |
Pull-Request: pkg/esp32_sdk: Fix broken rtc_io.h declaration and prevent sys/uio.h
inclusion outside RIOT.
RIOT-OS/RIOT#21408
Commit: RIOT-OS/RIOT@876bfa2
Commit: RIOT-OS/RIOT@a1cd48a
Signed-off-by: Jongmin Kim <[email protected]>
Pull-Request: pkg/esp32_sdk: Fix broken rtc_io.h declaration and prevent sys/uio.h
inclusion outside RIOT.
RIOT-OS/RIOT#21408
Commit: RIOT-OS/RIOT@876bfa2
Commit: RIOT-OS/RIOT@a1cd48a
Signed-off-by: Jongmin Kim <[email protected]>
Contribution description
This PR includes two
esp32_sdkpatches to ensure that the RIOT-bundled ESP-IDF remains compatible when used independently of the RIOT environment.These changes are minimal and isolated, and they make the RIOT-patched ESP-IDF usable when ESP-IDF is used directly.
1. [driver/rtc_io] Fixes an incorrect function declaration in ESP-IDF
components/driver/include/driver/rtc_io.h.The implementation was renamed in 0022-driver-gpio-fix-undefined-reference-to-rtc_gpio_forc.patch as follows:
rtc_gpio_force_hold_all()rtc_gpio_force_hold_en_all()However, the declaration in the header file was not updated accordingly.
This patch corrects the function declaration to match the renamed implementation.
2. [newlib] Prevents inclusion of
<sys/uio.h>when RIOT is not used.RIOT's
sys/libc/include/sys/uio.hheader attempts to override the system header, which causes build errors when the bundled ESP-IDF is used independently.This patch wraps the include with
#ifdef RIOT_VERSION, so<sys/uio.h>is only included when building with RIOT.Testing procedure
Set
RIOTBASE,IDF_PATH, andPATH:Download the RIOT bundled ESP-IDF:
esp-idf.Makefile:
Run the esp-idf.Makefile:
Ensure that all the patches are applied. You should see output similar to:
Build a standalone ESP-IDF example project:
Without these patches:
rtc_gpio_force_hold_all()being undefined.<sys/uio.h>not being found.With these patches applied:
Issues/PRs references
None