coredump: add partition encrypted flag check for flash encryption case

Ref: https://esp32.com/viewtopic.php?f=13&t=30752
This commit is contained in:
Mahavir Jain
2022-12-02 17:15:01 +05:30
parent 29430e464d
commit 12b977dba6
2 changed files with 9 additions and 0 deletions

View File

@@ -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.size = core_part->size;
s_core_flash_config.partition.encrypted = core_part->encrypted; s_core_flash_config.partition.encrypted = core_part->encrypted;
s_core_flash_config.partition_config_crc = esp_core_dump_calc_flash_config_crc(); 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) static esp_err_t esp_core_dump_flash_write_data(core_dump_write_data_t* priv, uint8_t* data, uint32_t data_size)

View File

@@ -84,6 +84,11 @@ as it is shown below::
factory, app, factory, 0x10000, 1M factory, app, factory, 0x10000, 1M
coredump, data, coredump,, 64K 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 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. 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. 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.