**
**
**  VIA Rhine Family Fast Ethernet Adapter
**
**  Ethernet Downloader/Debugger package for Windows CE 4.2
**
**  v1.01   Apr, 2004
**
**


Introduction:
=============

  This document shows you how to enables VIA Rhine Family Fast Ethernet Adapter
  to be adopted as a download/debug card for WINCE .NET platform builder 4.2.


Contents of the Subdirectory:
=============================

    \DEBUG\FETDBG.LIB             fetdbg library debug version
    \DEBUG\FETDBG.PDB             fetdbg library debug pdb file
    \RETAIL\FETDBG.LIB            fetdbg library retail version
    \RETAIL\FETDBG.PDB            fetdbg library retail pdb file
    MAKEFILE                      sample MAKEFILE file
    SOURCES                       sample SOURCES file
    HALETHER.H                    HAL Header File
    HALETHER.C                    HALETHER Source Code 
    EBOOT.BIN                     ethernet boot loader file
    LOADCEPC.EXE                  Windows CE .NET boot loader 
    FETDBG.TXT                    this file



Installation:
=============

  Assume your target platform is equipped with 
  VIA Rhine Family Fast Ethernet Adapter, the platform is "CEPC:X86".
  Installation and test instructions are described below.


  1. Copy binary library files

    (1) Retail build:
       Copy the following files to directory
       \WINCE420\public\common\oak\LIB\X86\RETAIL

            \Retail\fetdbg.lib
            \Retail\fetdbg.pdb

    (2) Debug build:
       Copy the following files to directory
       \WINCE420\public\common\oak\LIB\X86\DEBUG

            \Debug\fetdbg.lib
            \Debug\fetdbg.pdb


  2. Modify the "Sources" files

    Locate respectively the "Sources" files in the two directories
        \WINCE420\PLATFORM\CEPC\KERNEL\BUILDEXE\KERNKITL
        \WINCE420\PLATFORM\CEPC\KERNEL\BUILDEXE\KERNKITLPROF

    and add one extra lines below for the TARGETLIBS environment variable:

    $(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\fetdbg.lib  \

    A sample "Sources" file is included for your reference.


  3. Modify HALETHER.C

    Locate the HALETHER.C file in directory \WINCE420\PLATFORM\CEPC\KERNEL\HAL
    and add the following codes in the "switch (pBootArgs->ucEdbgAdapterType)" statement
    in the OEMEthInit() function:
  
    case EDBG_ADAPTER_FET:
        pfnEDbgInit           = FETInit;
        pfnEDbgInitDMA        = FETInitDMABuffer;
        pfnEDbgEnableInts     = FETEnableInts;
        pfnEDbgDisableInts    = FETDisableInts;
        pfnEDbgGetPendingInts = FETGetPendingInts;
        pfnEDbgGetFrame       = FETGetFrame;
        pfnEDbgSendFrame      = FETSendFrame;
        pfnEDbgReadEEPROM     = FETReadEEPROM;
        pfnEDbgWriteEEPROM    = FETWriteEEPROM;
        pfnEDbgSetOptions     = FETSetOptions;
        pfnCurrentPacketFilter= FETCurrentPacketFilter;
        pfnMulticastList      = FETMulticastList;
        break;

    A sample HALETHER.C file is included for your reference.


  4. Modify halether.h

    Locate the halether.h file in directory \WINCE420\public\common\oak\INC
    and add the following lines:
  
       #define EDBG_ADAPTER_FET   65

       // Prototypes for FETDBG.LIB functions
       BOOL   FETInitDMABuffer(DWORD dwStartAddress, DWORD dwSize);
       BOOL   FETInit( BYTE *pbBaseAddress, DWORD dwMultiplier, USHORT MacAddr[3]);
       void   FETEnableInts(void);
       void   FETDisableInts(void);
       DWORD  FETGetPendingInts(void);
       UINT16 FETGetFrame( BYTE *pbData, UINT16 *pwLength );
       UINT16 FETSendFrame( BYTE *pbData, DWORD dwLength );
       BOOL   FETReadEEPROM( UINT16 EEPROMAddress, UINT16 *pwVal);
       BOOL   FETWriteEEPROM( UINT16 EEPROMAddress, UINT16 Data );
       DWORD  FETSetOptions(DWORD dwOptions);
       void   FETCurrentPacketFilter(DWORD	dwFilter);
       BOOL   FETMulticastList(PUCHAR pucMulticastAddresses, DWORD dwNoOfAddresses);

    Also add the following lines into the SUPPORTED_COMMON_NIC #define section:

       {0x1106, 0x3065, 0xABCDEF, EDBG_ADAPTER_FET,     "VT" }, /* VIA */\
       {0x1106, 0x3106, 0xABCDEF, EDBG_ADAPTER_FET,     "VT" }, /* VIA */\
       {0x1106, 0x3053, 0xABCDEF, EDBG_ADAPTER_FET,     "VT" }, /* VIA */\

    A sample halether.h file is included for your reference.


  5. Modify MAKEFILE file

    Locate the MAKEFILE file in directory \WINCE420\public\common\CESYSGEN
    and add "fetdbg" for the tools and httpftp segments.

    A sample "MAKEFILE" file is included for your reference.


  7. Build CEPC platform

    Choose "Build Platform" from the "Build" menu to make a new OS image.


  8. Basic testing

    An EBOOT.BIN is included in this package. Copy this file to your boot disk.

    A FET DOS setup Setup.exe utility is also included in this package. Run this
    setup utility on your target platform to check the IRQ and IOPORT assignments of
    FET.

    Usage,
        loadcepc /e:<IOPORT in HEX>:<IRQ in hex>:[<dotted IP address, optional>] eboot.bin
    Where <IOPORT> and <IRQ> could be found by FET Setup.exe

    Typical examples,
        In case of static IP assignment,
           loadcepc /e:E000:B:192.168.1.123 eboot.bin 
    
        In case of IP assignment through DHCP,         
            loadcepc /e:E000:B eboot.bin


    Note: The parameter definition of loadcepc.exe of Windows CE.Net is different from 
          which of Windows CE 3.0. So, don't use loadcepc.exe of Windows CE 3.0. 
          Loadcepc.exe of Windows CE.Net is included in this package.


  9. IDE platform builder ethernet download/debug settings

    In order to configure a connection for downloading and debugging, choose
    "Configure Remote Connection" from the "Target" pull down menu. Choose the "Services" tab.
    In the "Named connection service" group, select "Ethernet" from both the "Download" 
    list box and the "Kernel Transport" list box.
    Click on the "Configure" button, which is to the right of the "Download" list box.
    Then run "loadcepc" on the your target platform as described in the previous step.
    A CEPC device name will show up in the "Available Devices" box. Click on it, and then
    click OK to end the dialog box.

    Select "Download/Initialize" from the "Target" pull down menu to start download service.    


  10. FET NDIS LAN driver/EDBG conflict problem

    If a FET is used as a download/debug card, then FET Fast Ethernet LAN Driver driver
    must not be installed on this download/debug card. Improper installation could cause
    Windows CE system hanging.
    By default, a VMini Ethernet sharing library is supported by CE.Net. It's a miniport driver
    that interfaces with VBridge to handle traffic not related to Ethernet debugging. Besides
    EDBG, a FET download/debug card also functions as a product Ethernet card.
    Note:If the environment variable BSP_NOSHAREETH is set, VMini will be disabled.

