Task Overflow
응답
16. 7. 14 오전 6:55

Hello,

I'm developping a simple project which has a simple task to store in a file the sensor values. When the flash process ends, the LEDs turn on indicating stack overflow. I've been looking at some code examples with tasks , and I can't find out what I'm doing wrong. I also have removed all the code inside the task, just keeping a printf inside, and I still get overflow.

I will add some prints of my code.

Any hints what I may have missed?

Thanks

0 (0 투표)
RE: Task Overflow
응답
16. 7. 14 오전 7:19 as a reply to Lidia Cerqueira.

Hello Lídia,

it is difficult to reproduce your issue with your two small screenshots. In order to help you need the full project to find the cause of the overflow. Please post your E-mail address in here that I can contact you.

Kind regards,
Franjo

0 (0 투표)
RE: Task Overflow
응답
16. 7. 14 오전 7:26 as a reply to Franjo Stjepandic.

licer.94@gmail.com

Thanks a lot

0 (0 투표)
RE: Task Overflow
응답
16. 7. 14 오후 4:03 as a reply to Lidia Cerqueira.

Hello Lídia,

I have received your project and will analyse it soon. If I have any new results, I will post it in here.

Kind regards,
Franjo

0 (0 투표)
RE: Task Overflow
응답
16. 7. 15 오전 11:27 as a reply to Franjo Stjepandic.

Hello there,

I was able to isolate the occuring issue in Lídias project. It is not a stack overflow at all. This would be the case if the running application on the XDK would stop and all LEDs would glow. Additionally a stack overflow indicating error message would be printed in the console.
Lídias application triggers all LEDs but the applications runs quite fine.
The problem is related to this if condition:

   if (xTaskCreate(sd_card, (const char * const) pcTextForTask1,
                    configMINIMAL_STACK_SIZE, NULL, 2, &xHandle1))
                assert(0);

The assertion will be allways triggered when the task is created. To get things working I would suggest to change the condition to this:

    if (!xTaskCreate(sd_card, (const char * const) pcTextForTask1,
                    configMINIMAL_STACK_SIZE, NULL, 2, &xHandle1))
                assert(0);

The change of the condition allows to execute the assertion only when the task creation failed.

Kind regards,
Franjo

0 (0 투표)
RE: Task Overflow
응답
16. 7. 27 오후 12:44 as a reply to Franjo Stjepandic.

I'm not sure, if

if (!xTaskCreate(...))

is a good "solution".

Did you read the documentation for xTaskCreate?

"@return pdPASS if the task was successfully created and added to a ready
 list, otherwise an error code defined in the file projdefs.h"

so I would propose to use

if (pdPASS != xTaskCreate(...))

 

 

 

0 (0 투표)
RE: Task Overflow
응답
16. 7. 27 오후 1:00 as a reply to Achim Kraus.

Hello Achim,

this is a fix to get Lídias project work in general. Your way is definately the more elegant way to solve this.

Thanks for this hint.

Kind regards,
Franjo

0 (0 투표)