cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS memory issue

ABous.1
Associate II

Hello,

I use STM32MP157C-DK2 board with freeRTOS.

I run my bord in engeneering mode with default freeRTOS parameters provided by cubeMX

I create tree threads in my application but the last does not start.

May be it is a memory space problem. So I try to increase the parameters TOTAL_HEAP_SIZE but when I run again no threads works.

What parameters could I change to have more free space ?

Best regards,

Arnaud Bousquet

1 REPLY 1
OlivierK
ST Employee

​Hello,

Which CMSIS version are you using with FreeRTOS? V1 or V2? Let's assume you use V2.

When a Thread is created, its properties are declared in osThreadAttributes (osThreadAttr_t), if some properties like the stack or priority is not defined it defaults to standard settings defined in FreeRTOSConfig.h. For instance if the stack is not explicitly declared for that Thread it defaults to the value defined in "configMINIMAL_STACK_SIZE" in the file FreeRTOSConfig.h.

So either you increase the default value or you explicitly declare it in the tread attributes.

const osThreadAttr_t LED_Thread1_attr = {

.stack_size = 256

};

THREAD1Handle = osThreadNew(LED_Thread1, NULL, &LED_Thread1_attr);

Best Regards,

Olivier