Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists