Re: Can't open Serial port
- From: "Bruce Eitman [eMVP]" <bruce.eitman.nospam@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Jul 2008 20:46:57 -0400
Have you considered contacting your vendor? They could provide you with
their OSDesign project for comparison. Short of that compare the ceconfig.h
files, it is in the \Windows folder.
Your testing tells me that there is some disconnect between your Compact
Framework code and the driver. Native code seems to be able to open the
driver and use it.
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman
EuroTech Inc.
www.EuroTech.com
"John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9BC57EBA-6902-4ABC-9387-2932D795C2A8@xxxxxxxxxxxxxxxx
Hi guys,
Thank you all very much for the help. After another day of trying here is
what I can report:
First something about my setup:
1. I have two computers connected separately to COM1 and COM2 of my
development board to monitor their outputs.
2. In build options, I checked "enable eboot space in memory", "enable
ship
build", flush tracked events to release directory", "Run-time image can be
larger than 32MB", "Use xcopy instead of links to populate release
directory"
3. I checked "NET Compact Framework 2.0". But I did not check "NET Compact
Framework 2.0 string resources".
4. My testing code was written in VB on VS2005. It is very simple: just
set
up a com port, open it and write "test" string to it.
5. I copy the "NK.bin" and my test program to a bootable CF card and use
the
CF card to boot.
6. After boot, I find my test program, double click it to run.
Note: I have two NK.bin files involved in this problem, one is a sample
"NK.bin" from the board vendor. One is my "NK.bin" built by me.
Here is what I've got today:
1. When my test program is set to use COM1:
a) Boot with a sample "NK.bin" which came on the CD with the
development
board. My program works. When I start and stop my test program, I can see
debug messages. And when my program is running, it continuously sends out
"test" string (the write is on a timer). It seems the debug feature can
co-exist with my program, sharing a COM port.
b) Boot with my "NK.bin" (built by me). When I double click my test
program I've got the error messages described in my previous post.
2. Change my test program to use COM2.
a) Boot with the sample "NK.bin". The test program still works. Now the
"test" strings show up on the computer connected to COM2.
b) Boot with my own "NK.bin". I've got the same error messages
described
before.
3. I build an "NK.bin" with ActiveSync catalog item checked.
a) I still can not open COM port in my test program. the same errors.
b) I can connect my development board to the computer connected to COM2
thru ActiveSync.
Some conclusions:
1. The hardware of both COM1 and COM2 works.
2. Both ports can be used by "standard" programs (ie. The built-in debug
and
ActiveSync)
3. My program works with either port if boot with the sample "NK.bin".
Is it a driver problem?
1. If it is a driver's problem, why would debug and ActiveSync work on my
"NK.bin" OS? Do they use a different "driver"?
2. Could be the sample NK.bin uses a different driver than my NK.bin
dioes?
But I'd think whatever the driver used in sample NK.bin should be the same
one used in the BSP I used to build my NK.bin because they are from the
same
vendor.
My puzzle:
1. My NK.bin was not built correctly. But then why the "standard" program
works with my NK.bin?
2. Something is wrong in my program. But then why would it work with the
sample NK.bin?
I think chance is high that my NK.bin was not built correctly. Can you
guys
give me more clues to follow?
Many many thanks.
"John" wrote:
Hi,
I am new to platform builder. I am trying to build a Wince 6.0 OS
supporting
the COM ports. But I can not open the COM port (COM1) when running my
application code on the OS I built. It tells me an unexpected error
happened
at System.IO.Ports.SerialStream.WinIOError()
at System.IO.Ports.SerialStream.CheckResult()
at System.IO.Ports.SerialStream.SetBufferSoze()
at System.IO.Ports.SerialPort.Open()
at ...
...
But I can receive these error messages from the COM1. So, the hardware is
ok. In fact, my code (and COM1) runs ok with a sample "NK.bin" came with
my
development board. I contacted my board vendor. They think I need
download
updates from Microsoft. I did have downloaded CF service pack 2 before
which
solved a problem regarding the breakpoint. What microsoft update I may
need
to download this time? Any suggestions?
Many thanks.
.
- References:
- RE: Can't open Serial port
- From: John
- RE: Can't open Serial port
- Prev by Date: RE: Can't open Serial port
- Next by Date: Re: Can't open Serial port
- Previous by thread: RE: Can't open Serial port
- Next by thread: Re: Can't open Serial port
- Index(es):
Relevant Pages
|