Re: Can't open the serial ports.
- From: "Mike M." <nospam@xxxxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 16:41:40 -0400
That's just a typo in transfering. I will try the _T.
Thanks.
"buzz" <buzz@xxxxxxxx> wrote in message
news:%23v9hDWFcFHA.456@xxxxxxxxxxxxxxxxxxxxxxx
> You have m_ComPort in your CreateFile call. Do you really want ComPort?
> (CString ComPort = "COM2").
> Also, try TCHAR* ComPort = _T("COM2:");
>
>
> Mike M. wrote:
> > I am using PB 5.0. The target is an Advantech PCM-3348 SBC. I have
> > inherited this project from a recently departed employee and I am
struggling
> > with the serial ports. COM1 and COM2 were supposedly working but when
my
> > app tries to open COM2: using CreateFile it gets ERROR_DEV_NOT_EXIST. I
have
> > googled the groups for hours and have checked the values from posts I
have
> > seen. The BIOS settings are:
> > COM1, IRQ4, 3F8
> > COM2, IRQ3, 2F8
> >
> > I see the the serial definitions in platform.reg are enclosed with
> > BSP_SERIAL defines. The only place I find BSP_SERIAL2 defined is in a
> > section of the Platform Builder project file. Here is that portion of
the
> > project file. BSP_SERIAL2 is at the end.
> >
> > <FeatureCollection Name="BspFeatures" EnforceUniqueItems="True">
> > <Feature Name="Item" FeatureVariable="STPC_ATAPI"
Anchored="True"
> > SupportedBSP="Stpc_consumer_II" ModuleName="STPC_ATAPI.DLL">
> > <CpuCollection Name="SupportedCpus"
EnforceUniqueItems="False">
> > <Cpu Name="Item" CpuName="x86" />
> > </CpuCollection>
> > </Feature>
> > <Feature Name="Item" Anchored="True" ModuleName="RTL8139.DLL">
> > <CpuCollection Name="SupportedCpus"
EnforceUniqueItems="False">
> > <Cpu Name="Item" CpuName="ARMV4" />
> > <Cpu Name="Item" CpuName="ARMV4I" />
> > <Cpu Name="Item" CpuName="MIPSII" />
> > <Cpu Name="Item" CpuName="MIPSII_FP" />
> > <Cpu Name="Item" CpuName="MIPSIV" />
> > <Cpu Name="Item" CpuName="MIPSIV_FP" />
> > <Cpu Name="Item" CpuName="SH4" />
> > <Cpu Name="Item" CpuName="x86" />
> > </CpuCollection>
> > <StringCollectionEX Name="AdditionalVariables">
> > <String>BSP_NIC_RTL8139</String>
> > </StringCollectionEX>
> > </Feature>
> > <Feature Name="Item" Anchored="True" ModuleName="COM16550.DLL">
> > <CpuCollection Name="SupportedCpus"
EnforceUniqueItems="False">
> > <Cpu Name="Item" CpuName="ARMV4" />
> > <Cpu Name="Item" CpuName="ARMV4I" />
> > <Cpu Name="Item" CpuName="Emulator" />
> > <Cpu Name="Item" CpuName="MIPSII" />
> > <Cpu Name="Item" CpuName="MIPSII_FP" />
> > <Cpu Name="Item" CpuName="MIPSIV" />
> > <Cpu Name="Item" CpuName="MIPSIV_FP" />
> > <Cpu Name="Item" CpuName="SH4" />
> > <Cpu Name="Item" CpuName="x86" />
> > </CpuCollection>
> > <StringCollectionEX Name="AdditionalVariables">
> > <String>BSP_SERIAL2</String>
> > </StringCollectionEX>
> > </Feature>
> > </FeatureCollection>
> >
> > These are the settings in my platform.reg file:
> >
> > IF BSP_NOSERIAL
> > "Ranges"="0-0x5F,0x65-0x277,0x284-0x38F,0x392-0x3DF,0x3E2-0xFFFF"
> > ENDIF ; BSP_NOSERIAL
> > IF BSP_NOSERIAL !
> > ;
> >
"Ranges"="0-0x5F,0x65-0x277,0x284-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0xFFFF
> > "
> >
> >
"Ranges"="0-0x5F,0x65-0x277,0x284-0x38F,0x392-0x3DF,0x3E2-0x3F7,0x400-0xFFFF
> > "
> > ENDIF ; BSP_NOSERIAL !
> > IF BSP_SERIAL2
> > ;
> >
"Ranges"="0-0x5F,0x65-0x277,0x284-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0x3E7,
> > 0x3F0-0xFFFF"
> >
> >
"Ranges"="0-0x5F,0x65-0x277,0x284-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0x3F7,
> > 0x400-0xFFFF"
> > ENDIF ; BSP_SERIAL2
> > IF BSP_SERIAL3
> > ;
> >
"Ranges"="0-0x5F,0x65-0x277,0x284-0x2E7,0x2F0-0x2F7,0x300-0x38F,0x392-0x3DF,
> > 0x3E2-0x3E7,0x3F0-0xFFFF"
> >
> >
"Ranges"="0-0x5F,0x65-0x277,0x284-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0x3E7,
> > 0x3F0-0x3F7,0x400-0xFFFF"
> > ENDIF ; BSP_SERIAL3
> >
> >
> > ; @CESYSGEN IF CE_MODULES_SERIAL
> > IF BSP_SERIAL3
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3]
> > ; "SysIntr"=dword:15
> > "SysIntr"=dword:10
> > ; "IoBase"=dword:02E8
> > "IoBase"=dword:03E8
> > "IoLen"=dword:8
> > "DeviceArrayIndex"=dword:2
> > "Prefix"="COM"
> > "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
> > "Dll"="Com16550.Dll"
> > "Order"=dword:0
> >
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3\Unimodem]
> > "Tsp"="Unimodem.dll"
> > "DeviceType"=dword:0
> > "FriendlyName"=LOC_FRIENDLYNAME_SERIAL3
> > "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_SERIAL3
> >
> > IF BSP_SERIAL2
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2]
> > ; "SysIntr"=dword:14
> > "SysIntr"=dword:3
> > ; "IoBase"=dword:03E8
> > "IoBase"=dword:02F8
> > "IoLen"=dword:8
> > "DeviceArrayIndex"=dword:1
> > "Prefix"="COM"
> > "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
> > "Dll"="Com16550.Dll"
> > "Order"=dword:1
> >
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\Unimodem]
> > "Tsp"="Unimodem.dll"
> > "DeviceType"=dword:0
> > "FriendlyName"=LOC_FRIENDLYNAME_SERIAL2
> > "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_SERIAL2
> >
> > IF BSP_NOSERIAL !
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial]
> > ; "SysIntr"=dword:13
> > "SysIntr"=dword:4
> > ; "IoBase"=dword:02F8
> > "IoBase"=dword:03F8
> > "IoLen"=dword:8
> > "DeviceArrayIndex"=dword:0
> > "Prefix"="COM"
> > "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
> > "Dll"="Com16550.Dll"
> > "Order"=dword:0
> > "Priority"=dword:0
> > ; Turn on follows for Installable ISR (isr16550 supporting SOFTWARE FIFO
> > ; "Irq"=dword:3
> > ; "IsrDll"="isr16550.dll"
> > ; "IsrHandler"="ISRHandler"
> >
> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial\Unimodem]
> > "Tsp"="Unimodem.dll"
> > "DeviceType"=dword:0
> > "FriendlyName"=LOC_FRIENDLYNAME_SERIAL
> > "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_NOSERIAL !
> > ; @CESYSGEN ENDIF CE_MODULES_SERIAL
> >
> >
> > The app is built in eVC 4.0.
> >
> > HANDLE hPort;
> > bRet = false;
> > CString ComPort = "COM2:";
> >
> > hPort = CreateFile(m_ComPort, GENERIC_READ, 0, NULL, OPEN_EXISTING,0,
> > NULL);
> > if(hPort == INVALID_HANDLE_VALUE)
> > // Log error
> > else
> > {
> > // Do stuff
> > CloseHandle(hPort);
> > }
> >
> > The CreateFile fails with error code 55.
> >
> > TIA
> >
> >
> >
.
- Follow-Ups:
- Re: Can't open the serial ports.
- From: Mike M.
- Re: Can't open the serial ports.
- References:
- Can't open the serial ports.
- From: Mike M.
- Re: Can't open the serial ports.
- From: buzz
- Can't open the serial ports.
- Prev by Date: Can't open the serial ports.
- Next by Date: Re: Can't open the serial ports.
- Previous by thread: Re: Can't open the serial ports.
- Next by thread: Re: Can't open the serial ports.
- Index(es):
Relevant Pages
|