Hello Cedric,
I tried the FWU tests on musca b1 platform and all of them passes without any failures.
Could you please provide more context on specific version/commit or platform where you encounter PSA_ERROR_STORAGE_FAILURE?
Best Regards, Maulik
________________________________ From: tf-m-request@lists.trustedfirmware.org tf-m-request@lists.trustedfirmware.org Sent: 07 June 2024 1:00 AM To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Subject: TF-M Digest, Vol 68, Issue 6
Send TF-M mailing list submissions to tf-m@lists.trustedfirmware.org
To subscribe or unsubscribe via email, send a message with subject or body 'help' to tf-m-request@lists.trustedfirmware.org
You can reach the person managing the list at tf-m-owner@lists.trustedfirmware.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of TF-M digest..."
Today's Topics:
1. Firmware Update: Storage Failure While Rejecting a Staged Image (cedric.klikpo@scalinx.com)
----------------------------------------------------------------------
Message: 1 Date: Thu, 06 Jun 2024 13:00:29 -0000 From: cedric.klikpo@scalinx.com Subject: [TF-M] Firmware Update: Storage Failure While Rejecting a Staged Image To: tf-m@lists.trustedfirmware.org Message-ID: 171767882935.438215.6657950002748011855@lists.trustedfirmware.org Content-Type: text/plain; charset="utf-8"
Hi,
I encounter a storage failure when trying to reject a staged image. I get this error by executing `tfm_fwu_test_common_001` in `fwu_tests_common.c`. The error occurs when the `erase_boot_magic` function attempts to erase the magic number in the image trailer by writing erase into it.
The reason I am writing this post is to ask:
1. If the `erase_boot_magic` failure is a known bug in the firmware update, is a fix planned or existing? 2. Why doesn't the `erase_boot_magic` function erase the sector where the magic number is located in the image trailer, considering we erasing in a flash?
Thanks!
Best regards, Cedric
------------------------------
Subject: Digest Footer
TF-M mailing list -- tf-m@lists.trustedfirmware.org To unsubscribe send an email to tf-m-leave@lists.trustedfirmware.org
------------------------------
End of TF-M Digest, Vol 68, Issue 6 ***********************************
Hi Maulik,
Thanks for taking the time to investigate my issue.
Here are more details about the setup and how to reproduce the error.
**Configuration:** - TFM version 1.8.0 on commit *35ac80c85 (HEAD, tag: TF-Mv1.8.0, origin/release/1.8.x). - We use a custom integration of TFM for target AN552 on a virtual platform.
**Build options:** - FWU is enabled, and the MOVE_USING_SWAP option is used. - TEST_NS_FWU is enabled.
**Procedure to reproduce the error:** 1. Start the execution of test case `tfm_fwu_test_common_001` in the file `fwu_tests_common.c`. 2. Run until the secondary slot is successfully put into the STAGED state (line 442). - At this step, the MAGIC value in the image trailer should have been successfully set by the call to `psa_fwu_install()`. 3. Call `psa_fwu_reject(PSA_ERROR_GENERIC_ERROR)` to reject the STAGED image. 4. The function `psa_fwu_reject()` generates the following call sequence: - `tfm_fwu_reject()` -> `fwu_bootloader_reject_staged_image()` (call at line 372 in `tfm_fwu_req_mng.c`). 5. The function `fwu_bootloader_reject_staged_image()` in fin `tfm_mcu_boot_fwu.c` generates the following call sequence: - `erase_boot_magic()` -> `flash_area_write(fap, pad_off, &magic[0], BOOT_MAGIC_ALIGN_SIZE)`. 6. The error occurs in the function `flash_area_write()` in the file `flash_map.c`. - My analysis is that the BOOT_MAGIC was not erased in flash prior to this attempt to write. As a result, the flash driver returns a Storage Failure.
Best regards, Cedric
tf-m@lists.trustedfirmware.org