mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
espcoredump: fix error reported for blank partition
This commit is contained in:
parent
ee7b443d28
commit
59c6afda95
@ -191,7 +191,15 @@ esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t *out_size)
|
||||
uint32_t *dw = (uint32_t *)core_data;
|
||||
*out_size = *dw;
|
||||
spi_flash_munmap(core_data_handle);
|
||||
|
||||
|
||||
if (*out_size == 0xFFFFFFFF) {
|
||||
ESP_LOGD(TAG, "Blank core dump partition!");
|
||||
return ESP_ERR_INVALID_SIZE;
|
||||
} else if ((*out_size < sizeof(uint32_t)) || (*out_size > core_part->size)) {
|
||||
ESP_LOGE(TAG, "Incorrect size of core dump image: %d", *out_size);
|
||||
return ESP_ERR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
// remap full core dump with CRC
|
||||
err = esp_partition_mmap(core_part, 0, *out_size,
|
||||
SPI_FLASH_MMAP_DATA, &core_data, &core_data_handle);
|
||||
|
Loading…
Reference in New Issue
Block a user