[ECOS] ISR problem

Bart Veer bartv@ecoscentric.com
Sun Jan 8 18:29:00 GMT 2006


>>>>> "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



More information about the Ecos-discuss mailing list