-
Notifications
You must be signed in to change notification settings - Fork 795
Open
Labels
area: zephyrAffects the Zephyr portAffects the Zephyr port
Description
There is a bug where flash_area_get_device_id
will return flash area partition id instead of device id when compiled on ARM arch.
This happens because code returns flash_area.fa_id, where it should fa_device_id
. The fa_device_id
member does not exist in Zephyr variant of Flash Area API defined flash_area type.
This device id is only used by flash_device_base
function, which is provided by system backend, to return offset where device FLASH to RAM mapping begins.
Current implementation of flash_device_base
:
mcuboot/boot/zephyr/flash_map_extended.c
Lines 43 to 52 in c6f5db2
int flash_device_base(uint8_t fd_id, uintptr_t *ret) | |
{ | |
if (fd_id != FLASH_DEVICE_ID) { | |
BOOT_LOG_ERR("invalid flash ID %d; expected %d", | |
fd_id, FLASH_DEVICE_ID); | |
return -EINVAL; | |
} | |
*ret = FLASH_DEVICE_BASE; | |
return 0; | |
} |
will fail to return for ID that is different than
FLASH_DEVICE_ID
, which will, for Zephyr, be hardcoded as 0 or 1, to identify internal and external memory respectively, and Flash Area device ID may be anything from 0 to 255.
Bug has been introduced with #1661
Metadata
Metadata
Assignees
Labels
area: zephyrAffects the Zephyr portAffects the Zephyr port