cancel
Showing results for 
Search instead for 
Did you mean: 

SBSFU on STM32H753-Eval board unable to transfer application firmware

Vinay_Shirol
Associate II

Hello.

I'm having trouble transfer the UserApp to SBSFU. Here's the description of the issue.

I am working on SBSFU on STM32H753-Eval, So i altered the given sample for my UART to map to ST-LINK VCP. I am able to see logs post this changes. Later I Dissabled all security stuffs with below macro and fully erase the board (by setting RDP level 1->0 ).

I'm using the 2-Image example code, All security feature were disabled by

#define SECBOOT_DISABLE_SECURITY_IPS

 in app_sfu.h. I loaded SBSFU.elf onto the board and transferred the UserApp.sfb via YMODEM. However the program went into a infinite reset loop. It is rebooting every time i send UserApp.sfb.  

I tried Increasing the Download Timeout from 3000 to 10000 from this macro, same issue 

 
/* Teraterm YMODEM */
/* #define SFU_COM_YMODEM_DOWNLOAD_TIMEOUT        ((uint32_t)3000U) */
#define SFU_COM_YMODEM_DOWNLOAD_TIMEOUT        ((uint32_t)10000U) /*
 

IFile_Transfer.pngLOOP.Ping.png

Is there any specific step i need to follow ?... kindly guide me here.
 

 

 

 

3 REPLIES 3
Onizuka09
ST Employee

Hello @Vinay_Shirol  

Sorry for the late response. 

I found the root cause of the issue, and it was not related to the YMODEM timeout.

In my case, the 2-Images_SBSFU project had originally been based on a setup running on NUCLEO-H753, and I ported it to the STM32H753I-EVAL2 board. The issue came from a BSP incompatibility, especially in the user button handling.

I made the following changes for the project to work:

  • enabled:
#define SECBOOT_DISABLE_SECURITY_IPS​
  • updated the clock configuration
  • changed the UART from USART3 to USART1, including the UART pins connected to the STLINK
  • removed the original NUCLEO BSP
  • implemented my own LED and button functions for the target board

The issue originates in the SBSFU FSM 

// SBSFU Project, SBSFU/APP/SFU_boot.c
static void SFU_BOOT_SM_CheckNewFwToDownload(void)
{
  SFU_ErrorStatus  e_ret_status = SFU_ERROR;
  // ... 
  if (initialDeviceStatusCheck == 1U)
  {
    TRACE("\r\n= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD");
    if (0U != BUTTON_PUSHED() // <-- This is the issue
    {
      /* Download requested */
      e_ret_status = SFU_SUCCESS;
    }
    else
    {
      e_ret_status = SFU_ERROR;
    }
  }
  else
  {
    e_ret_status = SFU_SUCCESS;
  }
 SFU_SET_SM_IF_CURR_STATE(e_ret_status, SFU_STATE_DOWNLOAD_NEW_USER_FW, SFU_STATE_VERIFY_USER_FW_STATUS);
}

The issue was that  

BUTTON_PUSHED()

was relying on the original BSP button API from the NUCLEO board. 

Since this BSP does not match the STM32H753I-EVAL2 hardware, the button state was interpreted incorrectly during boot.

As a result, SBSFU always considered the button as pressed and entered: 

SFU_STATE_DOWNLOAD_NEW_USER_FW

instead of continuing the normal boot flow and jumping to the installed user application.


To solve the problem, I removed the old BSP dependency:

#include "stm32h7xx_nucleo_144.h"

and created my own board-specific implementation for:

  • LED initialization and control
  • button initialization
  • button state reading

i have added the board-specific implementation under 2_Images_SBSFU\SBSFU\Target\sfu_low_level.c and  2_Images_SBSFU\SBSFU\Target\sfu_low_level.h . 


In my case, I used the Wakeup button as the user button (PA0) .

Onizuka09_0-1777038108766.png

 

You can find the full project attached below. 

Vinay_Shirol
Associate II

Hi @Onizuka09 ,

                               Thanks for reply. I had already figured it out that this issue is related to Button handling only. And i did the same changes and it is working. 

 

Hello @Vinay_Shirol 
I’m glad you figured it out.
Could you please mark the question as solved?
Thank you.