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




Loading

two tasks can't work together

Posted by vincent on July 23, 2012
Hi:

I have two tasks and want to run them together. A tasks need 768 stack size in xTaskCreate function, another need 1280 stack size in xTaskCreate function. but i found that i can't create and run them together . is it FreeRTOS heaplimitation ?
i define #define configTOTAL_HEAP_SIZE( ( size_t ) ( 32 * 1024 ) ) . but it still can't work

vincent

RE: two tasks can't work together

Posted by Richard on July 23, 2012
What do the calls to xTaskCreate() return?
Does the call to vTaskStartScheduler() return?
Do you have a malloc failed hook defined?

Regards.

RE: two tasks can't work together

Posted by vincent on July 24, 2012
hi :

xTaskCreate(ssh_task,"SSH", configMINIMAL_STACK_SIZE*6,NULL, SSHSERVER_THREAD_PRIO,NULL);
xTaskCreate(ssl_server,"HTTPS", configMINIMAL_STACK_SIZE*10,NULL, HTTPSERVER_THREAD_PRIO, NULL)
the calls to xTaskCreate in main () return following value,
ssh ret: 536871004
https: ret: 1
obviously, https is created successfully, ssh is created fail, I also can see https running with vTaskLIst
vTaskStartScheduler() work weill .
where do i found the malloc failed hook defined

vincent

RE: two tasks can't work together

Posted by vincent on July 24, 2012
Hi :

please ignore last replay .
the SSH xtastcreate return 1 too .
but I call vtasktlist to get folowing message
Name State Priority Stack Num
---------------------------------------------
COM R 4 404 5
SENSOR R 3 164 3
IDLE R 0 118 8
ETH_IF B 5 214 1
TCPIP B 6 151 0
DHCPDOG B 3 179 2
OLED B 3 98 4
HTTPS B 6 888 7
SSH D 4 731 6

---------------------------------------------
B : Blocked, R : Ready, D : Deleted, S : Suspended
it seems SSH is deletet
vincent

RE: two tasks can't work together

Posted by Richard on July 24, 2012
When a task is deleted it will appear in the list with a 'D' next to it until the idle task has cleaned up the resources allocated [by the RTOS kernel itself] to that task. Normally that will happen very quickly. It would therefore appear that something has called vTaskDelete() for the SSH task (maybe the task itself, or maybe a different task) and the idle task has not been able to run to clean it up.

Where is vTaskDelete() being called and why?
Are you starving the idle task of execution time (that will happen if there are one or more higher priority tasks that never block)?

Regards.

RE: two tasks can't work together

Posted by vincent on July 24, 2012
hi :

sorry I forget to remove vTaskDelete(NULL) in ssh task... because it runs with more resource, so I deifne a signal to enable it or disable it .

thank you for you help

vincent


[ 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