Browse Source

Merge branch 'bugfix/freertos_esp_timer_deps' into 'master'

esp_timer: remove from freertos public requirements

See merge request espressif/esp-idf!17818
Ivan Grokhotkov 3 years ago
parent
commit
3175e472ba
45 changed files with 80 additions and 38 deletions
  1. 1 0
      components/app_trace/CMakeLists.txt
  2. 2 1
      components/driver/test/CMakeLists.txt
  3. 1 0
      components/driver/test/test_ledc.c
  4. 1 0
      components/driver/test/test_sdio.c
  5. 1 1
      components/efuse/test/CMakeLists.txt
  6. 1 0
      components/efuse/test/test_efuse.c
  7. 1 1
      components/esp_event/test/CMakeLists.txt
  8. 1 1
      components/esp_hw_support/CMakeLists.txt
  9. 1 1
      components/esp_hw_support/test/CMakeLists.txt
  10. 1 1
      components/esp_phy/CMakeLists.txt
  11. 1 0
      components/esp_phy/src/phy_init.c
  12. 1 1
      components/esp_pm/CMakeLists.txt
  13. 1 1
      components/esp_pm/test/CMakeLists.txt
  14. 1 0
      components/esp_pm/test/test_pm.c
  15. 1 1
      components/esp_system/CMakeLists.txt
  16. 2 1
      components/esp_system/test/CMakeLists.txt
  17. 1 1
      components/esp_timer/test/CMakeLists.txt
  18. 1 2
      components/esp_wifi/esp32/esp_adapter.c
  19. 1 1
      components/esp_wifi/esp32s2/esp_adapter.c
  20. 6 7
      components/freertos/CMakeLists.txt
  21. 5 1
      components/freertos/FreeRTOS-Kernel-SMP/portable/xtensa/include/freertos/portmacro.h
  22. 5 1
      components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h
  23. 5 1
      components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h
  24. 1 1
      components/freertos/test/CMakeLists.txt
  25. 1 0
      components/freertos/test/integration/tasks/test_task_suspend_resume.c
  26. 1 1
      components/mbedtls/test/CMakeLists.txt
  27. 1 1
      components/newlib/test/CMakeLists.txt
  28. 1 1
      components/pthread/test/CMakeLists.txt
  29. 2 1
      components/spi_flash/test/CMakeLists.txt
  30. 2 1
      components/touch_element/CMakeLists.txt
  31. 0 1
      components/usb/hcd.c
  32. 1 1
      components/vfs/CMakeLists.txt
  33. 1 0
      components/wpa_supplicant/src/common/wpa_supplicant_i.h
  34. 15 3
      docs/en/migration-guides/build-system.rst
  35. 1 0
      examples/bluetooth/esp_ble_mesh/ble_mesh_console/main/ble_mesh_reg_test_perf_client_cmd.c
  36. 1 0
      examples/bluetooth/esp_ble_mesh/ble_mesh_console/main/ble_mesh_register_cmd.c
  37. 1 0
      examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/main/main.c
  38. 1 1
      examples/bluetooth/esp_ble_mesh/common_components/button/CMakeLists.txt
  39. 1 0
      examples/bluetooth/hci/ble_adv_scan_combined/main/app_bt.c
  40. 2 1
      examples/common_components/iperf/CMakeLists.txt
  41. 1 0
      examples/protocols/https_request/main/https_request_example_main.c
  42. 1 0
      examples/system/eventfd/main/eventfd_example.c
  43. 1 0
      examples/system/light_sleep/main/light_sleep_example_main.c
  44. 1 0
      tools/test_apps/system/longjmp_test/main/hello_world_main.c
  45. 1 1
      tools/unit-test-app/components/test_utils/test/CMakeLists.txt

+ 1 - 0
components/app_trace/CMakeLists.txt

@@ -51,6 +51,7 @@ idf_component_register(SRCS "${srcs}"
                        PRIV_INCLUDE_DIRS "${priv_include_dirs}"
                        PRIV_INCLUDE_DIRS "${priv_include_dirs}"
                        # Requires "driver" for GPTimer in "SEGGER_SYSVIEW_Config_FreeRTOS.c"
                        # Requires "driver" for GPTimer in "SEGGER_SYSVIEW_Config_FreeRTOS.c"
                        PRIV_REQUIRES soc driver
                        PRIV_REQUIRES soc driver
+                       REQUIRES esp_timer
                        LDFRAGMENTS linker.lf)
                        LDFRAGMENTS linker.lf)
 
 
 # disable --coverage for this component, as it is used as transport
 # disable --coverage for this component, as it is used as transport

+ 2 - 1
components/driver/test/CMakeLists.txt

@@ -1,3 +1,4 @@
 idf_component_register(SRC_DIRS . param_test touch_sensor_test adc_dma_test dac_dma_test
 idf_component_register(SRC_DIRS . param_test touch_sensor_test adc_dma_test dac_dma_test
                        PRIV_INCLUDE_DIRS include param_test/include touch_sensor_test/include
                        PRIV_INCLUDE_DIRS include param_test/include touch_sensor_test/include
-                       PRIV_REQUIRES cmock test_utils driver nvs_flash esp_serial_slave_link infrared_tools esp_adc_cal)
+                       PRIV_REQUIRES cmock test_utils driver nvs_flash esp_serial_slave_link
+                                     infrared_tools esp_adc_cal esp_timer)

+ 1 - 0
components/driver/test/test_ledc.c

@@ -23,6 +23,7 @@
 #include "soc/gpio_periph.h"
 #include "soc/gpio_periph.h"
 #include "soc/io_mux_reg.h"
 #include "soc/io_mux_reg.h"
 #include "esp_system.h"
 #include "esp_system.h"
+#include "esp_timer.h"
 #include "driver/ledc.h"
 #include "driver/ledc.h"
 #include "hal/ledc_ll.h"
 #include "hal/ledc_ll.h"
 #include "driver/gpio.h"
 #include "driver/gpio.h"

+ 1 - 0
components/driver/test/test_sdio.c

@@ -10,6 +10,7 @@
 #include "test_utils.h"
 #include "test_utils.h"
 #include "param_test.h"
 #include "param_test.h"
 #include "esp_log.h"
 #include "esp_log.h"
+#include "esp_timer.h"
 #include "driver/spi_common.h"
 #include "driver/spi_common.h"
 #include "soc/soc_caps.h"
 #include "soc/soc_caps.h"
 #include "ccomp_timer.h"
 #include "ccomp_timer.h"

+ 1 - 1
components/efuse/test/CMakeLists.txt

@@ -14,5 +14,5 @@ set(src_dirs "." "${dir}")
 
 
 idf_component_register(SRC_DIRS "${src_dirs}"
 idf_component_register(SRC_DIRS "${src_dirs}"
                        PRIV_INCLUDE_DIRS "." "${dir}/include" "../private_include" "../${target}/private_include"
                        PRIV_INCLUDE_DIRS "." "${dir}/include" "../private_include" "../${target}/private_include"
-                       PRIV_REQUIRES cmock test_utils efuse bootloader_support
+                       PRIV_REQUIRES cmock test_utils efuse bootloader_support esp_timer
                        )
                        )

+ 1 - 0
components/efuse/test/test_efuse.c

@@ -15,6 +15,7 @@
 #include "esp_efuse_table.h"
 #include "esp_efuse_table.h"
 #include "esp_efuse_utility.h"
 #include "esp_efuse_utility.h"
 #include "esp_efuse_test_table.h"
 #include "esp_efuse_test_table.h"
+#include "esp_timer.h"
 #include "bootloader_random.h"
 #include "bootloader_random.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
 #include "freertos/task.h"

+ 1 - 1
components/esp_event/test/CMakeLists.txt

@@ -1,3 +1,3 @@
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
                        PRIV_INCLUDE_DIRS . ../private_include
                        PRIV_INCLUDE_DIRS . ../private_include
-                       PRIV_REQUIRES cmock test_utils esp_event driver)
+                       PRIV_REQUIRES cmock test_utils esp_event driver esp_timer)

+ 1 - 1
components/esp_hw_support/CMakeLists.txt

@@ -21,7 +21,7 @@ if(NOT BOOTLOADER_BUILD)
     endif()
     endif()
 
 
     # [refactor-todo]: requires "driver" for GPIO and RTC  (by sleep_gpio and sleep_modes)
     # [refactor-todo]: requires "driver" for GPIO and RTC  (by sleep_gpio and sleep_modes)
-    list(APPEND priv_requires driver)
+    list(APPEND priv_requires driver esp_timer)
 
 
     if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
     if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
         list(APPEND srcs "rtc_wdt.c")
         list(APPEND srcs "rtc_wdt.c")

+ 1 - 1
components/esp_hw_support/test/CMakeLists.txt

@@ -1,5 +1,5 @@
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
                     PRIV_INCLUDE_DIRS "${include_dirs}"
                     PRIV_INCLUDE_DIRS "${include_dirs}"
-                    PRIV_REQUIRES cmock test_utils esp_hw_support driver efuse)
+                    PRIV_REQUIRES cmock test_utils esp_hw_support driver efuse esp_timer)
 
 
  target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ld_include_test_dport_xt_highint5")
  target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ld_include_test_dport_xt_highint5")

+ 1 - 1
components/esp_phy/CMakeLists.txt

@@ -36,7 +36,7 @@ endif()
 # [refactor-todo]: requires "driver" component for periph_ctrl header file
 # [refactor-todo]: requires "driver" component for periph_ctrl header file
 idf_component_register(SRCS "${srcs}"
 idf_component_register(SRCS "${srcs}"
                     INCLUDE_DIRS "include" "${idf_target}/include"
                     INCLUDE_DIRS "include" "${idf_target}/include"
-                    PRIV_REQUIRES nvs_flash driver efuse
+                    PRIV_REQUIRES nvs_flash driver efuse esp_timer
                     LDFRAGMENTS "${ldfragments}"
                     LDFRAGMENTS "${ldfragments}"
                     EMBED_FILES  ${embed_files}
                     EMBED_FILES  ${embed_files}
                     )
                     )

+ 1 - 0
components/esp_phy/src/phy_init.c

@@ -18,6 +18,7 @@
 #include "nvs.h"
 #include "nvs.h"
 #include "nvs_flash.h"
 #include "nvs_flash.h"
 #include "esp_efuse.h"
 #include "esp_efuse.h"
+#include "esp_timer.h"
 #include "sdkconfig.h"
 #include "sdkconfig.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/portmacro.h"
 #include "freertos/portmacro.h"

+ 1 - 1
components/esp_pm/CMakeLists.txt

@@ -1,4 +1,4 @@
 idf_component_register(SRCS "pm_locks.c" "pm_trace.c" "pm_impl.c"
 idf_component_register(SRCS "pm_locks.c" "pm_trace.c" "pm_impl.c"
                        INCLUDE_DIRS include
                        INCLUDE_DIRS include
-                       PRIV_REQUIRES esp_system driver
+                       PRIV_REQUIRES esp_system driver esp_timer
                        LDFRAGMENTS linker.lf)
                        LDFRAGMENTS linker.lf)

+ 1 - 1
components/esp_pm/test/CMakeLists.txt

@@ -1,2 +1,2 @@
 idf_component_register(SRC_DIRS .
 idf_component_register(SRC_DIRS .
-                       PRIV_REQUIRES unity esp_pm ulp driver)
+                       PRIV_REQUIRES unity esp_pm ulp driver esp_timer)

+ 1 - 0
components/esp_pm/test/test_pm.c

@@ -6,6 +6,7 @@
 #include "unity.h"
 #include "unity.h"
 #include "esp_pm.h"
 #include "esp_pm.h"
 #include "esp_sleep.h"
 #include "esp_sleep.h"
+#include "esp_timer.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
 #include "freertos/task.h"
 #include "freertos/semphr.h"
 #include "freertos/semphr.h"

+ 1 - 1
components/esp_system/CMakeLists.txt

@@ -36,7 +36,7 @@ else()
 
 
     idf_component_register(SRCS "${srcs}"
     idf_component_register(SRCS "${srcs}"
                         INCLUDE_DIRS include
                         INCLUDE_DIRS include
-                        PRIV_REQUIRES spi_flash
+                        PRIV_REQUIRES spi_flash esp_timer
                                     # [refactor-todo] requirements due to init code,
                                     # [refactor-todo] requirements due to init code,
                                     # should be removable once using component init functions
                                     # should be removable once using component init functions
                                     # link-time registration is used.
                                     # link-time registration is used.

+ 2 - 1
components/esp_system/test/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(requires "unity"
 set(requires "unity"
              "test_utils"
              "test_utils"
-             "driver")
+             "driver"
+             "esp_timer")
 
 
 set(excludes "test_ipc_isr.c"
 set(excludes "test_ipc_isr.c"
              "test_ipc_isr.S"
              "test_ipc_isr.S"

+ 1 - 1
components/esp_timer/test/CMakeLists.txt

@@ -1,3 +1,3 @@
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
                        PRIV_INCLUDE_DIRS "../private_include"
                        PRIV_INCLUDE_DIRS "../private_include"
-                       PRIV_REQUIRES cmock test_utils)
+                       PRIV_REQUIRES cmock test_utils esp_timer)

+ 1 - 2
components/esp_wifi/esp32/esp_adapter.c

@@ -16,7 +16,6 @@
 #include "freertos/queue.h"
 #include "freertos/queue.h"
 #include "freertos/semphr.h"
 #include "freertos/semphr.h"
 #include "freertos/event_groups.h"
 #include "freertos/event_groups.h"
-#include "freertos/xtensa_api.h"
 #include "freertos/portmacro.h"
 #include "freertos/portmacro.h"
 #include "freertos/xtensa_api.h"
 #include "freertos/xtensa_api.h"
 #include "esp_types.h"
 #include "esp_types.h"
@@ -28,6 +27,7 @@
 #include "esp_log.h"
 #include "esp_log.h"
 #include "esp_event.h"
 #include "esp_event.h"
 #include "esp_heap_caps.h"
 #include "esp_heap_caps.h"
+#include "esp_timer.h"
 #include "esp_private/wifi_os_adapter.h"
 #include "esp_private/wifi_os_adapter.h"
 #include "esp_private/wifi.h"
 #include "esp_private/wifi.h"
 #include "esp_phy_init.h"
 #include "esp_phy_init.h"
@@ -42,7 +42,6 @@
 #include "esp_coexist_internal.h"
 #include "esp_coexist_internal.h"
 #include "esp_coexist_adapter.h"
 #include "esp_coexist_adapter.h"
 #include "esp32/dport_access.h"
 #include "esp32/dport_access.h"
-#include "esp_timer.h"
 #include "esp_rom_sys.h"
 #include "esp_rom_sys.h"
 #include "esp32/rom/ets_sys.h"
 #include "esp32/rom/ets_sys.h"
 
 

+ 1 - 1
components/esp_wifi/esp32s2/esp_adapter.c

@@ -16,7 +16,6 @@
 #include "freertos/queue.h"
 #include "freertos/queue.h"
 #include "freertos/semphr.h"
 #include "freertos/semphr.h"
 #include "freertos/event_groups.h"
 #include "freertos/event_groups.h"
-#include "freertos/xtensa_api.h"
 #include "freertos/portmacro.h"
 #include "freertos/portmacro.h"
 #include "freertos/xtensa_api.h"
 #include "freertos/xtensa_api.h"
 #include "esp_types.h"
 #include "esp_types.h"
@@ -28,6 +27,7 @@
 #include "esp_log.h"
 #include "esp_log.h"
 #include "esp_event.h"
 #include "esp_event.h"
 #include "esp_heap_caps.h"
 #include "esp_heap_caps.h"
+#include "esp_timer.h"
 #include "esp_private/wifi_os_adapter.h"
 #include "esp_private/wifi_os_adapter.h"
 #include "esp_private/wifi.h"
 #include "esp_private/wifi.h"
 #include "esp_phy_init.h"
 #include "esp_phy_init.h"

+ 6 - 7
components/freertos/CMakeLists.txt

@@ -113,17 +113,10 @@ else()
     endif()
     endif()
 endif()
 endif()
 
 
-# esp_timer is required by FreeRTOS when we use esp_timer_get_time() to do profiling
-# [refactor-todo]: make this an optional requirement depending on CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
-# Note, many other components implicitly include esp_timer.h via freertos portmacro.h and some
-# components implicitly depend on esp_timer via freertos.
-set(required_components esp_timer)
-
 idf_component_register(SRCS "${srcs}"
 idf_component_register(SRCS "${srcs}"
                     INCLUDE_DIRS ${include_dirs}
                     INCLUDE_DIRS ${include_dirs}
                     PRIV_INCLUDE_DIRS  ${private_include_dirs}
                     PRIV_INCLUDE_DIRS  ${private_include_dirs}
                     LDFRAGMENTS linker.lf
                     LDFRAGMENTS linker.lf
-                    REQUIRES ${required_components}
                     PRIV_REQUIRES soc esp_pm)
                     PRIV_REQUIRES soc esp_pm)
 
 
 idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
 idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
@@ -166,3 +159,9 @@ if(CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME)
     # [refactor-todo]: port.c esp_startup_start_app_common() calls esp_gdbstub_init()
     # [refactor-todo]: port.c esp_startup_start_app_common() calls esp_gdbstub_init()
     idf_component_optional_requires(PRIVATE esp_gdbstub)
     idf_component_optional_requires(PRIVATE esp_gdbstub)
 endif()
 endif()
+
+if(CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER)
+    # [refactor-todo]: esp_timer is required by FreeRTOS when we use esp_timer_get_time() to do profiling
+    # Introduce a port wrapper function to avoid including esp_timer.h into the public header
+    idf_component_optional_requires(PUBLIC esp_timer)
+endif()

+ 5 - 1
components/freertos/FreeRTOS-Kernel-SMP/portable/xtensa/include/freertos/portmacro.h

@@ -382,7 +382,6 @@ portmacro.h. Therefore, we need to keep these headers around for now to allow th
 #include <stdarg.h>
 #include <stdarg.h>
 #include <xtensa/hal.h>
 #include <xtensa/hal.h>
 #include "esp_attr.h"
 #include "esp_attr.h"
-#include "esp_timer.h"
 #include "esp_newlib.h"
 #include "esp_newlib.h"
 #include "esp_heap_caps.h"
 #include "esp_heap_caps.h"
 #include "esp_rom_sys.h"
 #include "esp_rom_sys.h"
@@ -392,6 +391,11 @@ portmacro.h. Therefore, we need to keep these headers around for now to allow th
 #include <xtensa/config/system.h>
 #include <xtensa/config/system.h>
 #include <xtensa/xtensa_api.h>
 #include <xtensa/xtensa_api.h>
 
 
+/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
+#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
+#include "esp_timer.h"
+#endif
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif

+ 5 - 1
components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h

@@ -47,7 +47,6 @@
 #include "esp_macros.h"
 #include "esp_macros.h"
 #include "esp_attr.h"
 #include "esp_attr.h"
 #include "esp_rom_sys.h"
 #include "esp_rom_sys.h"
-#include "esp_timer.h"              /* required for FreeRTOS run time stats */
 #include "esp_heap_caps.h"
 #include "esp_heap_caps.h"
 #include "esp_system.h"             /* required by esp_get_...() functions in portable.h. [refactor-todo] Update portable.h */
 #include "esp_system.h"             /* required by esp_get_...() functions in portable.h. [refactor-todo] Update portable.h */
 #include "esp_newlib.h"
 #include "esp_newlib.h"
@@ -55,6 +54,11 @@
 /* [refactor-todo] These includes are not directly used in this file. They are kept into to prevent a breaking change. Remove these. */
 /* [refactor-todo] These includes are not directly used in this file. They are kept into to prevent a breaking change. Remove these. */
 #include <limits.h>
 #include <limits.h>
 
 
+/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
+#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
+#include "esp_timer.h"
+#endif
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif

+ 5 - 1
components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h

@@ -76,7 +76,6 @@
 #include "esp_private/crosscore_int.h"
 #include "esp_private/crosscore_int.h"
 #include "esp_macros.h"
 #include "esp_macros.h"
 #include "esp_attr.h"
 #include "esp_attr.h"
-#include "esp_timer.h"              /* required for esp_timer_get_time. [refactor-todo] make this common between archs */
 #include "esp_newlib.h"             /* required for esp_reent_init() in tasks.c */
 #include "esp_newlib.h"             /* required for esp_reent_init() in tasks.c */
 #include "esp_heap_caps.h"
 #include "esp_heap_caps.h"
 #include "esp_rom_sys.h"
 #include "esp_rom_sys.h"
@@ -88,6 +87,11 @@
 #include <xtensa/config/system.h>
 #include <xtensa/config/system.h>
 #include <xtensa/xtensa_api.h>
 #include <xtensa/xtensa_api.h>
 
 
+/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
+#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
+#include "esp_timer.h"
+#endif
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif

+ 1 - 1
components/freertos/test/CMakeLists.txt

@@ -7,4 +7,4 @@ idf_component_register(SRC_DIRS integration/event_groups
                                 performance
                                 performance
                                 port
                                 port
                        PRIV_INCLUDE_DIRS .
                        PRIV_INCLUDE_DIRS .
-                       PRIV_REQUIRES cmock test_utils esp_system driver)
+                       PRIV_REQUIRES cmock test_utils esp_system driver esp_timer)

+ 1 - 0
components/freertos/test/integration/tasks/test_task_suspend_resume.c

@@ -21,6 +21,7 @@
 #endif
 #endif
 #include "esp_freertos_hooks.h"
 #include "esp_freertos_hooks.h"
 #include "esp_rom_sys.h"
 #include "esp_rom_sys.h"
+#include "esp_timer.h"
 
 
 /* Counter task counts a target variable forever */
 /* Counter task counts a target variable forever */
 static void task_count(void *vp_counter)
 static void task_count(void *vp_counter)

+ 1 - 1
components/mbedtls/test/CMakeLists.txt

@@ -7,7 +7,7 @@ set(TEST_CRTS "crts/server_cert_chain.pem"
 
 
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
                     PRIV_INCLUDE_DIRS "."
                     PRIV_INCLUDE_DIRS "."
-                    PRIV_REQUIRES cmock test_utils mbedtls
+                    PRIV_REQUIRES cmock test_utils mbedtls esp_timer
                     EMBED_TXTFILES ${TEST_CRTS})
                     EMBED_TXTFILES ${TEST_CRTS})
 
 
 
 

+ 1 - 1
components/newlib/test/CMakeLists.txt

@@ -1,3 +1,3 @@
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
                     PRIV_INCLUDE_DIRS "."
                     PRIV_INCLUDE_DIRS "."
-                    PRIV_REQUIRES cmock test_utils driver)
+                    PRIV_REQUIRES cmock test_utils driver esp_timer)

+ 1 - 1
components/pthread/test/CMakeLists.txt

@@ -5,4 +5,4 @@ set(sources "test_pthread.c"
             "test_pthread_rwlock.c")
             "test_pthread_rwlock.c")
 
 
 idf_component_register(SRCS ${sources}
 idf_component_register(SRCS ${sources}
-                    PRIV_REQUIRES cmock test_utils pthread)
+                    PRIV_REQUIRES cmock test_utils pthread esp_timer)

+ 2 - 1
components/spi_flash/test/CMakeLists.txt

@@ -5,4 +5,5 @@ endif()
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
                        EXCLUDE_SRCS "${exclude_srcs}"
                        EXCLUDE_SRCS "${exclude_srcs}"
                        PRIV_INCLUDE_DIRS "."
                        PRIV_INCLUDE_DIRS "."
-                       PRIV_REQUIRES cmock test_utils spi_flash bootloader_support app_update driver)
+                       PRIV_REQUIRES cmock test_utils spi_flash bootloader_support app_update
+                                     driver esp_timer)

+ 2 - 1
components/touch_element/CMakeLists.txt

@@ -4,5 +4,6 @@ if(IDF_TARGET STREQUAL "esp32s2")
             "touch_slider.c"
             "touch_slider.c"
             "touch_matrix.c"
             "touch_matrix.c"
             INCLUDE_DIRS include
             INCLUDE_DIRS include
-            REQUIRES driver)
+            REQUIRES driver
+            PRIV_REQUIRES esp_timer)
 endif()
 endif()

+ 0 - 1
components/usb/hcd.c

@@ -12,7 +12,6 @@
 #include "freertos/semphr.h"
 #include "freertos/semphr.h"
 #include "esp_heap_caps.h"
 #include "esp_heap_caps.h"
 #include "esp_intr_alloc.h"
 #include "esp_intr_alloc.h"
-#include "esp_timer.h"
 #include "esp_err.h"
 #include "esp_err.h"
 #include "esp_rom_gpio.h"
 #include "esp_rom_gpio.h"
 #include "hal/usbh_hal.h"
 #include "hal/usbh_hal.h"

+ 1 - 1
components/vfs/CMakeLists.txt

@@ -5,7 +5,7 @@ idf_component_register(SRCS "vfs.c"
                             "vfs_console.c"
                             "vfs_console.c"
                     INCLUDE_DIRS include
                     INCLUDE_DIRS include
                     PRIV_INCLUDE_DIRS private_include
                     PRIV_INCLUDE_DIRS private_include
-                    PRIV_REQUIRES driver)
+                    PRIV_REQUIRES driver esp_timer)
 
 
 if(CONFIG_ESP_CONSOLE_USB_CDC)
 if(CONFIG_ESP_CONSOLE_USB_CDC)
     target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c")
     target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c")

+ 1 - 0
components/wpa_supplicant/src/common/wpa_supplicant_i.h

@@ -12,6 +12,7 @@
 
 
 #include "drivers/driver.h"
 #include "drivers/driver.h"
 #include "common/ieee802_11_defs.h"
 #include "common/ieee802_11_defs.h"
+#include "esp_timer.h"
 /*
 /*
  * struct rrm_data - Data used for managing RRM features
  * struct rrm_data - Data used for managing RRM features
  */
  */

+ 15 - 3
docs/en/migration-guides/build-system.rst

@@ -11,7 +11,19 @@ Update fragment file grammar
 
 
 Please follow the :ref:`migrate linker script fragment files grammar<ldgen-migrate-lf-grammar>` chapter for migrating v3.x grammar to the new one.
 Please follow the :ref:`migrate linker script fragment files grammar<ldgen-migrate-lf-grammar>` chapter for migrating v3.x grammar to the new one.
 
 
-Component dependencies that shall be explicit
----------------------------------------------
+Specify component requirements explicitly
+-----------------------------------------
 
 
-In previous versions of ESP-IDF, target components (``components/esp32*``) had a dependency on ``driver`` and ``efuse`` components. Since target components were part of common requirements (:ref:`more info about common requirements <component-common-requirements>`), all components in the project implicitly had a dependency on ``driver`` and ``efuse``. Now that the dependency of target components on these components has been removed, every component depending on ``driver`` or ``efuse`` has to declare this dependency explicitly. This can be done by adding ``REQUIRES <component_name>`` or ``PRIV_REQUIRES <component_name>`` in ``idf_component_register`` call inside component's ``CMakeLists.txt``. See :ref:`Component Requirements` for more information on specifying requirements.
+In previous versions of ESP-IDF, some components were always added as public requirements (dependencies) to every component in the build, in addition to the :ref:`common requirements<component-common-requirements>`:
+
+* ``driver``
+* ``efuse``
+* ``esp_timer``
+
+This means that it was possible to include header files of those components without specifying them as requirements in ``idf_component_register``.
+
+This behavior was caused by transitive dependencies of various common components.
+
+In ESP-IDF v5.0, this behavior is fixed and these components are no longer added as public requirements by default.
+
+Every component depending on one of the components which isn't part of common requirements has to declare this dependency explicitly. This can be done by adding ``REQUIRES <component_name>`` or ``PRIV_REQUIRES <component_name>`` in ``idf_component_register`` call inside component's ``CMakeLists.txt``. See :ref:`Component Requirements` for more information on specifying requirements.

+ 1 - 0
examples/bluetooth/esp_ble_mesh/ble_mesh_console/main/ble_mesh_reg_test_perf_client_cmd.c

@@ -8,6 +8,7 @@
 #include "freertos/task.h"
 #include "freertos/task.h"
 #include "freertos/queue.h"
 #include "freertos/queue.h"
 #include "freertos/FreeRTOSConfig.h"
 #include "freertos/FreeRTOSConfig.h"
+#include "esp_timer.h"
 
 
 #include "esp_ble_mesh_networking_api.h"
 #include "esp_ble_mesh_networking_api.h"
 #include "ble_mesh_adapter.h"
 #include "ble_mesh_adapter.h"

+ 1 - 0
examples/bluetooth/esp_ble_mesh/ble_mesh_console/main/ble_mesh_register_cmd.c

@@ -5,6 +5,7 @@
  */
  */
 
 
 #include "esp_bt.h"
 #include "esp_bt.h"
+#include "esp_timer.h"
 #include "soc/soc.h"
 #include "soc/soc.h"
 
 
 #include "test.h"
 #include "test.h"

+ 1 - 0
examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/main/main.c

@@ -13,6 +13,7 @@
 #include "esp_log.h"
 #include "esp_log.h"
 #include "nvs_flash.h"
 #include "nvs_flash.h"
 #include "esp_bt.h"
 #include "esp_bt.h"
+#include "esp_timer.h"
 
 
 #include "esp_ble_mesh_defs.h"
 #include "esp_ble_mesh_defs.h"
 #include "esp_ble_mesh_common_api.h"
 #include "esp_ble_mesh_common_api.h"

+ 1 - 1
examples/bluetooth/esp_ble_mesh/common_components/button/CMakeLists.txt

@@ -1,3 +1,3 @@
 idf_component_register(SRCS "button.c" "button_obj.cpp"
 idf_component_register(SRCS "button.c" "button_obj.cpp"
                     INCLUDE_DIRS  "." "include"
                     INCLUDE_DIRS  "." "include"
-                    PRIV_REQUIRES driver)
+                    PRIV_REQUIRES driver esp_timer)

+ 1 - 0
examples/bluetooth/hci/ble_adv_scan_combined/main/app_bt.c

@@ -11,6 +11,7 @@
 #include "freertos/task.h"
 #include "freertos/task.h"
 #include "esp_bt.h"
 #include "esp_bt.h"
 #include "esp_log.h"
 #include "esp_log.h"
+#include "esp_timer.h"
 #include "nvs_flash.h"
 #include "nvs_flash.h"
 #include "freertos/queue.h"
 #include "freertos/queue.h"
 #include "bt_hci_common.h"
 #include "bt_hci_common.h"

+ 2 - 1
examples/common_components/iperf/CMakeLists.txt

@@ -1,3 +1,4 @@
 idf_component_register(SRCS "iperf.c"
 idf_component_register(SRCS "iperf.c"
                     INCLUDE_DIRS "include"
                     INCLUDE_DIRS "include"
-                    REQUIRES lwip)
+                    REQUIRES lwip
+                    PRIV_REQUIRES esp_timer)

+ 1 - 0
examples/protocols/https_request/main/https_request_example_main.c

@@ -24,6 +24,7 @@
 #include "esp_event.h"
 #include "esp_event.h"
 #include "esp_log.h"
 #include "esp_log.h"
 #include "esp_system.h"
 #include "esp_system.h"
+#include "esp_timer.h"
 #include "nvs_flash.h"
 #include "nvs_flash.h"
 #include "nvs.h"
 #include "nvs.h"
 #include "protocol_examples_common.h"
 #include "protocol_examples_common.h"

+ 1 - 0
examples/system/eventfd/main/eventfd_example.c

@@ -16,6 +16,7 @@
 #include "esp_vfs.h"
 #include "esp_vfs.h"
 #include "esp_vfs_dev.h"
 #include "esp_vfs_dev.h"
 #include "esp_vfs_eventfd.h"
 #include "esp_vfs_eventfd.h"
+#include "esp_timer.h"
 #include "driver/gptimer.h"
 #include "driver/gptimer.h"
 
 
 #define TIMER_RESOLUTION      1000000 // 1MHz, 1 tick = 1us
 #define TIMER_RESOLUTION      1000000 // 1MHz, 1 tick = 1us

+ 1 - 0
examples/system/light_sleep/main/light_sleep_example_main.c

@@ -14,6 +14,7 @@
 #include "driver/uart.h"
 #include "driver/uart.h"
 #include "esp_sleep.h"
 #include "esp_sleep.h"
 #include "esp_log.h"
 #include "esp_log.h"
+#include "esp_timer.h"
 #include "light_sleep_example.h"
 #include "light_sleep_example.h"
 
 
 static void light_sleep_task(void *args)
 static void light_sleep_task(void *args)

+ 1 - 0
tools/test_apps/system/longjmp_test/main/hello_world_main.c

@@ -12,6 +12,7 @@
 #include "freertos/task.h"
 #include "freertos/task.h"
 #include "esp_system.h"
 #include "esp_system.h"
 #include "esp_spi_flash.h"
 #include "esp_spi_flash.h"
+#include "esp_timer.h"
 #include <esp_task.h>
 #include <esp_task.h>
 
 
 #include <setjmp.h>
 #include <setjmp.h>

+ 1 - 1
tools/unit-test-app/components/test_utils/test/CMakeLists.txt

@@ -1,3 +1,3 @@
 idf_component_register(SRC_DIRS "."
 idf_component_register(SRC_DIRS "."
     PRIV_INCLUDE_DIRS "."
     PRIV_INCLUDE_DIRS "."
-    PRIV_REQUIRES cmock test_utils perfmon)
+    PRIV_REQUIRES cmock test_utils perfmon esp_timer)