Skip to main content
Sreedhar
Associate II
October 13, 2023
Question

Issues generating Firmware image with FWIMG_STATE_NEW - SBSFU postbuild.sh

  • October 13, 2023
  • 2 replies
  • 1593 views

Hello all, 

I am using the SBSFU v2.6.2 on STM32H753 - (2 slots based) for a few months now, and am trying to enable the Firmware Rollback feature right now. During this attempt, I had enabled ENABLE_IMAGE_STATE_HANDLING as required in SE, SBSFU and UserApp projects and then built all of them. I see in the SFU header region of the User App binary that gets generated finally and find that the parameter FwImageState is filled with FWIMG_STATE_VALID whereas I expected FWIMG_STATE_NEW. (Please refer screenshot below)

Due to this, I am failing to update to Self-Test state at SFU_IMG_UpdateImageState(), while launching from Active slot, as well as during the Firmware installation process at FirmwareToInstall(), as it fails to recognize the new image. 

At SFU_IMG_UpdateImageState()

Sreedhar_0-1697199249293.png

At FirmwareToInstall()

Sreedhar_1-1697200835532.png

I use the following command in the postbuild.sh that generates the header:

command=$cmd" "$prepareimage" header -m "$magic" -k "$ecckey" -p 1 -r 44 -v "$version" -f "$bin" -t "$sign" -o "$offset" "$headerbin

I wanted to know how to generate a firmware image with FWIMG_STATE_NEW state in the SFU header. 

Also, how is this usually done professionally?

 

This topic has been closed for replies.

2 replies

ST Employee
October 31, 2023

Hello @Sreedhar ,

I'began the investigation on this issue and i'm able to reproduce the same the same header configuration. Can you give more details on the SBSFU configuration related to the encryption method and the files on which you have  enabled ENABLE_IMAGE_STATE_HANDLING .

regards,

Hichem 

 

Bubbles
ST Employee
November 28, 2023

screenshotscreenshot

I got this, which is not what I expected, but it's not breaking the installation.
You should go back to the default project as delivered in the ST X-Cube package and try from there, doing small steps.

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.