Re: wince serial driver

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Reinhard Fischer (ReinhardFischer_at_discussions.microsoft.com)
Date: 10/11/04


Date: Mon, 11 Oct 2004 07:51:05 -0700

Hello Michael,

my application also has got a problem, which is pretty similar to yours. The
application makes use of the parity bit to signal events. So I need the
content of the arrived byte, even if it causes a parity error. This works
fine, as long as Í am running it as a desktop application (Windows 95, NT,
XP, ...). It still works fine, if I am running it as a CE application, as
long as it is running on a MIPS platform. It will fail, if I try to port my
application to an ARM platform (SA-1110, PXA255, ...). I guess, the serial
driver of an ARM platform discards bytes arriving with an parity error. I
don't think, that this problem is FIFO related. Otherwise, the desktop
application wouldn't run, too.
So you see, I am interested if you got already a solution to your problem.

Best Regards,

Reinhard Fischer, Hydrotechnik GmbH

"Michael--J" wrote:

> Where do i make this call to CeSetThreadPrority(hThreadHandle, 30)? In my app or the serial driver? If i were to do it in my app using P/Invoke of coredll.dll, will it work? And why a level of 30? Thanks David. Sorry for the late reply...
>
> "David Liao (MS)" wrote:
>
> > You can try follows. It may work.
> >
> > The Data Read out is from IST and WaitCommEvent is call from Application
> > which is from another Thread. Assume after WaitCommEvent signaled, you are
> > using ReadFile to read all data that have been received in Buffer.
> >
> > The way may make this to work is Set Thread that call WaitCommEven as
> > highest Priority (lowest number, Try CeSetThreadPrority(hThreadHandle, 30)).
> >
> > Assume IST detect top data is bad and signal the Block thread which called
> > WaitCommEvent because this Thread has higher priority. It should run (and
> > IST stopped). It use ReadFile to Read Data in Buffer (do not block,
> > IntervalTimeout is MAXDWORD, TotalTimeout is 0) and Call WaitCommEvent
> > again.
> >
> > It is rely three thing to work. One is no Thread Priority inversion. Second,
> > Thread Switch delay does not cause Hardware FIFO overflow. In Buffer can
> > hold block of data you are going to receive. All of them are not guaranteed.
> >
> >
> >
> > David Liao
> >
> > "Michael--J" <MichaelJ@discussions.microsoft.com> wrote in message
> > news:C593A664-67D7-4C42-BD76-52B01C4AAB69@microsoft.com...
> > > I read in the UART 16550D datasheet that parity errors are raised when the
> > byte (with parity error) reaches the top of the FIFO. That is why i am able
> > to modify the driver source to insert the 0xff character in the receive
> > stream. I also notice in the driver code that an error event is raised just
> > before this... how can't this event correspond with the byte in error? And
> > since an event is raised everytime, why can't my application pick them ALL
> > up? Is it just too slow?
> > >
> > > Kind Regards,
> > >
> > > Michael--J
> > >
> > > "Steve Maillet (eMVP)" wrote:
> > >
> > > > No, as David pointed out it's physically impossible for the driver to
> > > > identify all parity error bytes when the UART has a built in FIFO. As
> > the
> > > > interrupt indicates a parity error but does not indicate what byte in
> > the
> > > > FIFO caused it. New bytes could come in by the time the interrupt is
> > > > serviced and the hardware itself does not provide enough information to
> > > > indicate the exact byte with the error.
> > > >
> > > > --
> > > > Steve Maillet (eMVP)
> > > > EmbeddedFusion
> > > > smaillet_AT_EmbeddedFusion_DOT_com
> > > >
> > > >
> > > >
> >
> >
> >



Relevant Pages

  • Re: wince serial driver
    ... even if it causes a parity error. ... driver of an ARM platform discards bytes arriving with an parity error. ... >> The Data Read out is from IST and WaitCommEvent is call from Application ...
    (microsoft.public.windowsce.platbuilder)
  • Re: wince serial driver
    ... I am using the parity bit as a signal bit ... it raises a parity error. ... But if I try to port the application to an ARM platform ... >> The Data Read out is from IST and WaitCommEvent is call from Application ...
    (microsoft.public.windowsce.platbuilder)
  • Re: [PATCH] input: handle bad parity PS/2 packets in mouse drivers better
    ... finish transmitting entire packet when parity error is detected, ... psmouse - ignore parity error for basic protocols ... unsigned char pktsize; ...
    (Linux-Kernel)
  • Re: [PATCH] input: handle bad parity PS/2 packets in mouse drivers better
    ... The patch works by always accumulating a full PS/2 packet, ... finish transmitting entire packet when parity error is detected, ... psmouse - ignore parity error for basic protocols ... Let's do the same for standard PS/2 protocols (bare, ...
    (Linux-Kernel)