This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DSR Scheduling Problem


In gmane.os.ecos.general, you wrote:

[...]

> When a ISR of a message buffer is called, then the next message buffer 
> will be enabled by this ISR. Disabling the active buffer and enabling 
> the next one is quite fast and guarants that no message will be lost. 
> When such a burst of messages arrives it may happen, that a number of 
> message buffer ISRs will be called without any chance for a DSR to run. 
> This is not really a problem because we have up to 16 message buffers. 
> As soon as all messages are received the DSRs will run. And they will 
> run in LIFO order. So the interesting thing is, if we receive the CAN 
> messages with the following IDs:
>
> 0x001, 0x002, 0x003, 0x004, 0x005
>
> our application will  see the following:
>
> 0x005, 0x004, 0x003, 0x002, 0x001
>
> So the eCos DSR handling does change the received data here.
> At the moment I did not ran into any trouble with my CAN
> application and it seems not to be a problem but there is
> still a little bad feeling with this behaviour. It was quite
> tricky to write the CAN driver in a way that it works well
> with list and table implementation of DSR scheduling.

I'd probably use a single DSR that "knows" what order the
buffers are in.  I assume that the buffers are filled in a
predictable order?  Even if the hardware can't tell you which
buffers are full and which are empty, it should be relatively
simple to keep track in software if you need to, since it turns
into a standard "ring-buffer" inteface between the ISRs and the
DSR.

Just put a loop in the DSR to process all of the "full"
buffers. This will also result in less overhead, since the DSR
will only be invoked once for a "burst" of CAN frames.

-- 
Grant Edwards                   grante             Yow!  Being a BALD HERO
                                  at               is almost as FESTIVE as a
                               visi.com            TATTOOED KNOCKWURST.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]