From: Alexandre <thekyz@gmail.com>
To: Alexandre <thekyz@gmail.com>,
"eCos Mailing List" <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Can excessive/intensive serial flow cause stack overflow?
Date: Thu, 03 Jul 2008 16:06:00 -0000 [thread overview]
Message-ID: <d5aafeec0807030906m1c97a6f1qcf09e8dd5b5f431f@mail.gmail.com> (raw)
In-Reply-To: <20080703153938.GB31275@lunn.ch>
On Thu, Jul 3, 2008 at 5:39 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> Duh... Didn't read the message correctly, so missed the obvious problem....
>
> I thought vector, then the problem is priority.....
>
> This is easy to explain. The actual serial driver is in
> /packages/devs/serial/generic/16x5x/current/src.
>
> It registers the interrupt handler with:
>
> cyg_drv_interrupt_create(ser_chan->int_num,
> CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY,
> (cyg_addrword_t)chan,
> pc_serial_ISR,
> pc_serial_DSR,
> &ser_chan->serial_interrupt_handle,
> &ser_chan->serial_interrupt);
>
> The priority is hard coded for all serial devices as 4.
>
> You can sort of override this. The same file says:
>
> #ifndef CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY
> # define CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY 4
> #endif
>
> but you don't appear to be able to override it per device, just for
> all devices. So i think you are not going to be able to benefit from
> vectored interrupts and will have to use a priority of 16. Or you need
> to have the serial driver to allow you to specify a priority level per
> device.
>
> Humm, actually, you could do something a little horrible like:
>
> #define CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY \
> (ser_chan->int_num == CYGNUM_HAL_INTERRUPT_UART0 ? 4 : 5)
>
> in arm_lpc2xxx_ser.inl
>
> Andrew
That does the trick.
The program stops there (after cyg_user_start(), some scheduler, clock
and thread work) :
************************************************************************************************
TRACE: intr.cxx [ 619] static void Cyg_Interrupt::disable_interrupts(
) {{enter
TRACE: intr.cxx [ 638] static void Cyg_Interrupt::disable_interrupts(
) }}return void
TRACE: intr.cxx [ 648] static void Cyg_Interrupt::enable_interrupts()
{{enter
TRACE: intr.cxx [ 664] static void Cyg_Interrupt::enable_interrupts()
}}return void
ASSERT FAIL: <1>hal_misc.c[155]exception_handler() Exception!!!
ASSERT FAIL: hal_misc.c [ 155] exception_handler()
Exception!!!
************************************************************************************************
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2008-07-03 16:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 9:58 Alexandre
2008-07-03 10:10 ` Andrew Lunn
2008-07-03 13:48 ` Alexandre
2008-07-03 14:05 ` Andrew Lunn
2008-07-03 14:52 ` Alexandre
2008-07-03 14:54 ` Alexandre
2008-07-03 14:59 ` Alexandre
2008-07-03 15:07 ` Alexandre
2008-07-03 15:24 ` Andrew Lunn
2008-07-03 15:30 ` Alexandre
2008-07-03 15:40 ` Andrew Lunn
2008-07-03 16:06 ` Alexandre [this message]
2008-07-03 19:11 ` Sergei Gavrikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5aafeec0807030906m1c97a6f1qcf09e8dd5b5f431f@mail.gmail.com \
--to=thekyz@gmail.com \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).