From a877a070cb50c87b90aaff8c9bec10625411a6ff Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Sat, 5 Jul 2025 23:02:42 +0200 Subject: [PATCH] change(coredump): return ESP_ERR_NOT_FOUND for blank partition Closes https://github.com/espressif/esp-idf/issues/15153 --- components/espcoredump/src/core_dump_flash.c | 2 +- docs/en/migration-guides/release-6.x/6.0/system.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/espcoredump/src/core_dump_flash.c b/components/espcoredump/src/core_dump_flash.c index e72a23b468..03636fe53b 100644 --- a/components/espcoredump/src/core_dump_flash.c +++ b/components/espcoredump/src/core_dump_flash.c @@ -476,7 +476,7 @@ esp_err_t esp_core_dump_partition_and_size_get(const esp_partition_t **partition /* Verify that the size read from the flash is not corrupted. */ if (core_size == 0xFFFFFFFF) { ESP_COREDUMP_LOGD("Blank core dump partition!"); - return ESP_ERR_INVALID_SIZE; + return ESP_ERR_NOT_FOUND; } if ((core_size < sizeof(uint32_t)) || (core_size > core_part->size)) { diff --git a/docs/en/migration-guides/release-6.x/6.0/system.rst b/docs/en/migration-guides/release-6.x/6.0/system.rst index bb2a2b49f1..e766085092 100644 --- a/docs/en/migration-guides/release-6.x/6.0/system.rst +++ b/docs/en/migration-guides/release-6.x/6.0/system.rst @@ -100,3 +100,5 @@ Core Dump Binary data format has been dropped. `CONFIG_ESP_COREDUMP_DATA_FORMAT_BIN` is no longer supported. Elf is now the default data format. CRC data integrity check has been dropped. `ESP_COREDUMP_CHECKSUM_CRC32` is no longer supported. SHA256 is now the default checksum algorithm. + +The function :cpp:func:`esp_core_dump_partition_and_size_get()` now returns `ESP_ERR_NOT_FOUND` for blank (erased) partitions instead of `ESP_ERR_INVALID_SIZE`.