Skip to main content
onio
Associate III
Aug 8, 2020 12:52 AM UTC
Solved

SBSFU update with I2C instead of using Ymodem protocol

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.

This topic has been closed for replies.
Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
Sep 23, 2020 10:29 AM UTC

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

2 replies

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
Sep 23, 2020 10:29 AM UTC

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
onioAuthor
Associate III
Sep 23, 2020 11:46 AM UTC

Hi Jocelyn,

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

Regards

onio