Skip to content

[doc] Update PORTING.md with the required flash_area_get_sector() function footprint. #2394

@Nabav

Description

@Nabav

The mcuboot/boot/bootutil/src/bootutil_misc.c uses the flash_area_get_sector() function from flash map backend porting at flash_map_backend/flash_map_backend.h. Therefore the porting attempt should also implement and expose this function. However, this is missing in the porting guide.

/* Retrieve the flash sector withing given flash area, at a given offset.
 *
 * @param fa        flash area where the sector is taken from.
 * @param off       offset within flash area.
 * @param sector    structure of sector information.
 * Returns 0 on success, -ERANGE if @p off is beyond flash area size,
 *         other negative errno code on failure.
 */
int flash_area_get_sector(const struct flash_area *fa,
                          off_t off,
                          struct flash_sector *sector);

It's worth mentioning that the offset specified by off parameter and the resulting offset in sector->fs_off are both with respect to the origin of the given flash area not the whole flash device, if I have understood it correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docsAffects the documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions