Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


the task with large stack size can't work

Posted by vincent on June 8, 2012

I create those tasks to run
sys_thread_new("USB", usb_task, NULL, configMINIMAL_STACK_SIZE, USB_TASK_PRIO);
sys_thread_new("LED",led_task, NULL, configMINIMAL_STACK_SIZE, LED_TASK_PRIO);
sys_thread_new("DHCP", dhcp_task, NULL, configMINIMAL_STACK_SIZE, DHCP_TASK_PRIO);
sys_thread_new("POWER",power_task, NULL, configMINIMAL_STACK_SIZE, RS485_TASK_PRIO);
sys_thread_new("RELAY",relay_task, NULL, configMINIMAL_STACK_SIZE, RS485_TASK_PRIO);
sys_thread_new("OLED", oled_task, NULL, configMINIMAL_STACK_SIZE*2, OLED_TASK_PRIO);
sys_thread_new("COM", serial_task, NULL, configMINIMAL_STACK_SIZE*2, COM_TASK_PRIO);
sys_thread_new("TELNET",telnet_task, NULL, configMINIMAL_STACK_SIZE*2, TELNET_THREAD_PRIO);
sys_thread_new("HTTP", http_task, NULL, configMINIMAL_STACK_SIZE*2, HTTPSERVER_THREAD_PRIO);
sys_thread_new("SSL", ssl_server, NULL, configMINIMAL_STACK_SIZE*8, HTTPSERVER_THREAD_PRIO);

except those, TCPIP and ethernet task are also running background, I found that SSL task can't start, I set the #define configTOTAL_HEAP_SIZE( ( size_t ) ( 16 * 1024 ) )
I thinik the size is enough. but why the task with 1024B can't work.


RE: the task with large stack size can't work

Posted by Richard on June 9, 2012
Without knowing what configMINIMAL_STACK_SIZE is, nobody will be able to answer your question for definite, and do you really mean the task can't start, or that the task can't be created. If it is that the task can't be created, then the assumption is you have simply run out of heap space, so 16K is not enough. Remember when defining a task stack size you are specifying it in works, not bytes, to on a 32 bit architecture (you didn't mention the architecture either) if configMINIMAL_STACK_SIZE is set to 256, then defining a task to be 8*configMINIMAL_STACK_SIZE will allocate 8K bytes. (8 * 256 * 4).

See http://www.freertos.org/a00111.html and http://www.freertos.org/a00125.html

Hope this helps.


RE: the task with large stack size can't work

Posted by vincent on June 10, 2012
Hi rechard:

thank you for your useful link.
I am working on porting PolarSSL in FreeRTOS, it is almost succesful. if you need, I could release to you .

by the way , there is a demo project that FreeRTOS runs in SumSung S5PV210 processor platform ?


RE: the task with large stack size can't work

Posted by vincent on June 10, 2012
Hi Rechard:

I knew that FreeRTOS integerate CyaSSL in application level, but CyaSSL is not full free in some point, I am watching on this a long time event discuss it with CyaSSL company ,. I hope SSL should be open as FreeRTOS. just a wish.


RE: the task with large stack size can't work

Posted by Richard on June 12, 2012
I think the licenses for Polar and CyaSSL are very similar, they are both GPL v2 / Commercial dual licensed, so I'm not sure what the distinction is there.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner