How Many task can run concurrently

mukeshtalks wrote on Thursday, September 03, 2015:

Hi,
I am Using STM32F303 (ARM Cortex M4F), IAR EWARM Version 7.40.
I have created 5 tasks in my project with same peiority and i have seen only three task run concurrently. I have printing debug messages from all five tasks but getting only from three. I tried task delay also after this also entering into three task only. Can you please help me out how any task are supported by FreeRTOS

Regards,
Mukesh

rtel wrote on Thursday, September 03, 2015:

FreeRTOS does not impose a limit, so the only limit is the amount of RAM your system has.

Each time you create a task RAM is allocated for the stack used by the task. The RAM comes from the FreeRTOS heap, the size of which can be adjusted. You can know immediately that a task was not created by checking the return value of xTaskCreate(), or defining a malloc failed hook.

Be careful how you print from tasks - is your print function thread safe? How much stack is it using? Is it using semi-hosting (which is genrally going to mess up timing) or printing to a UART (or other IO device)?

Regards.

mukeshtalks wrote on Thursday, September 03, 2015:

Hello RTE, Thanks for reply. Please find the details of the task created bellow:

/* Create one of the two tasks. /
xTaskCreate( vTask1, “Task 1”, 1000, NULL, 2, NULL );
/
Create the other task in exactly the same way. /
xTaskCreate( vTask2, “Task 2”, 1000, NULL, 2, NULL );
// /
Create the other task in exactly the same way. */
xTaskCreate( vTask3, “Task 3”, 1000, NULL, 2, NULL );
xTaskCreate( vSerialCommTask, “Serial Comm Task”, 1000, NULL, 2, NULL );
xTaskCreate( vBatChargeTask, “Bat_Crg_Task”, 1000, NULL, 2, NULL );

heap_4 scheme is used. FreeRTOSConfig.h is attached.
I am Using Semi-Hosting not using the USART.
is there any link which help me to understand how to use malloc failed hook (Any Example).
I am new to FreeRTOS usage so not having Much idea. Please Help Me to find out where i am wrong.

rtel wrote on Thursday, September 03, 2015:

In my previous post I noted you may be running out of FreeRTOS heap,
suggested ways of determining if this was indeed the case, and provided
links to the relevant web pages. Have you read my post, followed the
suggestions, and read the linked pages? If not, then at this stage, I
can only refer you back to my previous post.