Skip to main content
ABous.1
Associate II
January 31, 2020
Question

FreeRTOS memory issue

  • January 31, 2020
  • 1 reply
  • 702 views

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

This topic has been closed for replies.

1 reply

OlivierK
Technical Moderator
February 4, 2020

​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

In order 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.