cancel
Showing results for 
Search instead for 
Did you mean: 

SBSFU update with I2C instead of using Ymodem protocol

onio
Senior

I have been able to build the STM32H7B3I_DISCO_2_Images_Loader from STM32CubeExpansion_SBSFU_V2.3.0 project targeting STM32H7B3I_DISCO board. I have also been able to build the example file and use the Ymodem protocol for sending the UserApp.sfb file to the the board.

Instead of the Ymodem protocol I am trying to use an I2C master device for sending the UserApp.sfb file. Looking at the example there is a lots of dependencies on the Ymodem protocol.

Is there a way I can determine the file size from the sfb so I can use that in the I2C master for determining the number of bytes that needs to be sent to the STM32H7B3 board.

I am looking for a break down of the sfb data structure, with the hope that I can get information such as the file size etc.

1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello,

yes, you have the firmware size information located in the header at beginning of the .sfb file.

The structure of the header is described in se_def_metadata.h in SECoreBin project.

Here is what you need:

#elif (SECBOOT_CRYPTO_SCHEME == SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256)

typedef struct

{

 uint32_t SFUMagic;        /*!< SFU Magic 'SFUM'*/

 uint16_t ProtocolVersion;    /*!< SFU Protocol version*/

 uint16_t FwVersion;       /*!< Firmware version*/

 uint32_t FwSize;         /*!< Firmware size (bytes)*/ 

Anyway, you need to adapt the loader.c file and replace Ymodem parts by your own.

Best regards

Jocelyn

View solution in original post

2 REPLIES 2
Jocelyn RICARD
ST Employee

Hello,

yes, you have the firmware size information located in the header at beginning of the .sfb file.

The structure of the header is described in se_def_metadata.h in SECoreBin project.

Here is what you need:

#elif (SECBOOT_CRYPTO_SCHEME == SECBOOT_ECCDSA_WITH_AES128_CBC_SHA256)

typedef struct

{

 uint32_t SFUMagic;        /*!< SFU Magic 'SFUM'*/

 uint16_t ProtocolVersion;    /*!< SFU Protocol version*/

 uint16_t FwVersion;       /*!< Firmware version*/

 uint32_t FwSize;         /*!< Firmware size (bytes)*/ 

Anyway, you need to adapt the loader.c file and replace Ymodem parts by your own.

Best regards

Jocelyn

onio
Senior

Hi Jocelyn,

Thanks for your response. I have already ported the YModem to I2C and working fine. Many thanks for reply

Regards

onio