cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault_Handler when call prvPortStartFirstTask() in STM32H753

EddiePark
Visitor

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?

hardfault.jpg

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);
3 REPLIES 3
Saket_Om
ST Employee

Hello @EddiePark 

Could you increase your heap and stack size and try again?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

Hi,

I increase the heap and stack size. but the result is same.

Thanks

Hello @EddiePark 

Please refer to the article below to debug hardfault: 

How to debug a HardFault on an Arm® Cortex®-M STM3... - STMicroelectronics Community

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om