Эх сурвалжийг харах

coredump: add partition encrypted flag check for flash encryption case

Ref: https://esp32.com/viewtopic.php?f=13&t=30752
Mahavir Jain 3 жил өмнө
parent
commit
12b977dba6

+ 4 - 0
components/espcoredump/src/core_dump_flash.c

@@ -83,6 +83,10 @@ void esp_core_dump_flash_init(void)
     s_core_flash_config.partition.size       = core_part->size;
     s_core_flash_config.partition.encrypted  = core_part->encrypted;
     s_core_flash_config.partition_config_crc = esp_core_dump_calc_flash_config_crc();
+
+    if (esp_flash_encryption_enabled() && !core_part->encrypted) {
+        ESP_COREDUMP_LOGW("core dump partition is plain text, consider enabling `encrypted` flag");
+    }
 }
 
 static esp_err_t esp_core_dump_flash_write_data(core_dump_write_data_t* priv, uint8_t* data, uint32_t data_size)

+ 5 - 0
docs/en/api-guides/core_dump.rst

@@ -84,6 +84,11 @@ as it is shown below::
    factory,  app,  factory, 0x10000, 1M
    coredump, data, coredump,,        64K
 
+.. important::
+    If :doc:`Flash Encryption <../security/flash-encryption>` is enabled on the device then please add `encrypted` flag to the coredump partition::
+
+        coredump, data, coredump,,       64K, encrypted
+
 There are no special requirements for partition name. It can be chosen according to the user application needs, but partition type should be 'data' and
 sub-type should be 'coredump'. Also when choosing partition size note that core dump data structure introduces constant overhead of 20 bytes and per-task overhead of 12 bytes.
 This overhead does not include size of TCB and stack for every task. So partition size should be at least 20 + max tasks number x (12 + TCB size + max task stack size) bytes.