public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Interrupt stacking issues
@ 2012-07-19  9:46 Alan Bowman
  2012-07-19  9:58 ` Martin Hans
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alan Bowman @ 2012-07-19  9:46 UTC (permalink / raw)
  To: ecos-discuss

I am using a board based upon an STM3210E development board, only with
the processor clocked much slower (8MHz).  I am seeing problems with
interrupt handling when using the serial ports.  I believe that my
system should be fast enough to handle the data coming in.

Recently, I started getting assertions that a stack base was corrupt.
It turns out that the thread that is running when characters arrive at
the serial port has many instances of the ISR stacked one on top the
other until the stack overflows.  I understand that the ISR uses the
stack of the running thread, but I can't see how the same ISR can call
enough times until the stack overflows.

Since the stack check code is being asserted, I can see that the
PendSV bit is being set, and the scheduler is starting the context
switch - so the ISR itself is running to completion.  This also seems
to be quite timing dependent - when I have a setup that sees the
failure, it's quite consistent as soon as a modest amount of data is
written.  However, inserting a few lines of debugging code into ISRs
can make the issue (apparently) vanish.

Has anyone else had problems with recurring ISRs like this?  I'm not
sufficiently clear on the inner workings of the Cortex port to be able
to see if this is a problem with all interrupts, the serial ports or
something that I've done.  The stack dump doesn't enlighten me much
(beyond showing what seems to be repetition of the ISR call and
surrounding code), but I can post a printout if anyone thinks it would
help.

Thanks in advance

Alan Bowman

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-23  8:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19  9:46 [ECOS] Interrupt stacking issues Alan Bowman
2012-07-19  9:58 ` Martin Hans
     [not found]   ` <CAGT=Sv+C1C2Tqt05uLzphZfc=dCrhfOBBcDJwYg6uhKMFs1pKA@mail.gmail.com>
2012-07-19 10:11     ` [ECOS] Fwd: " Alan Bowman
2012-07-19 10:10 ` Manuel Borchers
2012-07-19 10:22   ` Alan Bowman
2012-07-19 15:46 ` Bernard Fouché
2012-07-19 16:28   ` Alan Bowman
2012-07-19 16:58     ` Bernard Fouché
2012-07-23  8:42       ` Alan Bowman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).