@@ -82,9 +82,16 @@ list(APPEND MEMFAULT_COMPONENTS_SRCS
82
82
list (APPEND MEMFAULT_COMPONENTS_INC_FOLDERS
83
83
include
84
84
include /${MEMFAULT_ESP_IDF_PORT}
85
+ ${MEMFAULT_SDK_ROOT} /ports/include
85
86
$ENV{MEMFAULT_PLATFORM_EXTRA_INCLUDES}
87
+ config
86
88
)
87
89
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
+
88
95
# For version >= 4.4.3, we can collect smaller coredumps by default
89
96
# by prioritizing active stack and FreeRTOS regions first. ESP-IDF < 4.4.3
90
97
# uses a simpler scheme collecting all of DRAM. See
@@ -97,10 +104,6 @@ if (DEFINED ENV{IDF_VERSION})
97
104
${MEMFAULT_SDK_ROOT} /ports/freertos/src/memfault_freertos_ram_regions.c
98
105
)
99
106
100
- list (APPEND MEMFAULT_COMPONENTS_INC_FOLDERS
101
- ${MEMFAULT_SDK_ROOT} /ports/include /
102
- )
103
-
104
107
# Add a linker fragment to place FreeRTOS timers and task objects in the same area of dram0.bss
105
108
set (COMPONENT_ADD_LDFRAGMENTS "${MEMFAULT_ESP_IDF_PORT_COMMON} /memfault_esp_freertos.lf" )
106
109
endif ()
@@ -122,6 +125,10 @@ list(APPEND COMPONENT_REQUIRES
122
125
driver
123
126
)
124
127
128
+ if (CONFIG_MEMFAULT_LWIP_METRICS)
129
+ list (APPEND COMPONENT_REQUIRES lwip)
130
+ endif ()
131
+
125
132
if ($ENV{MEMFAULT_ESP_HTTP_CLIENT_ENABLE} )
126
133
list (APPEND COMPONENT_REQUIRES esp_http_client esp_https_ota)
127
134
endif ()
@@ -133,6 +140,7 @@ get_filename_component(this_directory_name ${this_directory_name} NAME)
133
140
mflt_esp32_component_get_target(this_component ${this_directory_name} )
134
141
135
142
component_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" )
136
144
137
145
# We will intercept the panic handlers enabled by CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH
138
146
# and run the Memfault Fault Handler instead.
0 commit comments