FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2012 Threads] two tasks can't work togetherPosted 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 togetherPosted 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 togetherPosted 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 togetherPosted 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 togetherPosted 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 togetherPosted 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
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|