tina17 wrote on Wednesday, May 23, 2018:
Hello,
I already tried the solutions proposed in the following topic.
https://www.freertos.org/FreeRTOS_Support_Forum_Archive/February_2016/freertos_FreeRTOS_cannot_allocate_enough_RAM_for_all_tasks_4f578a67j.html
I am using the following setup:
- Controller: Infineon TLE9879QXA40 with 128 kB Flash and 6kB ROM (Cortex M-3)
- Compiler: Arm Compiler 5
In the uvision project is also the segger systemviewer included.
I tried to start two tasks, one for feeding the watchdog and another for toggling a LED.
In the following you can see the value of configTOTAL_HEAP_SIZE -> 2500 (it’s the maximum setting that works) and the size of Systemviewer.
I the value for the stack that is used for creating the tasks is 30. As soon as I want to create a third task I get the error “errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY” because FreeRTOS can not create the idle task.
Code (inc. data) RO Data RW Data ZI Data Debug Object Name
0 0 92 0 0 2226 bootrom.o
0 0 0 0 0 9280 event_groups.o
316 46 0 24 2500 3626 heap_2.o
156 30 0 0 0 499 int.o
8 0 0 0 0 1680 isr.o
148 0 0 0 0 2822 list.o
418 94 0 48 0 24952 main.o
758 76 0 16 0 9694 port.o
196 4 0 0 0 568 port_1.o
604 16 0 0 0 1093 scu.o
776 54 0 0 1208 7577 segger_rtt.o
2930 178 26 13 1291 24177 segger_sysview.o
172 86 0 0 0 1482 segger_sysview_config_freertos.o
368 30 88 4 160 3533 segger_sysview_freertos.o
36 8 128 0 512 796 startup_tle987x.o
40 14 4 0 0 1104 system_tle987x.o
2590 326 0 60 200 17882 tasks.o
16 0 0 0 0 455 tle_device.o
Can someone tell me why these “simple” tasks already need so much stack or what could be the problem in my project ?
Thanks in advance