STMicroelectronics / STM32CubeU5

Full Firmware Package for the STM32U5 series: HAL+LL drivers, CMSIS, BSP, MW, plus a set of Projects (examples and demos) running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits).
Other
124 stars 67 forks source link

STM32CubeU5 - SBSFU application bug #44

Closed tdjastrzebski closed 8 months ago

tdjastrzebski commented 8 months ago

SBSFU app app probably has a bug. Unless tamper detection is disabled in boot_hal_cfg.h file (#define TFM_TAMPER_ENABLE NO_TAMPER), SBSFU_Boot application resets endlessly because FLOW_CONTROL_STEP does not pass evaluation (low_level_security.c file, line 1774).

/* Set active tampers */
if (HAL_RTCEx_SetActiveTampers(&RTCHandle, &sAllTamper) != HAL_OK)
{
    Error_Handler();
}
FLOW_CONTROL_STEP(uFlowProtectValue, FLOW_STEP_TAMP_ACT_EN, FLOW_CTRL_TAMP_ACT_EN); // <-- problem here

The above results in the following serial terminal output:

image
tdjastrzebski commented 8 months ago

BTW, it probably would be a good idea to add some detailed instruction on how to regress the board and remove protection. On this topic README.md states only: "refer to AN5347". This document describes several methods which may or may not work, depending on the circumstances. It takes some time and frustration to figure out the correct way.

tdjastrzebski commented 8 months ago

I learned that what I described was an expected behavior if CN3 pins 11 & 14 were disconnected. This is meant to demonstrate anti-tamper feature. However, some more descriptive message would be helpful.