Re: FTDI USB Serial Drivers



As usual, you were right. And thanks to "knowing what to build when" ;) it
only took a minute to build the modified subproject and make a new image to
test.

Also, I had no idea that there were even flags for files in the .bib's. In
case any one else is reading and would like to know, there's a good
description here:
https://geekswithblogs.net/BruceEitman/archive/2008/06/17/platform-builder-using-bib-files-to-add-files-to-a.aspx.

Thanks again,
Lucio

"Michel Verhagen (eMVP)" wrote:

Ok, that makes sense, in a strange kind of way...

What's crazier is that when I go and manually copy the same dll
file to the \windows folder once CE is running, it works just fine.

That's why I think moving the DLL to the FILES section instead of
MODULES might just work...



Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

lsimoni wrote:
Michel,

They're definitely the CE version. I know .inf's aren't for CE, but FTDI
did it this way for some reason. The DLL accesses the inf for setup
information. What's crazier is that when I go and manually copy the same dll
file to the \windows folder once CE is running, it works just fine.

I'll give your ideas a shot tomorrow and see what happens.

from the FTDI driver readme:
Notes on INF files

Introduction

INF files are in general not a feature in Windows CE, however to configure a
USB device to load the appropriate device driver corresponding to a
particular VID and PID requires access to a registry editor which (unlike
windows) is not always available on a windows CE platform. Using INF files to
configure the driver to load properly and initialise some device settings
helps users from a windows background to use the drivers without the need for
a registry editor or a complete recompile of the driver with each new VID and
PID.
On loading the driver parses the INF file (which must be located in the
Windows directory) to extract settings such as VID/PID and Latency timer. It
then populates the registry with the appropriate values to enable all future
removal and insertion of the device to load the FTDI driver.
Please note: INF files are for INSTALLATION ONLY. After a particular device
has been installed the inf file becomes redundant and changes to the inf file
will not affect the device.


Thanks,
Lucio


"Michel Verhagen (eMVP)" wrote:

Are you absolutely sure you have the Windows CE drivers? An .inf file
makes no sense at all for Windows CE...

2nd, just copy the dll to the %_FLATRELEASEDIR% instead of
%_PROJECTROOT%\cesysgen. No need to copy there. And remove the last ".
It's orphaned (and you don't need quotes anyway because a full path to
%_FLATRELEASEDIR% should not have any spaces because the build system
can't handle that very well).

If with these changes it still doesn't work try moving the dll to the
FILES section and try again. Shouldn't make a difference but won't hurt...


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

lsimoni wrote:
The driver project is named FTDI_Uart_Driver. Here are the files:

..reg
;
; Copyright (c) 2005 Microsoft Corporation. All rights reserved.
;
; REG file created by CEFileWiz
[HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\FTDI_DEVICE]
"Prefix"="COM"
"Dll"="ftdi_ser.dll"
"ConfigData"=hex:\

01,00,3f,3f,10,27,88,13,c4,09,e2,04,71,02,38,41,9c,80,4e,c0,34,00,1a,00,0d,\
00,06,40,03,80,00,00,d0,80
"InitialIndex"=dword:00000000
"DeviceArrayIndex"=dword:00000000
"LatencyTimer"=dword:00000010

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1027_24577\Default\Default\FTDI_DEVICE]
"DLL"="ftdi_ser.dll"

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1027_24592\Default\Default\FTDI_DEVICE]
"DLL"="ftdi_ser.dll"

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default\255\FTDI_DEVICE]
"DLL"="ftdi_ser.dll"

..bib
;
; Copyright (c) 2005 Microsoft Corporation. All rights reserved.
;
;
; NOTE: if any of the .EXE's included in this component are .NETCF
; you will need to move them to the FILES section.
;
MODULES
; Name Path Memory Type
; -------------- --------------------------------------------- -----------
ftdi_ser.dll $(_FLATRELEASEDIR)\ftdi_ser.dll NK

FILES
; Name Path Memory Type
; -------------- --------------------------------------------- -----------
FTDIPORT.INF $(_FLATRELEASEDIR)\FTDIPORT.INF NK


postlink.bat:
echo Executing FTDI_Uart_Driver Postlink.bat
echo copying ftdi_ser.dll
copy "C:\Backup\Windows CE Evaluation\FTDI Uart Driver\CE 6.0
Driver\ftdi_ser.dll"
"%_PROJECTROOT%\cesysgen\oak\target\%_TGTCPU%\%WINCEDEBUG%"
echo copying FTDIPORT.INF
copy "C:\Backup\Windows CE Evaluation\FTDI Uart Driver\CE 6.0
Driver\FTDIPORT.INF"
"%_PROJECTROOT%\cesysgen\oak\target\%_TGTCPU%\%WINCEDEBUG%"

echo copying ftdi_ser.dll
copy "C:\Backup\Windows CE Evaluation\FTDI Uart Driver\CE 6.0
Driver\ftdi_ser.dll" %_FLATRELEASEDIR%"
echo copying FTDIPORT.INF
copy "C:\Backup\Windows CE Evaluation\FTDI Uart Driver\CE 6.0
Driver\FTDIPORT.INF" %_FLATRELEASEDIR%"


projsysgen.bat:
if /i not "%1"=="preproc" goto :Not_Preproc
goto :EOF
:Not_Preproc
if /i not "%1"=="pass1" goto :Not_Pass1
if "%FTDI_UART_DRIVER_SYSGEN%"=="" goto NoSettings
:NoSettings
goto :EOF
:Not_Pass1
if /i not "%1"=="pass2" goto :Not_Pass2
goto :EOF
:Not_Pass2
if /i not "%1"=="report" goto :Not_Report
goto :EOF
:Not_Report
echo %0 Invalid parameter %1
:EOF


All of the other sub-project related files are blank.

Thanks again for your help,
Lucio
"Michel Verhagen (eMVP)" wrote:

A file inside the \windows folder on the device is not a real file. It
is a binary representation of the file. I don't know if the date changes
when romimage packages up the NK (never had any reason to check), but it
might. Show us your project parameter files. If you used CEFileWiz to
create a project for this there is no need to change project.reg. Just
put the registry settings and bib settings in the projects own parameter
files.



Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

lsimoni wrote:
I'm using Windows CE 6.0 and I"m trying to pre-install the CE drivers for an
FTDI USB to Serial converter. The FTDI driver installation is basically to
copy the .dll and .inf files to the \windows directory and to add some
settings to the registery.

I've use CEFileWiz to generate the project for platform builder, and I've
modified the registry to add the required keys. When I build the OS, I can
see the correct .dll and .inf files in the release directory, but when I go
to run the OS image, the .dll file in the \windows directory has a different
date and doesn't work. When the OS is running, I can manually copy and
overwrite the .dll file with the same file that is used in making the OS, and
then the driver works just fine.

Even when I check the build.log, it is copying the correct file to the
release directory. And the date is correct on that file. But when I run the
OS, the date of the .dll file in the \windows directory is different .

I've checked the registry before and after copying the file, and there
aren't any differences, so I know the settings that I've put in the
project.reg file are correct.

The non-functional file is ftdi_ser.dll, 46.5kb, dated 6/2/2008 9:02:56 AM
The working file is ftdi_ser.dll, 46.5kb, dated 6/2/2008 11:02:56 AM

What would change the file date between the sub-project build and the make
image command? I've also tried a full-project build and it does the same
thing.

.