Re: Unable to open Serial Port

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




hi chris,
I have written a very simple program a console c# program in which i am
opening the available serial ports and sending a message to the other end
i.e. a desktop pc listening on hyperterminal.

"Chris Tacke, eMVP" wrote:

What exactly is "showing COM1 is available"? Did you look in the registry?
Or are you getting that information somewhere else?


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Sekhon" <Sekhon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:16ED2E51-B11B-4222-AEF2-F5D168393693@xxxxxxxxxxxxxxxx
hi,
Actually tobey suggested that by just adding the support for serial port
in
catalog view doesn't actually give you a serial port on the target device
but
you need to actually set up the registry for the device to tell the driver
where the port hardware can be found. But i was asking the question
whether
is it possible to see the serial port without their respective driver
loaded
or not. In my case it is showing me "COM1" port is available but when i
try
to open the port it throws an IOException.
I am using the loadcepc /c:0 switch while loading image in order to
supress
the debug serial port as i have learnt this through msdn blog.
I have also unchecked the KITL and Kernel debugger build options.
My question is how do i proceed from here?

"Bruce Eitman [eMVP]" wrote:

Huh? If a driver isn't loaded, then the port isn't available. What do
you
actually mean?

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"Sekhon" <Sekhon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:30D30DBA-D7B9-4D5D-BB90-0D2386EADC04@xxxxxxxxxxxxxxxx
Hi Tobey,
Thanks for replying to my query. Actually i did check before opening
the
port that what all serial ports are available and it did showed COM1. I
think
that COM1 serial port is available but driver is not loaded. Now about
what
you said that to set up the registry for the device, interrupt to use,
etc.
How can i setup the registry to load the driver for the device and does
it
have to be at OSDesign stage? What all variables are required?
Thank You


"Paul G. Tobey [eMVP]" wrote:

Is there a COM1? Check the registry,
HKEY_LOCAL_MACHINE\Drivers\Active
branch, for an item that corresponds to your serial port. It's NOT
the
case
that somehow simply adding Serial Port support to the operating system
will
make there be a serial port, just because you have serial port
hardware.
You have to set up the registry for *YOUR* device to tell the driver
where
the port hardware can be found, what interrupt to use, etc.

Paul T.

"Sekhon" <Sekhon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B13989DF-0A9D-4DE1-8480-FACCFDFF5F16@xxxxxxxxxxxxxxxx
hi,
I might be sound elaborate on the issue. I have a created an image
for
an
industrial controller device (x86 platform).What i now wanted to do
is
programming on serial communication. I included the support for
serial
port,
now as i have only one serial port on the target device i have
unchecked
enable KITL and enable kernel debugger from build options. While
loading
the
image in the target device with loadcepc i used the /c:0 switch in
order
to
suppress the debug serial port. Thereafter I built a simple program
to
open
com1 serial port on the target device and send a simple message to
the
other
end ( development pc listening on hyperterminal). But when i deploy
this
program on target device it throws an IOException error. I checked
before
opening the serial port whether it is open or not. I was not sure
whether
debug serial has been suppressed or not beacuse i could see debug
messages
on
hyperterminal so i loaded the image locally as loadcepc /c:0 nk.bin
after
which the messages were gone. But even then it is throwing an
IOException
error.
If it shows then com1 is not open, then what could be the reason of
IOException while opening com1?










.



Relevant Pages

  • Re: Unable to open Serial Port
    ... port that what all serial ports are available and it did showed COM1. ... that COM1 serial port is available but driver is not loaded. ... now as i have only one serial port on the target device i have unchecked ... opening the serial port whether it is open or not. ...
    (microsoft.public.windowsce.app.development)
  • Re: Unable to open Serial Port
    ... What exactly is "showing COM1 is available"? ... Did you look in the registry? ... Actually tobey suggested that by just adding the support for serial port ... catalog view doesn't actually give you a serial port on the target device ...
    (microsoft.public.windowsce.app.development)
  • Re: Unable to open Serial Port
    ... I checked out in registry it is listed in HKLM/Drivers/Active in 04 with ... Actually tobey suggested that by just adding the support for serial port ... catalog view doesn't actually give you a serial port on the target device ... port that what all serial ports are available and it did showed COM1. ...
    (microsoft.public.windowsce.app.development)
  • Re: Unable to open Serial Port
    ... I included the support for serial port, ... image in the target device with loadcepc i used the /c:0 switch in order to ... But even then it is throwing an IOException ... IOException while opening com1? ...
    (microsoft.public.windowsce.app.development)
  • Re: Unable to open Serial Port
    ... Actually tobey suggested that by just adding the support for serial port in ... is it possible to see the serial port without their respective driver loaded ... port that what all serial ports are available and it did showed COM1. ... now as i have only one serial port on the target device i have ...
    (microsoft.public.windowsce.app.development)