4.4. Windriver VxWorks

Optimized Link Layers for VxWorks are available. If none of the optimized Link Layers can be used, the SNARF Link Layer must be selected.

The identification of the Link Layer is done like this:

4.4.1. VxWorks native

The BSP has to be prepared to support Optimized Link Layers:

  1. To use an optimized Link Layer the adapter memory has to be mapped into VxWorks memory space (VxWorks 5.x only). I.e. for the Intel Pro/100 Link Layer 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[]:

END_TBL_ENTRY endDevTbl [] =
    :       :       :
    :       :       :
    :       :       :
#endif /* INCLUDE_FEI_END */
    :       :       :
    :       :       :


Do not call muxDevUnload() for a device 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 network devices

4.4.3. Setting up and running EcSimulatorHilDemo

  1. VxWorks OS configuration

    See sections above.

  2. Determine the network interface

    Using the command line option the network interface card and Link Layer to be used in the example application can be determined.

  3. Connection of the EtherCAT slaves

    The slaves 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-Simulator will send many broadcast packets! EtherCAT requires a 100Mbit/s connection. If the VxWorks network adapter card does not support this speed an 100Mbit/s (!) Ethernet switch has to be used.

  4. Download a Link Layer module

    The Link Layer library (e.g. emllI8254x.out) which contains hardware support for the corresponding NIC must be downloaded. By default the Link Layers emllSnarfGpp are contained with 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 a FTP server connection on host

    The demo application needs to load a XML file (exi.xml) for the configuration of the master. This file can be accessed using a FTP server. The screen shot below show, how to configure the FTP server. The directory contents can be checked via FTP using the ls command. The file exi.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:


    If it is needed, first unload the driver using: (e.g. first instance of the Intel Pro/100):

    muxDevUnload "fei", 1

    (e.g. second instance of the Intel Pro/1000):

    muxDevUnload "gei", 2

    (e.g. first instance of the Realtek 8139):

    muxDevUnload "rtl", 1

    (e.g. first instance of the Realtek 8169):

    muxDevUnload "rtg", 1

    (e.g. first instance of the FEC on Freescale iMX platform):

    muxDevUnload "motfec", 1

    (e.g. first instance of the ETSEC on Freescale PPC platform):

    muxDevUnload "motetsec", 1
  8. Run the example application

    The downloadable module EcSimulatorHilDemo.out has to be executed. The configuration file exi.xml will be used and thus has to be accessible in the current working directory. The appropriate Link Layer 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:

    sp EcMasterAppMain,"-f exi.xml -i8254x 1 0 -v 2"

4.4.4. OS Compiler settings

The following settings are necessary to build the example application for VxWorks.

Extra include paths
Extra source paths
Extra library paths to the main EtherCAT components

VxWorks V6.1 .. V6.4: In case the SNARF Link Layer shall be used and ifconfig() is available -D IFCONFIG_SUPPORT has to be set.

GNU/PowerPC: -mlongcall compiler option may be needed to avoid relocation offset errors when downloading .out files.