Page 1 of 1

Serious Warnings

Posted: Mon Dec 30, 2013 12:13 am
by Xavier
Hi Guys

Can you please explain to me why am I getting these serious warnings?

Serious Warning: Possible sw stack corruption, function 'Wdt_Delay_Ms' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'FCD_LCDDisplay0_RawSend' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'delay_ms' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)

I even removed delays and replaced them with count until to try and get rid of this error but to no avail.

Regards
Xavier

Re: Serious Warnings

Posted: Mon Dec 30, 2013 12:39 am
by medelec35
Hi Xavier,
one cause is having a call macro within an interrupt macro.
Interrupt macros should be as short as possible, and be allowed to exit at the end.

Another cause is having a the same delay within a interrupt that is within a component that's not in the interrupt.

For example an LCD component(contains ms delays) within an interrupt (Not recommended)
and ms delays within a different call macro.

I would recommend ADC and LCD components being placed within a non interrupt macro.

Hope this helps.

Martin

Re: Serious Warnings

Posted: Mon Dec 30, 2013 1:15 pm
by Xavier
Thanks Martin I will try doing it your way.

All the best
Xavier

Re: Serious Warnings

Posted: Mon Dec 30, 2013 9:57 pm
by Jan Lichtenbelt
Hi Martin

I have the same problem for one own macro (FCM_RC5_Tx), a PWM function (FCD_0df41_PWM1__Enable) and also the delay (delay_us).
I have 2 interrupt macros (IOC and Timer1) but in both only a counter is increased with 1.

Can there be other reasons for the stack corruption warning?

Kind regards

Jan Lichtenbelt

Re: Serious Warnings

Posted: Mon Dec 30, 2013 11:01 pm
by Spanish_dude
Hey Jan, can you post your flowcode file ?

- Nicolas

Re: Serious Warnings

Posted: Tue Dec 31, 2013 10:02 am
by Jan Lichtenbelt
Hi Nicolas,

The flowcode is rather complex.

Can you help me with general advices?

Kind regrads

Jan Lichtenbelt

PS. In the meanwhile I found the source of the warning. I had an additional ASD (auto shut down) interrupt. After removing this last one, the warnings disappeared

Re: Serious Warnings

Posted: Wed Jan 01, 2014 3:55 pm
by Spanish_dude
Jan Lichtenbelt wrote:PS. In the meanwhile I found the source of the warning. I had an additional ASD (auto shut down) interrupt. After removing this last one, the warnings disappeared
Glad you found the error.