# Windriver VxWorks
Real-time Ethernet Drivers for VxWorks are available.
If none of the Real-time Ethernet Drivers can be used, the SNARF Ethernet Driver must be selected.
The identification of the Real-time Ethernet Driver is done like this:

## VxWorks native
The BSP has to be prepared to support Real-time Ethernet Driver:
1. To use a Real-time Ethernet Driver the adapter memory has to be mapped into VxWorks memory space (VxWorks 5.x only). I.e. for the Intel Pro/100 Ethernet Driver this can be achieved by setting the INCLUDE_FEI_END macro in the BSP configuration file config.h.
2. To avoid conflicts with the VxWorks network driver which normally will be loaded when INCLUDE_FEI_END is set the file configNet.h has to be adjusted in a way that the network driver is not loaded. The network driver entry has to be removed from the endDevTbl[]:
```text
END_TBL_ENTRY endDevTbl [] =
{
: : :
: : :
: : :
/*
#ifdef INCLUDE_FEI_END
{0, FEI82557_LOAD_FUNC, FEI82557_LOAD_STRING, FEI82557_BUFF_LOAN,
NULL, FALSE},
#endif /* INCLUDE_FEI_END */
*/
: : :
: : :
```
#### WARNING
Do not call `muxDevUnload()` for a network adapter managed by a VxBus driver. VxBus drivers expect to call `muxDevUnload()` themselves in their {vxbDrvUnlink}( ) methods, and instability may result if `muxDevUnload()` is called for a VxBus network device instance by other code.
#### SEE ALSO
The VxWorks Device Driver Developer’s Guide for more information about unloading VxBus devices
## SNARF Ethernet Driver
The SNARF Ethernet Driver is only needed if none of the Real-time Ethernet Driver can be used. The appropriate network adapter drivers have to be added to the VxWorks image.
## Setting up and running EcMasterDemo
1. VxWorks OS configuration
: See sections above.
2. Determine the network interface
: Using the command line option the network interface card and Real-time Ethernet Driver to be used in the example application can be determined.
3. Connection of the EtherCAT® SubDevices
: The SubDevices have to be connected with the VxWorks system using an Ethernet switch or a patch cable.
Local IT infrastructure should not be mixed with EtherCAT® modules at the same switch as the EC-Master will send many broadcast packets!
EtherCAT® requires a 100Mbit/s connection. If the VxWorks network adapter card does not support this speed a 100Mbit/s (!) Ethernet switch has to be used.
4. Download a Real-time Ethernet Driver module
: The Real-time Ethernet Driver library (e.g. `emllIntelGbe.out`) which contains hardware support for the corresponding NIC must be downloaded.
By default the Ethernet Driver emllSnarfGpp are contained in the binary delivery.
5. Download the example application
: The target has to be started and a target-server connection will have to be established. After this the example application can be downloaded into the target.
6. Set up an FTP server connection on host
: The demo application needs to load an XML file (`eni.xml`) for the configuration of the EC-Master. This file can be accessed using an FTP server. The screen shot below shows how to configure the FTP server.
The directory contents can be checked via FTP using the `ls` command. The file `eni.xml` will have to be accessed using the default directory.
7. Check for exclusive hardware access
: Be sure that the network adapter instance dedicated to EtherCAT® is not controlled by a VxWorks driver, this can be verified using:
```doscon
-> muxShow
```
If it is needed, first unload the driver using:
(e.g. first instance of the Intel Pro/100):
```doscon
-> muxDevUnload "fei", 1
```
(e.g. second instance of the Intel Pro/1000):
```doscon
-> muxDevUnload "gei", 2
```
(e.g. first instance of the Realtek 8139):
```doscon
-> muxDevUnload "rtl", 1
```
(e.g. first instance of the Realtek 8169):
```doscon
-> muxDevUnload "rtg", 1
```
(e.g. first instance of the FEC on Freescale iMX platform):
```doscon
-> muxDevUnload "motfec", 1
```
(e.g. first instance of the ETSEC on Freescale PPC platform):
```doscon
-> muxDevUnload "motetsec", 1
```
8. Run the example application
: The downloadable module `EcMasterDemo.out` has to be executed. The configuration file `eni.xml` will be used and thus has to be accessible in the current working directory.
The appropriate Real-time Ethernet Driver and network adapter card have to be selected.
If the log files shall be written the global variable `bLogFileEnb` has to be set to 1 prior to starting the demo.
Loading and running the demo:
```doscon
-> ld sp EcMasterAppMain,"-intelgbe 1 1 -f eni.xml"
```
Example:

#### SEE ALSO
[Running EcMasterDemo](gettingstarted_running-demo.html.md#running-ecdemo)
## OS Compiler settings
Besides the general settings from [Compiling the EcMasterDemo](gettingstarted_compiling.html.md#compile-ecdemo) the following settings are necessary to build the example application for VxWorks.
Extra include paths
: ```default
/SDK/INC/VxWorks
/Examples/Common/VxWorks
```
Extra source paths
: ```default
/Examples/Common/VxWorks
/Sources/OsLayer/VxWorks
```
Extra library paths to the main EtherCAT® components
: ```default
/SDK/LIB/VxWorks/
```
GNU/PowerPC
: `-mlongcall` compiler option may be needed to avoid relocation offset errors when downloading `.out` files.