Hi Andrew,

 

I am thinking of two paths for the update client application: one through MCUBoot and another direct to the FWU interface.  MCUBoot path is for legacy application compatibility purpose.  Longer term, I am wondering if MCUBoot is needed. 

 

In embedded there is always a challenge to optimize the code size as space in storage is limited and any optimization to remove redundancies will help.

 

Update client application

           |

          |  Function call

           V                V

    MCUBoot user API        |

      Shim layer            |

          |                 |

          |  Function call  |

          V                 |

        FWU API ß----------|

          |

           |  TF-M psa_call() etc.

          V

     FWU Partition

           |

           |  Function call

           V

    MCUBoot user API

     MCUBoot engine

 

 

MCUBoot image size is around 60K and

 

thanks

Suresh Marisetty

Infineon Semiconductor Corporation

 

From: Andrew Thoelke <Andrew.Thoelke@arm.com>
Sent: Tuesday, May 25, 2021 1:39 AM
To: Marisetty Suresh (CYSC CSS ICW SW SSE) <Suresh.Marisetty@infineon.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: RE: Firmware update API - MCUboot update

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.

 

Hi Suresh,

 

> I am of the belief that MCUboot will be a very thin shim layer over the FWU API to provide the compatibility interface to legacy software and most of the work that was done earlier in MCUboot is pushed down into the FWU partition.

 

Are you suggesting that the software stack might look like this:

 

Update client application

           |

          |  Function call

           V

    MCUBoot user API

      Shim layer

          |

          |  Function call

          V

        FWU API

          |

           |  TF-M psa_call() etc.

          V

     FWU Partition

           |

           |  Function call

           V

    MCUBoot user API

     MCUBoot engine

 

 

This looks like it has one more layer than it needs, as either:

  1. The Update client application could Talk directly to the FWU API, or
  2. The first MCUBoot user API could interact with an MCUBoot update partition (RoT Service), without having to tunnel the MCUBoot API over the FWU API. The latter might not be straightforward – I am not sure that anyone has reviewed the two APIs for this purpose.

 

Are you only considering this software stack for a system where touching the update client application source code is not possible (needed for option #1 above)? – and you also cannot introduce a custom MCUBoot RoT Service partition (option #2 above) so you want to reuse TF-M’s existing FWU API and partition?

 

Regards,

Andrew

 

From: TF-M <tf-m-bounces@lists.trustedfirmware.org> On Behalf Of Suresh Marisetty via TF-M
Sent: 25 May 2021 02:37
To: Sherry Zhang <Sherry.Zhang2@arm.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: Re: [TF-M] Firmware update API - MCUboot update

 

Hi Sherry,

 

Thanks for the info.  Wondering if there is some documentation or powerpoint explaining how the MCUBoot is changed to accommodate the FWU API.

 

Details that would help:

  1. How the MCUboot works without the FWU API - natively
  2. How the MCUBoot needs to be modified to leverage from FWU API
  3. What components are retained in MCUBoot ex: image format, signing, metadata,  tools

 

I am of the belief that MCUboot will be a very thin shim layer over the FWU API to provide the compatibility interface to legacy software and most of the work that was done earlier in MCUboot is pushed down into the FWU partition.

 

The other way to look at it is: If somebody wants to replace MCUboot with a simple BL to integrate it tightly into TFM, what would that look like?

 

thanks

Suresh Marisetty

Infineon Semiconductor Corporation

 

From: Sherry Zhang <Sherry.Zhang2@arm.com>
Sent: Thursday, May 13, 2021 7:51 PM
To: Marisetty Suresh (CYSC CSS ICW SW SSE) <Suresh.Marisetty@infineon.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: RE: Firmware update API - MCUboot update

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.

 

Hi Suresh,

 

The MCUboot update functionality is about validating the existing images on the device which is different from that of the firmware update service which follows mostly with the PSA Firmware Update API spec.

 

We designed a shim layer between the firmware update partition and bootloader. A specific bootloader can be ported into the firmware update partition via that shim layer. Please refer to the firmware update service document. In the MCUboot based shim layer implementation, it calls some user/public APIs provided by MCUboot to achieve its functionality. For example, the Firmware Update API spec describes that psa_fwu_install() API should validate the image or defer the validation to a system reboot. In the MCUboot shim layer implementation, it calls the boot_write_magic() API to mark the image as a candidate image for MCUboot and defers the image validation to a system reboot. Please refer to this link.

 

Can you please provide more specific suggestion or questions?

 

Regards,

Sherry Zhang

 

 

From: Suresh.Marisetty@infineon.com <Suresh.Marisetty@infineon.com>
Sent: Thursday, May 13, 2021 11:40 PM
To: Sherry Zhang <Sherry.Zhang2@arm.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: RE: Firmware update API - MCUboot update

 

Hi Sherry,

 

Please take a closer look at the MCUboot and TFM might want to have a clear position/distinction between these two and how to transition from MCUboot update to this mechanism or it could be that they complement each other.

 

thanks

Suresh Marisetty

Infineon Semiconductor Corporation

 

From: Sherry Zhang <Sherry.Zhang2@arm.com>
Sent: Wednesday, May 12, 2021 8:55 PM
To: Marisetty Suresh (CYSC CSS ICW SW SSE) <Suresh.Marisetty@infineon.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: RE: Firmware update API - MCUboot update

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.

 

Hi Suresh,

 

The firmware update service APIs are for updating the firmware. The functionalities of these APIs includes loading the image into its target device(flash), verifying the image and installing it and so on.

The user can call the these APIs to achieve update images. For example, in the integration of TF-M and the FreeRTOS OTA, the OTA agent calls the firmware update service APIs to achieve an image update remotely.

 

I guess that the “MCUboot update services” you mentioned refers to the functionality of MCUboot which acts as a bootloader. As a bootloader, it can verify the image which already exists on the device and chose the right image to start up. But it cannot, for example, load the image into device or control the image update process.

 

The firmware update partition calls some user APIs provided by MCUboot to cooperate with it. You can refer to https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/docs/technical_references/tfm_fwu_service.rst#n75.

 

Regards,

Sherry Zhang

 

 

From: TF-M <tf-m-bounces@lists.trustedfirmware.org> On Behalf Of Suresh Marisetty via TF-M
Sent: Thursday, May 13, 2021 11:09 AM
To: tf-m@lists.trustedfirmware.org
Subject: [TF-M] Firmware update API - MCUboot update

 

Hi,

 

I would like to see if there is any guidance/documentation on how to coordinate between the firmware update services API with that of MCUboot.

 

Does the use of this API make the MCUboot update services redundant?

 

thanks

Suresh Marisetty

Infineon Semiconductor Corporation

Lead Member of Technical Staff

CYSC CSS ICW SW SSE

Mobile: +5103863997
Suresh.Marisetty@infineon.com