From 46651e7a6a5bcf113b70544e36a9586eed264be1 Mon Sep 17 00:00:00 2001 From: Aleksei Apaseev Date: Mon, 9 Jan 2023 18:06:40 +0800 Subject: [PATCH] espcoredump: fix incorrectly defined coredump chip version --- .../include_core_dump/esp_core_dump_types.h | 7 +++++-- .../port/riscv/esp_core_dump_port_impl.h | 5 ----- .../port/xtensa/esp_core_dump_port_impl.h | 11 ----------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/components/espcoredump/include_core_dump/esp_core_dump_types.h b/components/espcoredump/include_core_dump/esp_core_dump_types.h index 4ffade7618..94949467dc 100644 --- a/components/espcoredump/include_core_dump/esp_core_dump_types.h +++ b/components/espcoredump/include_core_dump/esp_core_dump_types.h @@ -50,8 +50,6 @@ extern "C" { /** * @brief The following macros defined below are used to create a version * numbering. This number is then used in the core dump header. - * - * @note COREDUMP_VERSION_CHIP is defined in ports header. */ #define COREDUMP_VERSION_MAKE(_maj_, _min_) ( \ (((COREDUMP_VERSION_CHIP)&0xFFFF) << 16) | \ @@ -83,6 +81,11 @@ extern "C" { #error "Coredump cache size must be a multiple of 16" #endif +/** + * @brief Chip ID associated to this implementation. + */ +#define COREDUMP_VERSION_CHIP CONFIG_IDF_FIRMWARE_CHIP_ID + typedef struct _core_dump_write_data_t { diff --git a/components/espcoredump/include_core_dump/port/riscv/esp_core_dump_port_impl.h b/components/espcoredump/include_core_dump/port/riscv/esp_core_dump_port_impl.h index bb142801e4..154c5a28e6 100644 --- a/components/espcoredump/include_core_dump/port/riscv/esp_core_dump_port_impl.h +++ b/components/espcoredump/include_core_dump/port/riscv/esp_core_dump_port_impl.h @@ -14,11 +14,6 @@ #include "esp_core_dump_types.h" #include "esp_app_format.h" -/** - * @brief Chip ID associated to this implementation. - */ -#define COREDUMP_VERSION_CHIP ESP_CHIP_ID_ESP32C3 - #ifdef __cplusplus extern "C" { #endif diff --git a/components/espcoredump/include_core_dump/port/xtensa/esp_core_dump_port_impl.h b/components/espcoredump/include_core_dump/port/xtensa/esp_core_dump_port_impl.h index f1b5c9ea7a..f89366475d 100644 --- a/components/espcoredump/include_core_dump/port/xtensa/esp_core_dump_port_impl.h +++ b/components/espcoredump/include_core_dump/port/xtensa/esp_core_dump_port_impl.h @@ -18,17 +18,6 @@ #include #include -/** - * @brief Chip ID associated to this implementation. - */ -#if CONFIG_IDF_TARGET_ESP32 - #define COREDUMP_VERSION_CHIP ESP_CHIP_ID_ESP32 -#elif CONFIG_IDF_TARGET_ESP32S2 - #define COREDUMP_VERSION_CHIP ESP_CHIP_ID_ESP32S2 -#elif CONFIG_IDF_TARGET_ESP32S3 - #define COREDUMP_VERSION_CHIP ESP_CHIP_ID_ESP32S3 -#endif - #ifdef __cplusplus extern "C" { #endif