2025-07-11 1:18 AM - last edited on 2025-07-11 2:57 AM by mƎALLEm
I’m using NUCLEO STM32H753ZI.
I use ST ID: STM32cudeIDE
I have HardFault_Handler when call vTaskStart_Scheduler() using FreeRTOS
Could you please let me know how to resolve this issue?
Below is the sample code
int main(void)
{
(void) HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Enable the CPU Cache */
CPU_CACHE_Enable();
BaseType_t xReturned;
TaskHandle_t xHandle = NULL;
/* Create tasks /
xReturned = xTaskCreate(
Task_Code,
“SB”,
configMINIMAL_STACK_SIZE,
(void) NULL,
tskIDLE_PRIORITY+2U,
&xHandle
);
if( xReturned == pdPASS )
{
vTaskStartScheduler();
}
else
{
}
while(1);
Solved! Go to Solution.
2025-07-17 12:19 AM - edited 2025-07-17 12:22 AM
The most obvious way: modify slightly your FreeRTOS so that it triggers some other unused interrupt vector instead of SVC to call vPortSVCHandler and start the 1st task. This will remove conflict but I'm not sure that SBSFU will do what you need in combination with FreeRTOS.
2025-07-18 12:04 AM
Hi.
Could you please let me know how to resolve this issue?
Hard Fault happens in below code
2025-07-18 1:21 AM
Ah so now the fault occurs in a different place? please use the CubeIDE Fault analyzer to get more info on the reason of the fault.
Hopefully SBSFU experts can look at this thread and clarify how SBSFU can coexist with FreeRTOS.
2025-07-19 4:42 AM
Hi.
What should I do when I change like below?
#define SFU_ISOLATE_SE_WITH_MPU -> #undef SFU_ISOLATE_SE_WITH_MPU
Hardfault happens when I change like above.