Page 1 of 2

Hangs after hour or so

Posted: Sun Apr 14, 2013 1:48 pm
by kreyl
stm32f205ve + ChibiOS v2.5.1, 3 threads except idle one, couple of event sources with listeners.
My system hangs time after time; and this time is around an hour - maybe more, maybe less. During all this long time it works perfectly.
I did not managed to repeat the problem within a reasonable time to figure out the point of problem.
Are there any common techniques to operate with such circumstances? Maybe this is common scenario, and I should check some exact points?
Thanks in advance!

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 1:54 pm
by Giovanni
HI,

Usually this is because a race condition somewhere or a stack overflow, are you running with the debug options activated? especially the state checker could be helpful.

Giovanni

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 2:05 pm
by kreyl
Hi Giovanni The Great!
I am sorry, what is state checker?
Currently I have enabled debug and started debug session in hope to understand where it hangs when (and if) this will occure.
Here is my code, by the way; recomendations and comments would be very welcome.
http://nute.googlecode.com/svn/trunk/Ar ... let3/Gate/
http://nute.googlecode.com/svn/trunk/Ar ... Common_fw/
Thank you again!

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 2:12 pm
by mabl
Giovani means the CH_DBG_Flags in chconf.h. Please make sure you have them enabled, especially CH_DBG_SYSTEM_STATE_CHECK, it looks like you did not. You need working debugging too.

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 2:33 pm
by kreyl
Within a 40 minutes of normal running, I have got debug session stopped with

Code: Select all

warning: Remote failure reply: E31

Fast googling end up at Atollic: http://www.atollic.com/index.php/kb/11- ... ower_modes
Therefore I have next question: does ChibiOS switch CPU to some power-save mode(s), and if yes - where and when?
Thank you!

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 3:05 pm
by Giovanni
It is what Mabl explained.

ChibiOS does not switch in low power modes by itself unless you add code to do that.

BTW, are you using Atollic?

This could be of some help too: http://www.chibios.org/dokuwiki/doku.ph ... ebug_guide

Giovanni

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 3:09 pm
by kreyl
When I enabled CH_DBG_SYSTEM_STATE_CHECK to TRUE, I have an error:
chdebug.c:77:5: error: too few arguments to function 'chDbgPanic'
Indeed, there is

Code: Select all

 chDbgPanic("SV#1");

and in chdebug.h, at line 239, there is prototype:

Code: Select all

void chDbgPanic(const char *msg1, const char *msg2);


Seems like something incorrect.

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 3:11 pm
by kreyl
I use Eclipse Juno + YAGARTO + different stm Discovery boards.

Re: Hangs after hour or so

Posted: Sun Apr 14, 2013 3:40 pm
by Giovanni
Hi,

Which ChibiOS version are you using?, I don't see that void chDbgPanic(const char *msg1, const char *msg2) in any of the maintained releases.

Giovanni

Re: Hangs after hour or so

Posted: Sun Apr 21, 2013 6:24 pm
by kreyl
I use v. 2.5.1.
Actually, chDbgPanic defined at line 239 of chdebug.h:

Code: Select all

void chDbgPanic(const char *msg);

...has one parameter.
But chDbgAssert tries to use two parameters (defined at line 195 of chdebug.h):

Code: Select all

#if !defined(chDbgAssert)
#define chDbgAssert(c, m, r) {                                              \
  if (!(c))                                                                 \
    chDbgPanic(m, r);                                                          \
}


Any comments?