[components][fal]Log warning for block partition exceeding flash length
This commit is contained in:
parent
4e8b8290ab
commit
ca4645000a
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
* Copyright (c) 2006-2024 RT-Thread Development Team
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
|
@ -54,6 +54,14 @@ int fal_flash_init(void)
|
||||||
size_t blk_len = blk->count * blk->size;
|
size_t blk_len = blk->count * blk->size;
|
||||||
if (blk->count == 0 || blk->size == 0)
|
if (blk->count == 0 || blk->size == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if(offset > device_table[i]->len)
|
||||||
|
{
|
||||||
|
log_i("Flash device %*.*s: add block failed, offset %d > len %d.",
|
||||||
|
FAL_DEV_NAME_MAX, FAL_DEV_NAME_MAX, device_table[i]->name, device_table[i]->addr, offset, device_table[i]->len);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
log_d(" blk%2d | addr: 0x%08lx | len: 0x%08x | blk_size: 0x%08x |initialized finish.",
|
log_d(" blk%2d | addr: 0x%08lx | len: 0x%08x | blk_size: 0x%08x |initialized finish.",
|
||||||
j, device_table[i]->addr + offset, blk_len, blk->size);
|
j, device_table[i]->addr + offset, blk_len, blk->size);
|
||||||
offset += blk_len;
|
offset += blk_len;
|
||||||
|
|
Loading…
Reference in New Issue