Skip to content

ModusToolbox: Error on boot_set_pending due to flash alignment problem #3

Open
@ncmiller

Description

@ncmiller
  • SDK Version: v0.1.0
  • Target OS/Platform: Modus Toolbox
  • Hardware Target: CY8CPROTO-062-4343W
  • Host OS: Ubuntu 22.04.1 LTS

Current Behavior

When running the Golioth example project and testing firmware update, there is an error reported after the image is downloaded:

boot_set_pending failed, error -1

From https://github.com/golioth/golioth-firmware-sdk/blob/main/port/modus_toolbox/fw_update_mcuboot.c#L105.

Digging into MCUboot (v1.8.1-cypress tag), it appears that it's failing to write the image trailer due to a flash alignment problem:

https://github.com/mcu-tools/mcuboot/blob/v1.8.1-cypress/boot/bootutil/src/bootutil_public.c#L348-L355

From what I can tell, this is the same issue as reported here:

mcu-tools/mcuboot#713

The firmware update proceeds normally, despite the error using strategy MCUBOOT_OVERWRITE_ONLY. However, it prevents other desirable strategies such as MCUBOOT_SWAP_USING_SCRATCH from working since the image trailers cannot be written.

Expected Behavior

The error should not happen. MCUboot needs to support the 512-byte alignment restriction of the PSOC6 board so that image trailers can be written.

Steps to Reproduce

Attempt a device firmware update with Golioth, and you will see boot_set_pending failed, error -1 after downloading the image.

Logs, Additional Data

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions