mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 20:54:32 +02:00
freertos,esp_system: make dependencies on some components optional
Dependencies on gdbstub, espcoredump, app_trace will only be added if these components are present in the build.
This commit is contained in:
@@ -40,8 +40,8 @@ else()
|
|||||||
# [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.
|
||||||
esp_pm app_update nvs_flash pthread app_trace esp_gdbstub
|
esp_pm app_update nvs_flash pthread
|
||||||
espcoredump esp_phy efuse
|
esp_phy efuse
|
||||||
LDFRAGMENTS "linker.lf" "app.lf")
|
LDFRAGMENTS "linker.lf" "app.lf")
|
||||||
add_subdirectory(port)
|
add_subdirectory(port)
|
||||||
|
|
||||||
@@ -72,3 +72,20 @@ endif()
|
|||||||
# Force linking UBSAN hooks. If UBSAN is not enabled, the hooks will ultimately be removed
|
# Force linking UBSAN hooks. If UBSAN is not enabled, the hooks will ultimately be removed
|
||||||
# due to -ffunction-sections -Wl,--gc-sections options.
|
# due to -ffunction-sections -Wl,--gc-sections options.
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __ubsan_include")
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __ubsan_include")
|
||||||
|
|
||||||
|
|
||||||
|
# [refactor-todo] requirements due to init code, should be removable
|
||||||
|
# once link-time registration of component init functions is used.
|
||||||
|
if(CONFIG_APPTRACE_ENABLE)
|
||||||
|
idf_component_optional_requires(PRIVATE app_trace)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_ESP_COREDUMP_ENABLE)
|
||||||
|
idf_component_optional_requires(PRIVATE espcoredump)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# [refactor-todo] requirement from the panic handler,
|
||||||
|
# need to introduce panic "event" concept to remove this dependency (IDF-2194)
|
||||||
|
if(CONFIG_ESP_SYSTEM_PANIC_GDBSTUB)
|
||||||
|
idf_component_optional_requires(PRIVATE esp_gdbstub)
|
||||||
|
endif()
|
||||||
|
@@ -45,7 +45,10 @@
|
|||||||
#include "esp_core_dump.h"
|
#include "esp_core_dump.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_APPTRACE_ENABLE
|
||||||
#include "esp_app_trace.h"
|
#include "esp_app_trace.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "esp_private/dbg_stubs.h"
|
#include "esp_private/dbg_stubs.h"
|
||||||
#include "esp_pm.h"
|
#include "esp_pm.h"
|
||||||
#include "esp_private/pm_impl.h"
|
#include "esp_private/pm_impl.h"
|
||||||
|
@@ -68,10 +68,11 @@ if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
|||||||
list(APPEND srcs "FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S")
|
list(APPEND srcs "FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# esp_timer is required by FreeRTOS because we use esp_tiemr_get_time() to do profiling
|
# esp_timer is required by FreeRTOS when we use esp_timer_get_time() to do profiling
|
||||||
# app_trace is required by FreeRTOS headers only when CONFIG_APPTRACE_SV_ENABLE=y,
|
# [refactor-todo]: make this an optional requirement depending on CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
|
||||||
# REQUIRES can't depend on config options, so always require it.
|
# Note, many other components implicitly include esp_timer.h via freertos portmacro.h and some
|
||||||
set(required_components app_trace esp_timer)
|
# 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}
|
||||||
@@ -104,3 +105,12 @@ set_source_files_properties(
|
|||||||
# we can't establish dependency on what we don't yet know, so we force the
|
# we can't establish dependency on what we don't yet know, so we force the
|
||||||
# linker to not drop this symbol.
|
# linker to not drop this symbol.
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u app_main")
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u app_main")
|
||||||
|
|
||||||
|
if(CONFIG_APPTRACE_SV_ENABLE)
|
||||||
|
# FreeRTOS headers have a dependency on app_trace when SystemView tracing is enabled
|
||||||
|
idf_component_optional_requires(PUBLIC app_trace)
|
||||||
|
elseif(CONFIG_APPTRACE_ENABLE)
|
||||||
|
# [refactor-todo]: port.c has a dependency on esp_apptrace_init, for running it on APP CPU.
|
||||||
|
# this should be resolved when link-time registration of startup functions is added.
|
||||||
|
idf_component_optional_requires(PRIVATE app_trace)
|
||||||
|
endif()
|
||||||
|
@@ -61,7 +61,9 @@
|
|||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_int_wdt.h"
|
#include "esp_int_wdt.h"
|
||||||
|
#ifdef CONFIG_APPTRACE_ENABLE
|
||||||
#include "esp_app_trace.h" /* Required for esp_apptrace_init. [refactor-todo] */
|
#include "esp_app_trace.h" /* Required for esp_apptrace_init. [refactor-todo] */
|
||||||
|
#endif
|
||||||
#include "FreeRTOS.h" /* This pulls in portmacro.h */
|
#include "FreeRTOS.h" /* This pulls in portmacro.h */
|
||||||
#include "task.h" /* Required for TaskHandle_t, tskNO_AFFINITY, and vTaskStartScheduler */
|
#include "task.h" /* Required for TaskHandle_t, tskNO_AFFINITY, and vTaskStartScheduler */
|
||||||
#include "port_systick.h"
|
#include "port_systick.h"
|
||||||
|
@@ -22,9 +22,6 @@ set(extra_allowed_components
|
|||||||
# These components are currently included into "G1" build, but shouldn't.
|
# These components are currently included into "G1" build, but shouldn't.
|
||||||
# After removing the extra dependencies, remove the components from this list as well.
|
# After removing the extra dependencies, remove the components from this list as well.
|
||||||
set(extra_components_which_shouldnt_be_included
|
set(extra_components_which_shouldnt_be_included
|
||||||
# app_trace is a public dependency of FreeRTOS because of SystemView trace headers.
|
|
||||||
# To fix, convert this into a weak public dependency conditional on CONFIG_APPTRACE_SV_ENABLE.
|
|
||||||
app_trace
|
|
||||||
# app_update gets added because of bootloader_support, spi_flash, espcoredump, esp_system.
|
# app_update gets added because of bootloader_support, spi_flash, espcoredump, esp_system.
|
||||||
# bootloader_support, spi_flash, espcoredump should be removed from dependencies;
|
# bootloader_support, spi_flash, espcoredump should be removed from dependencies;
|
||||||
# esp_system code that reads app version should be made conditional on app_update being included
|
# esp_system code that reads app version should be made conditional on app_update being included
|
||||||
@@ -51,8 +48,6 @@ set(extra_components_which_shouldnt_be_included
|
|||||||
esp_eth
|
esp_eth
|
||||||
# esp_event is a dependency of esp_wifi, esp_eth. Both should be removed from G1.
|
# esp_event is a dependency of esp_wifi, esp_eth. Both should be removed from G1.
|
||||||
esp_event
|
esp_event
|
||||||
# esp_gdbstub is a dependency of esp_system, can easily be made conditional on related Kconfig option.
|
|
||||||
esp_gdbstub
|
|
||||||
# esp_netif is a dependency of lwip and esp_event, should disappear once lwip is removed.
|
# esp_netif is a dependency of lwip and esp_event, should disappear once lwip is removed.
|
||||||
esp_netif
|
esp_netif
|
||||||
# esp_phy is a dependency of esp_system and esp_wifi. For the former, it can be made a weak dependency.
|
# esp_phy is a dependency of esp_system and esp_wifi. For the former, it can be made a weak dependency.
|
||||||
@@ -69,11 +64,6 @@ set(extra_components_which_shouldnt_be_included
|
|||||||
# esp_wifi is a dependency of lwip.
|
# esp_wifi is a dependency of lwip.
|
||||||
# [refactor-todo]: investigate making esp_wifi a conditional dependency.
|
# [refactor-todo]: investigate making esp_wifi a conditional dependency.
|
||||||
esp_wifi
|
esp_wifi
|
||||||
# Similar to esp_gdbstub, this dependency from esp_system can be made weakly dependent
|
|
||||||
# on CONFIG_ESP_COREDUMP_ENABLE.
|
|
||||||
# [refactor-todo]: how will the user set CONFIG_ESP_COREDUMP_ENABLE if the component
|
|
||||||
# is not included into the build, hence Kconfig option is not visible in menuconfig?
|
|
||||||
espcoredump
|
|
||||||
# esptool_py is a dependency of bootloader, esp_wifi, app_update, partition_table, all of which
|
# esptool_py is a dependency of bootloader, esp_wifi, app_update, partition_table, all of which
|
||||||
# should be removed from G1-only build.
|
# should be removed from G1-only build.
|
||||||
esptool_py
|
esptool_py
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# in this exact order for cmake to work correctly
|
# in this exact order for cmake to work correctly
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
set(COMPONENTS esptool_py main)
|
set(COMPONENTS main espcoredump esp_gdbstub)
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
|
||||||
project(test_panic)
|
project(test_panic)
|
||||||
|
Reference in New Issue
Block a user