Re: how to access the serial port exported functions in my applica
- From: "Tom Gensel (eMVP)" <tgensel@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 19 Jun 2009 17:29:22 -0400
Once again, you cannot access a serial port by loading the serial
driver DLL into your application via LoadLibrary. Instead, for CE
5.0, the driver DLL is loaded by DEVICE.EXE and your application
should access it by opening the port using CreateFile and then
interact with the port using the Serial Communcation APIs such as
SetCommState, SetCommTimeouts, SetCommMask, WaitCommEvent, etc., and
ReadFile and WriteFile to read and write data to and from the port.
Why are you trying to use the COM16550 driver? Are you actually
trying to use a 16X50 UART, or might you in fact be trying to use one
of the PXA270's on-chip UARTs? If the latter, COM16550 is the wrong
driver, and your BSP should include a serial driver to support the
PXA's UARTs.
Tom Gensel (eMVP)
On Fri, 19 Jun 2009 00:30:01 -0700, Nagaveni
<Nagaveni@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
.
my serial port is accessable till bootloader(PXA270+wince5.0).I tried to
enable the kernal debug port as COM port. not able to enable so I'm trying to
load serial by LoadLibrary.
Can any one help me to solve this. below is my platform settings,whats wrong
with this..............
this is my platform.reg
;
-----------------------------------------------------------------------------
; @CESYSGEN IF CE_MODULES_SERIAL
;IF BSP_NOSERIAL !
;COM1
;IF BSP_SERIAL
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial]
"Irq"=dword:16 ; 22 IRQ_FFUART
"SysIntr"=dword:1d ; 29 SYSINTR_FFUART
"MemBase"=dword:40100000 ; FFUART Register
"MemLen"=dword:40
"DeviceArrayIndex"=dword:80 ; FFUART object
"Prefix"="COM"
"Index"=dword:1
"IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
"Dll"="com16550.dll"
"Order"=dword:0
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial\Unimodem]
"Tsp"="Unimodem.dll"
"DeviceType"=dword:0
"FriendlyName"="Serial Cable on COM1:"
"DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00,
00,00, 08, 00, 00, 00,00,00,00
;ENDIF BSP_SERIAL
;ENDIF BSP_NOSERIAL !
; @CESYSGEN ENDIF CE_MODULES_SERIAL
; -----------------------------------------------------------------
for this also i m getting the error. I have added the standard com16550.dll,
can any one tell me how to proceed further
"Valter Minute [eMVP]" wrote:
Nagaveni wrote:
Hi All,
I am trying to load com16550.dll using
LoadLibraryEX(L"com16550.dll",NULL,LOAD_LIBRARY_AS_DATAFILE);
I am not able to retrive the address of an exported function from the
specified dll.I am using GetProcAddress(hDll,"COM_Open");
how to access the serial port exported functions in my application explicitly.
If you can explain why you want to do that someone may expose a better
solution.
In CE 6 you can't load a driver inside an application. If it's part of
the OS image it will be mapped in kernel space and so you will not be
able to load it, if it's loaded from storage it will not be able to
access hardware directly and so it won't work anyway.
If you need to send/receive data using that serial port you can use
CreateFile to retrieve an handle and then Read/WriteFile, SetCommState
and other system APIs to communicate with the driver, no need to load it
inside your app.
--
Valter Minute (eMVP)
www.fortechembeddedlabs.it - Training, support and development for
Windows CE
www.geekswithblogs.net/WindowsEmbeddedCookbook - My embedded programming
and cooking blog
(the reply address of this message is invalid)
- References:
- how to access the serial port exported functions in my application
- From: Nagaveni
- Re: how to access the serial port exported functions in my application
- From: Valter Minute [eMVP]
- Re: how to access the serial port exported functions in my applica
- From: Nagaveni
- how to access the serial port exported functions in my application
- Prev by Date: Backlight turns off, even when told not to
- Next by Date: Re: could not resolve import CreateStreamOnHGlobal
- Previous by thread: Re: how to access the serial port exported functions in my applica
- Next by thread: how to access the serial port exported functions in my application
- Index(es):
Relevant Pages
|