Skip to content

Commit 8828e66

Browse files
committed
Merge branch 'task/idf-versions-cleanup' into 'main'
idf_version_compatibility: Remove code that was retained for idf versions < 5.1 See merge request app-frameworks/esp-insights!190
2 parents 985ace7 + ad70755 commit 8828e66

File tree

16 files changed

+50
-150
lines changed

16 files changed

+50
-150
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@ before_script:
139139
- done
140140
- echo Build Complete for $APP_BUILD
141141

142-
build_idf_v5.0:
143-
extends: .build_template
144-
image: espressif/idf:release-v5.0
145-
variables:
146-
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3"
147-
148142
build_idf_v5.1:
149143
extends: .build_template
150144
image: espressif/idf:release-v5.1

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 26-Aug-2025 (Stable Release)
2+
3+
- With this release we drop the beta tag in README
4+
- Bug Fixes:
5+
- WDT trigger on crash_dump cbor encoding
6+
- Incorrect data_send timer reset causing data send stop
7+
- Command Response: Critical crash fixed
8+
- Fixed log wrap linking errors on latest ESP-IDFs
9+
- Fixed latest changes in docs not built
10+
- Features/Support:
11+
- Dropped IDF 4.x support from main branch (For IDF 4.x support you may refer to idf_4_x_compat branch)
12+
- Configurable polling interval for Wi-Fi and heap metrics
13+
114
## 24-Jul-2024 (Command Response Framework and Components update)
215
- Added support for command response framework
316
- To demonstrate this, a simple reboot command has been added. Admins can trigger this command from the Insights dashboard (under Node's Settings tab) to reboot the device.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ESP Insights (Beta)
1+
# ESP Insights
22

33
ESP Insights is a remote diagnostics solution that allows users to remotely monitor the health of ESP devices in the field.
44

components/esp_diag_data_store/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# from IDF version 5.0, we need to explicitly specify requirements
2-
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
1+
# These components are available in ESP-IDF >= 5.1
32
set(req esp_event esp_hw_support)
4-
endif()
53

64
set(srcs "src/esp_diag_data_store.c")
75

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
version: "1.0.2"
1+
version: "1.1.0"
22
description: Simple APIs to use ESP Diagnostics data storage
33
url: https://github.com/espressif/esp-insights/tree/main/components/esp_diag_data_store
44
repository: https://github.com/espressif/esp-insights.git
55
issues: https://github.com/espressif/esp-insights/issues
66
dependencies:
77
idf:
8-
version: ">=4.1"
8+
version: ">=5.1"

components/esp_diag_data_store/src/rtc_store/rtc_store.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@
2222
#include "esp_idf_version.h"
2323
#endif
2424

25-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
26-
#include <esp_random.h> // esp_system.h does not provice esp_random() API from IDF v5.0
25+
#include <esp_random.h> // esp_system.h does not provide esp_random() API from IDF v5.0
2726
#include <esp_app_desc.h> // for `esp_app_get_elf_sha256` API
28-
#else
29-
#include <esp_ota_ops.h>
30-
#endif
3127

3228
#define TAG "RTC_STORE"
3329
#define INSIGHTS_NVS_NAMESPACE "storage"
@@ -505,16 +501,6 @@ static inline uint8_t to_int_digit(unsigned val)
505501
return (val <= '9') ? (val - '0') : (val - 'a' + 10);
506502
}
507503

508-
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
509-
static void hex_to_bytes(uint8_t *src, uint8_t *dst, int out_len)
510-
{
511-
for (int i = 0; i < out_len; i++) {
512-
uint8_t val0 = to_int_digit(src[2 * i]);
513-
uint8_t val1 = to_int_digit(src[2 * i + 1]);
514-
dst[i] = (val0 << 4) | (val1);
515-
}
516-
}
517-
#endif
518504

519505
static esp_err_t rtc_store_meta_hdr_init()
520506
{
@@ -558,13 +544,8 @@ static esp_err_t rtc_store_meta_hdr_init()
558544
s_priv_data.meta_hdr = &s_rtc_store.meta[s_rtc_store.meta_hdr_idx];
559545

560546
// populate meta header
561-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
562547
const uint8_t* src = esp_app_get_description()->app_elf_sha256;
563548
memcpy((uint8_t *)s_priv_data.meta_hdr->sha_sum, src, RTC_STORE_SHA_SIZE);
564-
#else
565-
esp_ota_get_app_elf_sha256(s_priv_data.sha_sum, sizeof(s_priv_data.sha_sum));
566-
hex_to_bytes((uint8_t *) s_priv_data.sha_sum, (uint8_t *) s_priv_data.meta_hdr->sha_sum, RTC_STORE_SHA_SIZE);
567-
#endif
568549

569550
s_priv_data.meta_hdr->gen_id = gen_id;
570551
s_priv_data.meta_hdr->boot_cnt = boot_cnt;

components/esp_diagnostics/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,8 @@ if(CONFIG_DIAG_ENABLE_VARIABLES)
1818
endif()
1919
endif()
2020

21-
set(priv_req freertos app_update rmaker_common)
22-
23-
# esp_hw_support component was introduced in v4.3
24-
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.2")
25-
list(APPEND priv_req esp_hw_support)
26-
endif()
27-
28-
# from IDF version 5.0, we need to explicitly specify requirements
29-
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
30-
list(APPEND priv_req esp_wifi esp_event)
31-
endif()
21+
set(priv_req freertos app_update rmaker_common
22+
esp_hw_support esp_wifi esp_event)
3223

3324
idf_component_register(SRCS "${srcs}"
3425
INCLUDE_DIRS "include"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
version: "1.2.3"
1+
version: "1.3.0"
22
description: Diagnostics component used in ESP Insights, which is a remote diagnostics solution to monitor the health of ESP devices in the field.
33
url: https://github.com/espressif/esp-insights/tree/main/components/esp_diagnostics
44
repository: https://github.com/espressif/esp-insights.git
55
issues: https://github.com/espressif/esp-insights/issues
66
dependencies:
77
idf:
8-
version: ">=4.1"
8+
version: ">=5.1"
99
espressif/rmaker_common:
10-
version: "~1.4.0"
10+
version: "~1.5.0"

components/esp_diagnostics/src/esp_diagnostics_heap_metrics.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ static void heap_timer_cb(TimerHandle_t handle)
116116
esp_rmaker_work_queue_add_task(heap_metrics_dump_cb, NULL);
117117
}
118118

119-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
120119
static void alloc_failed_hook(size_t size, uint32_t caps, const char *func)
121120
{
122121
esp_diag_heap_metrics_dump();
@@ -128,14 +127,12 @@ static void alloc_failed_hook(size_t size, uint32_t caps, const char *func)
128127

129128
ESP_DIAG_EVENT(METRICS_TAG, KEY_ALLOC_FAIL " size:0x%x func:%s", size, func);
130129
}
131-
#endif
132130

133131
esp_err_t esp_diag_heap_metrics_init(void)
134132
{
135133
if (s_priv_data.init) {
136134
return ESP_ERR_INVALID_STATE;
137135
}
138-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
139136
esp_err_t err = heap_caps_register_failed_alloc_callback(alloc_failed_hook);
140137
if (err != ESP_OK) {
141138
return err;
@@ -146,7 +143,6 @@ esp_err_t esp_diag_heap_metrics_init(void)
146143
#else
147144
esp_diag_metrics_add_unit(KEY_ALLOC_FAIL, METRICS_UNIT);
148145
#endif
149-
#endif
150146

151147
#ifdef CONFIG_ESP32_SPIRAM_SUPPORT
152148
esp_diag_metrics_register(METRICS_TAG, KEY_EXT_FREE, "External free heap", PATH_HEAP_EXTERNAL, ESP_DIAG_DATA_TYPE_UINT);
@@ -198,9 +194,7 @@ esp_err_t esp_diag_heap_metrics_deinit(void)
198194
ESP_LOGW(LOG_TAG, "Failed to delete heap metric timer");
199195
}
200196
#ifdef CONFIG_ESP_INSIGHTS_META_VERSION_10
201-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
202197
esp_diag_metrics_unregister(KEY_ALLOC_FAIL);
203-
#endif
204198
#ifdef CONFIG_ESP32_SPIRAM_SUPPORT
205199
esp_diag_metrics_unregister(KEY_EXT_FREE);
206200
esp_diag_metrics_unregister(KEY_EXT_LFB);
@@ -210,9 +204,7 @@ esp_err_t esp_diag_heap_metrics_deinit(void)
210204
esp_diag_metrics_unregister(KEY_LFB);
211205
esp_diag_metrics_unregister(KEY_MIN_FREE);
212206
#else
213-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
214207
esp_diag_metrics_unregister(METRICS_TAG, KEY_ALLOC_FAIL);
215-
#endif
216208
#ifdef CONFIG_ESP32_SPIRAM_SUPPORT
217209
esp_diag_metrics_unregister(METRICS_TAG, KEY_EXT_FREE);
218210
esp_diag_metrics_unregister(METRICS_TAG, KEY_EXT_LFB);

components/esp_diagnostics/src/esp_diagnostics_log_hook.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@
1313
#include <freertos/FreeRTOS.h>
1414
#include <freertos/task.h>
1515

16-
/* Onwards esp-idf v5.0 esp_cpu_process_stack_pc() is moved to
17-
* components/xtensa/include/esp_cpu_utils.h
18-
*/
19-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
20-
#if CONFIG_IDF_TARGET_ARCH_XTENSA
21-
#include "esp_cpu_utils.h"
22-
#else /* CONFIG_IDF_TARGET_ARCH_RISCV */
23-
#define esp_cpu_process_stack_pc(x) (x) // dummy definition to avoid compilation error
24-
#endif
25-
#else // For esp-idf version <= v4.4
26-
#include "soc/cpu.h"
16+
/* Available in ESP-IDF >= 5.1 */
17+
#if CONFIG_IDF_TARGET_ARCH_XTENSA
18+
#include "esp_cpu_utils.h"
19+
#else /* CONFIG_IDF_TARGET_ARCH_RISCV */
20+
#define esp_cpu_process_stack_pc(x) (x) // dummy definition to avoid compilation error
2721
#endif
2822

2923
#define IS_LOG_TYPE_ENABLED(type) (s_priv_data.init && (type & s_priv_data.enabled_log_type))
@@ -324,11 +318,7 @@ static esp_err_t diag_log_add(esp_diag_log_type_t type, uint32_t pc, const char
324318
log.msg_args_len = strlen((char *)log.msg_args);
325319
#endif
326320
va_end(ap);
327-
#if ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION_MINOR < 3
328-
task_name = pcTaskGetTaskName(NULL);
329-
#else
330321
task_name = pcTaskGetName(NULL);
331-
#endif
332322
if (task_name) {
333323
strlcpy(log.task_name, task_name, sizeof(log.task_name));
334324
}

0 commit comments

Comments
 (0)