@@ -82,9 +82,16 @@ list(APPEND MEMFAULT_COMPONENTS_SRCS
8282list (APPEND MEMFAULT_COMPONENTS_INC_FOLDERS
8383 include
8484 include /${MEMFAULT_ESP_IDF_PORT}
85+ ${MEMFAULT_SDK_ROOT} /ports/include
8586 $ENV{MEMFAULT_PLATFORM_EXTRA_INCLUDES}
87+ config
8688)
8789
90+ if (CONFIG_MEMFAULT_LWIP_METRICS)
91+ list (APPEND MEMFAULT_COMPONENTS_SRCS ${MEMFAULT_SDK_ROOT} /ports/lwip/memfault_lwip_metrics.c)
92+ list (APPEND MEMFAULT_COMPONENTS_INC_FOLDERS ${MEMFAULT_SDK_ROOT} /ports/lwip/config)
93+ endif ()
94+
8895# For version >= 4.4.3, we can collect smaller coredumps by default
8996# by prioritizing active stack and FreeRTOS regions first. ESP-IDF < 4.4.3
9097# uses a simpler scheme collecting all of DRAM. See
@@ -97,10 +104,6 @@ if (DEFINED ENV{IDF_VERSION})
97104 ${MEMFAULT_SDK_ROOT} /ports/freertos/src/memfault_freertos_ram_regions.c
98105 )
99106
100- list (APPEND MEMFAULT_COMPONENTS_INC_FOLDERS
101- ${MEMFAULT_SDK_ROOT} /ports/include /
102- )
103-
104107 # Add a linker fragment to place FreeRTOS timers and task objects in the same area of dram0.bss
105108 set (COMPONENT_ADD_LDFRAGMENTS "${MEMFAULT_ESP_IDF_PORT_COMMON} /memfault_esp_freertos.lf" )
106109 endif ()
@@ -122,6 +125,10 @@ list(APPEND COMPONENT_REQUIRES
122125 driver
123126)
124127
128+ if (CONFIG_MEMFAULT_LWIP_METRICS)
129+ list (APPEND COMPONENT_REQUIRES lwip)
130+ endif ()
131+
125132if ($ENV{MEMFAULT_ESP_HTTP_CLIENT_ENABLE} )
126133list (APPEND COMPONENT_REQUIRES esp_http_client esp_https_ota)
127134endif ()
@@ -133,6 +140,7 @@ get_filename_component(this_directory_name ${this_directory_name} NAME)
133140mflt_esp32_component_get_target(this_component ${this_directory_name} )
134141
135142component_compile_options(-DMEMFAULT_ESP_HTTP_CLIENT_ENABLE=$ENV{MEMFAULT_ESP_HTTP_CLIENT_ENABLE} )
143+ component_compile_options(-DMEMFAULT_METRICS_USER_HEARTBEAT_DEFS_FILE="memfault_esp_metrics_heartbeat_config.def" )
136144
137145# We will intercept the panic handlers enabled by CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH
138146# and run the Memfault Fault Handler instead.
0 commit comments