RE: Can't open Serial port



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



Relevant Pages

  • Re: Cant open Serial port
    ... up a com port, open it and write "test" string to it. ... After boot, I find my test program, double click it to run. ... program I've got the error messages described in my previous post. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Cant open Serial port
    ... serial port is opened, then start the debug output again when it closes. ... are you actually loading a serial driver ... After boot, I find my test program, double click it to run. ...
    (microsoft.public.windowsce.platbuilder)
  • More FTDI 232BM chip issues...
    ... Mar 24 23:46:42 displaytest kernel: usb 2-2: new full speed USB device ... Of course I have a test program running overnight and when the device ... Is there any particular reason the hub would disable that port? ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Communication Driver Hooks
    ... a bit bucket for communication ports. ... the COM port while my hook is installed. ... tests that the hook is properly installed, and that the test program works. ...
    (microsoft.public.development.device.drivers)
  • Re: Boot trouble help
    ... >In article, Rick>wrote:>>> I have a P4PE800 SE with 2.8 gig Prescott, no overclocking. ... Lately I>> have been having trouble with boot up. ... >>You might consider doing a backup of the disk, then go to the>hard drive manufacturer's web site, and download their disk>test software. ... The one I used was non-destructive, which means>it only did read operations, but ideally a test program should>be doing both reads and writes. ...
    (alt.comp.periphs.mainboard.asus)