In current, I am using the NUCLEO-H753ZI of STM32CubeExpansion_SBSFU_V2.7.0 demo project.
Hardfault error happens in SFU_SE_STACK_Clean api in case SFU_ISOLATE_SE_WITH_MPU is not used like "#undef SFU_ISOLATE_SE_WITH_MPU"
the value of sp is 0.
Please let me know how to resolve this issue.
static void SFU_SE_STACK_Clean(void)
{
uint32_t sp_base = SE_REGION_RAM_START;
uint32_t sp_top = SE_REGION_RAM_STACK_TOP;
uint32_t sp = __get_MSP();
TRACE("\r\n= [SBOOT-MWU] SFU_SE_STACK_Clean[0x%08x]",sp);
if ((sp > sp_base) && (sp <= sp_top))
{
while (sp_base < sp)
{
*(__IO uint32_t *)sp_base = 0U;
sp_base += 4U;
}
}
else
{
/* error trigger a reset */
HAL_NVIC_SystemReset();
}
}