Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Way to test serial ports in CE6? Hyperterminal?

1,245 views
Skip to first unread message

modest

unread,
Aug 28, 2009, 1:43:01 PM8/28/09
to
I am sure this must be pretty simple but I can't seem to find it after
searching on the forums.

I have one COM (serial) 16550 port on my target system. Right now I copy my
nk.bin file on a SATA hard drive and boot from it. Now as the image loads I
can see debug messages over serial port.

Now once the image finishes loading and I get my desktop, how do I test the
serial port inside the CE6 OS. I could not find any Hypertimal application?
Is there one in CE6? If yes, where is it in the catalog item?

Or by just seeing the debug messages over serial port when the image loads,
is it sufficient to say that COM1 works fine in CE6?

Obcd

unread,
Aug 28, 2009, 2:04:47 PM8/28/09
to
The debug serial port can't be used in windows ce. ce won't load a driver
for it. The fact you see the debug output only proves that the baudrate
selection and transmit register are working. The debug output isn't using
interrupts. It simply outputs a byte on the serial port and waits until it's
transmitted to output the next byte.
There is no hyperterminal or a look alike present in windows ce. You will
need to disable it's "debug output" function and add the proper registry
settings for ce to load a driver for it.

"modest" <mod...@discussions.microsoft.com> wrote in message
news:CED9C8EF-F068-4435...@microsoft.com...

modest

unread,
Aug 28, 2009, 2:30:01 PM8/28/09
to
Hmm. I am a bit confused here.

So just to give some background information:

In order to get my Serial port debug working, I first had to comment the
BSP_NOSERIAL=1 from my platform's .bat file which enabled me to select the
"Device Drivers->Com16550" under my project's catalog item. Hope that's the
way to get the serial debug messages.

Now, AFAIU based on what you mentioned, in order to test the serial port in
"ce6", I first need to undo what I did above?

Also where do I have to add the registry entry for the serial port? In
platform.reg?
Also do I need to add anything else from the catalog item too?

Obcd

unread,
Aug 30, 2009, 8:26:36 AM8/30/09
to
Search your platform.reg for the BSP_NOSERIAL. Under it, you will find the
registry settings that are needed to enable the loading of the buildin
serial driver for the comport at io adress 0x2F8

The standard behavour for a x86 platform usually is:

serial port at 0x3F8 is used as debug port. (no windows ce driver)
serial port at 0x2F8 is used in ce as COM1: (if you disable the
BSP_NOSERIAL=1)
serial port at 0x3E8 is used in ce as COM2: (if you set the BSP_SERIAL2=1)

The debug output is generated in the debug.c file under the
platform\common\x86\src\x86\common\other folder.

If you intend to use a serial port in windows ce, you don't want it to spit
out debug messages, do you?

On x86 platforms, the io adress of a comport is usually set in the platform
bios. If you only have one serial port, check the bios setup to see what IO
and interrupt it is using.

Also note that if you set the winceship=1 in your platform, it won't produce
any debug messages anymore.
It might help if you could provide more details about your platform. After
all, windows ce is highly configurable, so things might work different on
your platform.

"modest" <mod...@discussions.microsoft.com> wrote in message

news:699B865E-FA91-4BB5...@microsoft.com...

modest

unread,
Aug 31, 2009, 12:36:01 PM8/31/09
to
My target platform is x86 and my .reg files does contain the registry code
for up to 3 serial ports (just like CEPC's .reg file). I have only one serial
port on my target system.

> serial port at 0x3F8 is used as debug port. (no windows ce driver)
Yes, you are right. I learned that last Friday. I am still a newbie in CE.
It seems that BSP_NOSERIAL does not have any effect on serial debug messages.
They are always there by default.

> serial port at 0x2F8 is used in ce as COM1: (if you disable the
> BSP_NOSERIAL=1)

Yes, once I commented out BSP_NO_SERIAL=1, the file com16550.dll got copied
to my Release directory. But now the question comes how to do I test serial
ports in CE6?

In one of your previous post, you mentioned that I need to disable the
"serial debug" fucntion and enable settings to load the CE6 driver - It seems
that the later part is done i.e. loading the ce6 driver, so only two things
remian:

a) How do I disable the "serial debug" function?
b) What application/code do I use in CE6 to verify the COM1 driver.?

Obcd - Really appreciate your effort!

Obcd

unread,
Aug 31, 2009, 4:22:29 PM8/31/09
to

a) How do I disable the "serial debug" function?

You don't need to disable it. If you don't need the serial port that is used
to output debug messages, leave things the way they are.
If you wan't to disable it and use it as a normal comport in ce, you will
need to look at the code in debug.c.
How are you launching your image? Are you using the biosloader or the
loadcepc program?
In the second case, I think you can select the debug comport with one of the
command line parameters.
In case of the biosloader, I think it's an ini file setting.

if the BSP_SERIAL2=1 isn't set, than the registry keys that occur under it
aren't added to the ce registry.

b) What application/code do I use in CE6 to verify the COM1 driver.?

When I was involved into the design of a CE platform, we wrote an
application ourself to test the serial ports of it.
We connected a loopback connector to the comport and checked if the data we
sent out also came in again.
Another thing you can check is the existence of the driver in the registry
under HKLM\drivers\active. If you can find the driver there, you know it
loaded correctly.
If you can't find the driver there, you will be unable to open the comport.

Windows CE also has a certification tool for it's drivers. I have no
experience with it, but I just wanted to let you know it exists.

So, if I understand it right, your platform is having 2 serial ports. One is
used as debug port and the other is a serial port that can be used in
windows CE.
Or, does it only have one serial port?


"modest" <mod...@discussions.microsoft.com> wrote in message

news:F7B7DDC1-AFB3-43EA...@microsoft.com...

modest

unread,
Aug 31, 2009, 4:48:01 PM8/31/09
to
> How are you launching your image? Are you using the biosloader or the
> loadcepc program?
I am using BIOSLoader to boot my nk.bin from a SATA hard drive

> Another thing you can check is the existence of the driver in the registry
> under HKLM\drivers\active. If you can find the driver there, you know it
> loaded correctly.

Not sure where to look for this info. Do you mean to look this in
platform.reg file of my project?

> Or, does it only have one serial port?

Yes, I just have one serial port. And that's why I need to free this serial
port from outputting debug messages and use it as COM1 in CE6. AFAIU from
your earlier messages, we cannot have both active at the same time - serial
debug messages and using COM1 port in CE6 by some sort of test app.

Lastly, is there any sample code that I can use quickly to verify the COM1
port in CE6 (of course after I figure out how to disable "serial debug"
fucntion)?

Obcd

unread,
Sep 1, 2009, 3:49:29 AM9/1/09
to
>>Another thing you can check is the existence of the driver in the registry
>> under HKLM\drivers\active. If you can find the driver there, you know it
>> loaded correctly.
>Not sure where to look for this info. Do you mean to look this in
>platform.reg file of my project?

No, those registry keys are created when the drivers are loaded during the
booting of the CE os.
So, you need to check the registry of the platform itself, either with a
local registry editor or with a remote one that shows the ce registry on
your pc.

> Lastly, is there any sample code that I can use quickly to verify the COM1
> port in CE6 (of course after I figure out how to disable "serial debug"
> fucntion)?

I just checked the biosloader boot.ini file (for CE5.0) There is no
parameter to choose the debug comport.
Even the biosloader itself outputs debug messages to the com 1 port. These
might interfer with the connected device as well (if you use the port as a
CE general purpose port.)

In the biosloader ini.c file,I can see that the comport is set to a fixed
value. Maybe things changed in ce 6.0.

I would take a look at the terminal program that comes as an example in the
microsoft MSDN package. It looks like it can be ported rather easily to
windows ce.


"modest" <mod...@discussions.microsoft.com> wrote in message

news:3B7CF41D-77E1-472B...@microsoft.com...

David Neman

unread,
Nov 10, 2010, 4:13:39 PM11/10/10
to
You can write a quick application to test the port. All you need to do is call CreateFile() to open COM1:, SetCommDCB() to set the baudrate, and WriteFile() to send desired text out the port. You will find that CE6 always closes the port after every line of debug information.

> On Friday, August 28, 2009 1:43 PM modest wrote:

> I am sure this must be pretty simple but I cannot seem to find it after


>> On Friday, August 28, 2009 2:04 PM Obcd wrote:

>> The debug serial port cannot be used in windows ce. ce will not load a driver


>> for it. The fact you see the debug output only proves that the baudrate

>> selection and transmit register are working. The debug output is not using
>> interrupts. It simply outputs a byte on the serial port and waits until it is


>> transmitted to output the next byte.
>> There is no hyperterminal or a look alike present in windows ce. You will

>> need to disable it is "debug output" function and add the proper registry


>> settings for ce to load a driver for it.


>>> On Friday, August 28, 2009 2:30 PM modest wrote:

>>> Hmm. I am a bit confused here.
>>>
>>> So just to give some background information:
>>>
>>> In order to get my Serial port debug working, I first had to comment the
>>> BSP_NOSERIAL=1 from my platform's .bat file which enabled me to select the

>>> "Device Drivers->Com16550" under my project's catalog item. Hope that is the


>>> way to get the serial debug messages.
>>>
>>> Now, AFAIU based on what you mentioned, in order to test the serial port in
>>> "ce6", I first need to undo what I did above?
>>>
>>> Also where do I have to add the registry entry for the serial port? In
>>> platform.reg?
>>> Also do I need to add anything else from the catalog item too?


>>>> On Sunday, August 30, 2009 8:26 AM Obcd wrote:

>>>> Search your platform.reg for the BSP_NOSERIAL. Under it, you will find the
>>>> registry settings that are needed to enable the loading of the buildin
>>>> serial driver for the comport at io adress 0x2F8
>>>>
>>>> The standard behavour for a x86 platform usually is:
>>>>

>>>> serial port at 0x3F8 is used as debug port. (no windows ce driver)

>>>> serial port at 0x2F8 is used in ce as COM1: (if you disable the
>>>> BSP_NOSERIAL=1)

>>>> serial port at 0x3E8 is used in ce as COM2: (if you set the BSP_SERIAL2=1)
>>>>
>>>> The debug output is generated in the debug.c file under the
>>>> platform\common\x86\src\x86\common\other folder.
>>>>

>>>> If you intend to use a serial port in windows ce, you do not want it to spit


>>>> out debug messages, do you?
>>>>
>>>> On x86 platforms, the io adress of a comport is usually set in the platform
>>>> bios. If you only have one serial port, check the bios setup to see what IO
>>>> and interrupt it is using.
>>>>

>>>> Also note that if you set the winceship=1 in your platform, it will not produce


>>>> any debug messages anymore.
>>>> It might help if you could provide more details about your platform. After
>>>> all, windows ce is highly configurable, so things might work different on
>>>> your platform.


>>>>> On Monday, August 31, 2009 12:36 PM modest wrote:

>>>>> My target platform is x86 and my .reg files does contain the registry code
>>>>> for up to 3 serial ports (just like CEPC's .reg file). I have only one serial

>>>>> port on my target system.
>>>>>

>>>>> Yes, you are right. I learned that last Friday. I am still a newbie in CE.
>>>>> It seems that BSP_NOSERIAL does not have any effect on serial debug messages.
>>>>> They are always there by default.
>>>>>

>>>>> Yes, once I commented out BSP_NO_SERIAL=1, the file com16550.dll got copied
>>>>> to my Release directory. But now the question comes how to do I test serial
>>>>> ports in CE6?
>>>>>
>>>>> In one of your previous post, you mentioned that I need to disable the
>>>>> "serial debug" fucntion and enable settings to load the CE6 driver - It seems
>>>>> that the later part is done i.e. loading the ce6 driver, so only two things
>>>>> remian:
>>>>>
>>>>> a) How do I disable the "serial debug" function?
>>>>> b) What application/code do I use in CE6 to verify the COM1 driver.?
>>>>>
>>>>> Obcd - Really appreciate your effort!


>>>>>> On Monday, August 31, 2009 4:22 PM Obcd wrote:

>>>>>> a) How do I disable the "serial debug" function?
>>>>>>

>>>>>> You do not need to disable it. If you do not need the serial port that is used


>>>>>> to output debug messages, leave things the way they are.
>>>>>> If you wan't to disable it and use it as a normal comport in ce, you will
>>>>>> need to look at the code in debug.c.

>>>>>> How are you launching your image? Are you using the biosloader or the
>>>>>> loadcepc program?

>>>>>> In the second case, I think you can select the debug comport with one of the
>>>>>> command line parameters.

>>>>>> In case of the biosloader, I think it is an ini file setting.
>>>>>>
>>>>>> if the BSP_SERIAL2=1 is not set, than the registry keys that occur under it
>>>>>> are not added to the ce registry.


>>>>>>
>>>>>> b) What application/code do I use in CE6 to verify the COM1 driver.?
>>>>>>
>>>>>> When I was involved into the design of a CE platform, we wrote an
>>>>>> application ourself to test the serial ports of it.
>>>>>> We connected a loopback connector to the comport and checked if the data we
>>>>>> sent out also came in again.

>>>>>> Another thing you can check is the existence of the driver in the registry
>>>>>> under HKLM\drivers\active. If you can find the driver there, you know it
>>>>>> loaded correctly.

>>>>>> If you cannot find the driver there, you will be unable to open the comport.
>>>>>>
>>>>>> Windows CE also has a certification tool for it is drivers. I have no


>>>>>> experience with it, but I just wanted to let you know it exists.
>>>>>>
>>>>>> So, if I understand it right, your platform is having 2 serial ports. One is
>>>>>> used as debug port and the other is a serial port that can be used in
>>>>>> windows CE.

>>>>>> Or, does it only have one serial port?


>>>>>>> On Monday, August 31, 2009 4:48 PM modest wrote:

>>>>>>> I am using BIOSLoader to boot my nk.bin from a SATA hard drive
>>>>>>>

>>>>>>> Not sure where to look for this info. Do you mean to look this in
>>>>>>> platform.reg file of my project?
>>>>>>>

>>>>>>> Yes, I just have one serial port. And that is why I need to free this serial


>>>>>>> port from outputting debug messages and use it as COM1 in CE6. AFAIU from
>>>>>>> your earlier messages, we cannot have both active at the same time - serial
>>>>>>> debug messages and using COM1 port in CE6 by some sort of test app.
>>>>>>>
>>>>>>> Lastly, is there any sample code that I can use quickly to verify the COM1
>>>>>>> port in CE6 (of course after I figure out how to disable "serial debug"
>>>>>>> fucntion)?


>>>>>>>> On Tuesday, September 01, 2009 3:49 AM Obcd wrote:

>>>>>>>> No, those registry keys are created when the drivers are loaded during the
>>>>>>>> booting of the CE os.
>>>>>>>> So, you need to check the registry of the platform itself, either with a
>>>>>>>> local registry editor or with a remote one that shows the ce registry on
>>>>>>>> your pc.
>>>>>>>>
>>>>>>>>

>>>>>>>> I just checked the biosloader boot.ini file (for CE5.0) There is no
>>>>>>>> parameter to choose the debug comport.
>>>>>>>> Even the biosloader itself outputs debug messages to the com 1 port. These
>>>>>>>> might interfer with the connected device as well (if you use the port as a
>>>>>>>> CE general purpose port.)
>>>>>>>>
>>>>>>>> In the biosloader ini.c file,I can see that the comport is set to a fixed
>>>>>>>> value. Maybe things changed in ce 6.0.
>>>>>>>>
>>>>>>>> I would take a look at the terminal program that comes as an example in the
>>>>>>>> microsoft MSDN package. It looks like it can be ported rather easily to
>>>>>>>> windows ce.


>>>>>>>> Submitted via EggHeadCafe
>>>>>>>> Visual Studio Async CTP Overview
>>>>>>>> http://www.eggheadcafe.com/tutorials/aspnet/e78665f9-b949-4cc7-a024-654eb3bbad6d/visual-studio-async-ctp-overview.aspx

0 new messages