diff --git a/components/fal/src/fal_partition.c b/components/fal/src/fal_partition.c index 92ae074303..a26a018a28 100644 --- a/components/fal/src/fal_partition.c +++ b/components/fal/src/fal_partition.c @@ -321,7 +321,8 @@ _exit: */ const struct fal_partition *fal_partition_find(const char *name) { - assert(init_ok); + if (!init_ok) + return NULL; size_t i; @@ -353,9 +354,11 @@ static const struct fal_flash_dev *flash_device_find_by_part(const struct fal_pa */ const struct fal_partition *fal_get_partition_table(size_t *len) { - assert(init_ok); assert(len); + if (!init_ok) + return NULL; + *len = partition_table_len; return partition_table; @@ -370,9 +373,14 @@ const struct fal_partition *fal_get_partition_table(size_t *len) */ void fal_set_partition_table_temp(struct fal_partition *table, size_t len) { - assert(init_ok); assert(table); + if (!init_ok) + { + log_e("FAL NOT initialized"); + return; + } + check_and_update_part_cache(table, len); partition_table_len = len; @@ -400,7 +408,7 @@ int fal_partition_read(const struct fal_partition *part, uint32_t addr, uint8_t if (addr + size > part->len) { - log_e("Partition read error! Partition address out of bound."); + log_e("Partition read error! Partition(%s) address(0x%08x) out of bound(0x%08x).", part->name, addr + size, part->len); return -1; }