This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: ISR problem
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ram_ecos at yahoo dot co dot in
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Sun, 8 Jan 2006 18:29:32 +0000 (GMT)
- Subject: Re: [ECOS] ISR problem
- References: <20060105095705.73056.qmail@web8409.mail.in.yahoo.com>
>>>>> "Ram" == ram kumar <ram_ecos@yahoo.co.in> writes:
Ram> I am facing a problem. I created two ISR with same ISR & DSR
Ram> api & same priority for COM1 (vector= 36) & COM2 (vector
Ram> =35). In my DSR I am checking the received data and printing
Ram> it on my eCos x86 system monitor using printf?.
Ram> Now when I am sending data on one port at one time
Ram> then it is printed on monitor, but if I send data on
Ram> both ports at same time then my eCos system is
Ram> restarting automatically. Is it because I am using
Ram> printf? which is being shared by both the DSR?s, Or
Ram> some other reason.
Please do read the documentation,
http://ecos.sourceware.org/docs-latest/ref/ecos-ref.html. DSRs can
only call a limited number of functions, although not quite as limited
as ISRs. In particular a DSR cannot call any function that may block.
Now, typically printf() will need to lock a mutex within the C library
to get exclusive access to the appropriate FILE structure and
associated data buffers. If the printf() results in real I/O (it may
not do so, depending on buffering), then there is likely to be further
locking within the I/O subsystem, with the details depending on
exactly where the printf() output is supposed to go.
So no, you cannot call printf() from a DSR - although of course your
application may be doing other things wrong causing the restart.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss