Quality RTOS & Embedded Software

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


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


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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