DeviceMaster Software Developer Kit Installing eCos

You can install one of the following eCos libraries for the SDK:

  • Pre-compiled version of eCos configured for the DeviceMaster. You may use this library to develop eCos applications without having to build eCos from its sources.

  • Optionally, you can install eCos sources and build the complete eCos libraries from the sources. The complete sources used to build the pre-compiled eCos binaries and the configuration file that was used to build the pre-compiled eCos binaries are in the eCos\Source directory. The eCos/Source/ecos.tar.gz file contains eCos source tree including Comtrol serial and Ethernet drivers. The eCos/Source/ecos.ecc file is the eCos configuration used to build binaries included in the SDK distribution.

Installing the Pre-Compiled (Binary) eCos Libraries

The install.tar.gz file contains the pre-built eCos files needed to build applications for the DeviceMaster.

To install the pre-built eCos libraries and include files, un-tar them to a desired location. The following example represents the procedure if the install.tar.gz file is in the user's home directory and they are to be installed in /home/my-proj/ecos.

$ mkdir -p /home/my-proj/ecos 
$ cd /home/my-proj/ecos
$ tar xzf ~/install.tar.gz

This will create an install directory that contains lib and include directories that contain the eCos library and included files, respectively.

You can go to Sample Programs to build one of the provided sample applications.

Installing eCos Sources

Install the eCos sources on your system. This example uses /opt and assumes that the eCos sources are in the user's home directory, which will create a directory tree under /opt/ecos:

$ cd /opt
$ tar xzf ~/ecos.tar.gz

If you are planning on building eCos from source you will need to install an eCos configuration tool.

Installing the eCos Configuration Tool

Use one of the following sections to install an eCos configuration tool for your system, which is required if building eCos source.

Linux

To install the tool (ecosconfig), a Linux/i386 binary executable of eCos configuration utility, copy the ecosconfig file to a directory present in your PATH.

Before attempting to build eCos, you should read the eCos User's Guide (A4 version available). To install the eCos source files and build a new eCos configuration, see Installing eCos Sources and Building eCos.

Cygwin Configuration GUI Utility

Due to the rapid rate at which the Cygwin Configuration GUI is being developed, the GUI eCos configtool is no longer included in the Comtrol DeviceMaster SDK. If you wish to use the GUI configtool, please download it from eCosCentric.

Before attempting to build eCos using Configtool you should read the eCos User's Guide (A4 version). To install the eCos source files and build a new eCos configuration, see Installing eCos Sources and Building eCos.

Cygwin Command Line Configuration Utility

The eCos_Config_Tool\Cygwin\cmd_line directory contains the ecosconfig.exe file, a Cygwin binary executable of eCos configuration utility, which provides a command line user interface.

In the following procedure all paths are from the Cygwin root.

  1. Delete the ecosconfig file from \opt\ecos\tools\bin, which is the Linux ecosconfig tool that is replaced in this example.

  2. Execute the ecosconfig.exe file and set the target directory to \opt\ecos\tools\bin/.

  3. Add the configuration tool directory to your path by executing the following command at the Cygwin command line.

    PATH=$PATH":/opt/ecos/tools/bin"

  4. Add the above command to your .bash_profile to enable it's execution each time you start Cygwin. If you need more information on how to do that see Updating PATH.

Before attempting to build eCos using ecosconfig you should refer to the eCos User Guide (A4 version).

Building eCos

The following steps provide an example of how to build eCos.

  1. Verify that the previously installed eCos configuration tool is somewhere in your path. The following command shows the current PATH.

    $ echo $PATH

  2. Install the eCos sources somewhere. In this example, the source tar file is in the user's home directory and it installs the ecos sources in the users home directory as well.

    $ cd ~
    $ tar xzf ecos2src-sdk.tar.gz

    This creates a directory tree under ecos2src-sdk.

  3. Install the eCos configuration utility ecosconfig somewhere in your path.

  4. Create an empty directory for the build tree (ecos-build and in the user's home directory).

    $ cd ~
    $ mkdir ecos-build
    $ cd ecos-build

  5. If you need to add an eCos configuration tool to your path, you can do so with the following command, which shows a what path would look like using the Linux configuration tool.

    $ export ECOS_REPOSITORY=~/ecos2src-sdk

  6. Create a new eCos configuration for the DeviceMaster target platform using the newTree-2.0 script. If desired, you can add the line from Step 5) to the top of the newTree-2.0 script.

     $ ../newTree-2.0

    U CYGBLD_ISO_DIRENT_HEADER, new inferred value <cyg/fileio/dirent.h>
    U CYGBLD_ISO_OPEN_MAX_HEADER, new inferred value <cyg/fileio/limits.h>
    U CYGBLD_ISO_NAME_MAX_HEADER, new inferred value <cyg/fileio/limits.h>
    U CYGBLD_ISO_BSDTYPES_HEADER, new inferred value <sys/bsdtypes.h>
    U CYGBLD_ISO_NETDB_PROTO_HEADER, new inferred value <net/netdb.h>
    U CYGBLD_ISO_NETDB_SERV_HEADER, new inferred value <net/netdb.h>
    Settings: 
    cdl_option CYGPKG_IO_NFILE {user_value 256}
    cdl_option CYGNUM_FILEIO_NFILE {user_value 256}
    cdl_option CYGNUM_FILEIO_NFD {user_value 256}
    cdl_option CYGPKG_NET_MAXSOCKETS {user_value 256}
    cdl_component CYGSEM_KERNEL_SCHED_TIMESLICE {user_value 0}
    cdl_option CYGNUM_MEMALLOC_FALLBACK_MALLOC_POOL_SIZE {user_value 0x20}
    cdl_option CYGPKG_NET_MEM_USAGE {user_value 0x260000}
    cdl_option CYGPKG_NET_NUM_WAKEUP_EVENTS {user_value 40}
    cdl_option CYGPKG_DEVS_ETH_ARM_DMRTS_PHY_ADDR {user_value 1}
    cdl_option CYGPKG_NET_BUILD_HW_TESTS {user_value 1}
    cdl_option CYGSEM_HAL_DIAG_MANGLER {user_value None}
    cdl_option CYGPKG_NET_FREEBSD_INET6 {user_value 0}
    cdl_option CYGPKG_NET_FREEBSD_SYSCTL {user_value 1}
    cdl_component CYGPKG_DEVS_ETH_ARM_DMRTS_SWTXCRC {user_value 1}
            
    # set IP configuration for test/devel purposes.  These settings
    # are ignored by socketServer and devmast apps
    cdl_component CYGHWR_NET_DRIVER_ETH0_BOOTP        {user_value 0}
    cdl_component CYGHWR_NET_DRIVER_ETH0_DHCP         {user_value 0}
    cdl_component CYGHWR_NET_DRIVER_ETH0_ADDRS        {user_value 1}
    cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_IP        {user_value "10.0.0.101"}
    cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_NETMASK   {user_value "255.0.0.0"}
    cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_BROADCAST {user_value "10.255.255.255"}
    cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_GATEWAY   {user_value "10.0.0.1"}
    cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_SERVER    {user_value "10.0.0.1"}
    
    $

    This creates a directory tree and makefiles. The top level of the build directory now looks like this.

  7. Enter the following command.

    $ ls -l

    total 564
    drwxr-xr-x 4 grante users   4096 Jan  1 14:35 devs
    -rw-r--r-- 1 grante users 518641 Jan  1 14:35 ecos.ecc
    drwxr-xr-x 3 grante users   4096 Jan  1 14:35 error
    drwxr-xr-x 4 grante users   4096 Jan  1 14:35 hal
    drwxr-xr-x 3 grante users   4096 Jan  1 14:35 infra
    drwxr-xr-x 4 grante users   4096 Jan  1 14:35 install
    drwxr-xr-x 8 grante users   4096 Jan  1 14:35 io
    drwxr-xr-x 3 grante users   4096 Jan  1 14:35 isoinfra
    drwxr-xr-x 3 grante users   4096 Jan  1 14:35 kernel
    drwxr-xr-x 3 grante users   4096 Jan  1 14:35 language
    -rw-r--r-- 1 grante users   6282 Jan  1 14:35 makefile
    drwxr-xr-x 5 grante users   4096 Jan  1 14:35 net
    drwxr-xr-x 3 grante users   4096 Jan  1 14:35 services
  8. Perform the build.

    $ make

     make -r -C hal/arm/arch/current headers
     make[1]: Entering directory `/home/grante/ecos-build/hal/arm
     /arch/current'
     make[1]: Leaving directory `/home/grante/ecos-build/hal/arm
     /arch/current'
     make -r -C hal/arm/dmrts/current headers
     [...]
     headers finished
     make -r -C hal/arm/arch/current arm.inc
     make[1]: Entering directory `/home/grante/ecos-build/hal/arm
     /arch/current'
     arm-elf-gcc -finline-limit=7000 -mcpu=arm7tdmi -mbig-endian 
     -Wall -Wpointer-arith 
     -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual 
     -g -O2 -ffunction-sections
     -fdata-sections -fno-rtti -fno-exceptions    
     -I/home/grante/ecos-build/install/include
     -I/home/grante/ecos2src-sdk/hal/arm/arch/current -I/home/grante
     /ecos2src-sdk/hal
     /arm/arch/current/src -I/home/grante/ecos2src-sdk/hal/arm/arch/
     current/tests -I. -Wp,
     -MD,arm.tmp -o hal_mk_defs.tmp -S /home/grante/ecos2src-sdk
     /hal/arm/arch/current/src/hal_mk_defs.c
     fgrep .equ hal_mk_defs.tmp | sed s/#// > arm.inc
     make[1]: Leaving directory `/home/grante/ecos-build/hal/arm/
     arch/current'
     make -r -C services/memalloc/common/current 
     heapgeninc.tcl
     make[1]: Entering directory `/home/grante/ecos-build/
     services/memalloc/common/current'
     arm-elf-gcc -finline-limit=7000 -mcpu=arm7tdmi -mbig-endian
     -Wall -Wpointer-arith 
     -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual 
     -g -O2 -ffunction-sections 
     -fdata-sections -fno-rtti -fno-exceptions    -I/home/grante/
     ecos-build/install/include 
     -I/home/grante/ecos2src-sdk/services/memalloc/common/
     current -I/home/grante
     /ecos2src-sdk/services/memalloc/common/current/src 
     -I/home/grante/ecos2src-sdk
     /services/memalloc/common/current/tests -I. -Wp,
     -MD,heapgen.tmp -E /home/grante
     /ecos2src-sdk/services/memalloc/common/current/src/
     heapgen.cpp -o heapgeninc.tcl
     make[1]: Leaving directory `/home/grante/ecos-build/
     services/memalloc/common/current'
     make -r -C services/memalloc/common/current 
     heaps.cxx
     make[1]: Entering directory `/home/grante/ecos-build/
     services/memalloc/common/current'
     XPWD=`pwd` ; cd /home/grante/ecos2src-sdk/services/
     memalloc/common/current/src ; 
     sh heapgen.tcl "/home/grante/ecos-build/install" "$XPWD"
     make[1]: Leaving directory `/home/grante/ecos-build/
     services/memalloc/common/current'
     make -r -C hal/arm/arch/current build
     make[1]: Entering directory `/home/grante/ecos-build/
     hal/arm/arch/current'
     arm-elf-gcc -c  -I/home/grante/ecos-build/install/include 
     -I/home/grante/ecos2src-sdk
     /hal/arm/arch/current -I/home/grante/ecos2src-sdk/hal/
     arm/arch/current/src 
     -I/home/grante/ecos2src-sdk/hal/arm/arch/current/tests -I. 
     -I/home/grante/ecos2src-sdk
     /hal/arm/arch/current/src/ -finline-limit=7000 -mcpu=arm7tdmi 
     -mbig-endian -Wall 
     -Wpointer-arith -Wstrict-prototypes -Winline -Wundef  -g -O2 
     -ffunction-sections -fdata-sections  
     -fno-exceptions   -Wp,-MD,src/hal_misc.tmp -o src/hal_arm
     _arch_hal_misc.o /home/grante
     /ecos2src-sdk/hal/arm/arch/current/src/hal_misc.c
     arm-elf-gcc -c  -I/home/grante/ecos-build/install/include 
     -I/home/grante/ecos2src-sdk/hal
     /arm/arch/current -I/home/grante/ecos2src-sdk/hal/arm
     /arch/current/src -I/home/grante
     /ecos2src-sdk/hal/arm/arch/current/tests -I. -I/home/grante/
     ecos2src-sdk/hal/arm
     /arch/current/src/ -finline-limit=7000 -mcpu=arm7tdmi 
     -mbig-endian -Wall -Wpointer-arith 
     -Wstrict-prototypes -Winline -Wundef  -g -O2 
     -ffunction-sections -fdata-sections  -fno-exceptions   
     -Wp,-MD,src/context.tmp -o src/hal_arm_arch_context.o 
     /home/grante/ecos2src-sdk/hal
     /arm/arch/current/src/context.S
     [...]
     arm-elf-gcc -c  -I/home/grante/ecos-build/install
     include -I/home/grante/ecos2src-sdk/net
     /snmp/agent/current -I/home/grante/ecos2src-sdk/
     net/snmp/agent/current/src -I/home/grante
     /ecos2src-sdk/net/snmp/agent/current/tests -I. 
     -I/home/grante/ecos2src-sdk/net/snmp/agent/
     current/src/mibgroup/mibII/ -finline-limit=7000 
     -mcpu=arm7tdmi -mbig-endian -Wall 
     -Wpointer-arith -Wstrict-prototypes -Winline 
     -Wundef  -g -O2 -ffunction-sections -fdata-sections  
     -fno-exceptions   -D_KERNEL -D__ECOS
     -DIN_UCD_SNMP_SOURCE=1 -I/home/grante
     /ecos-build/install/include/ucd-snmp -Wp,
     -MD,src/mibgroup/mibII/vacm_vars.tmp -o src
     /mibgroup/mibII/net_snmp_agent_vacm_vars.o 
     /home/grante/ecos2src-sdk/net/snmp
     /agent/current/src/mibgroup/mibII/vacm_vars.c
     arm-elf-ar rcs /home/grante/ecos-build/install/
     lib/libtarget.a src/net_snmp_agent_agent
     _read_config.o src/net_snmp_agent_agent_
     registry.o src/net_snmp_agent_agent_trap.o 
     src/net_snmp_agent_kernel.o src/net_snmp_
     agent_mib_modules.o src/net_snmp_agent_
     snmp_agent.o src/net_snmp_agent_snmp_vars.o
     src/net_snmp_agent_snmpd.o src/net_
     snmp_agent_snmptask.o src/mibgroup/mibII/
     net_snmp_agent_helpers.o src/mibgroup
     /mibII/net_snmp_agent_system_mib.o src/
     mibgroup/mibII/net_snmp_agent
     _sysORTable.o src/mibgroup/mibII/net_snmp_
     agent_snmp_mib.o src/mibgroup
     /mibII/net_snmp_agent_icmp.o src/mibgroup/
     mibII/net_snmp_agent_interfaces.o src/mibgroup/
     mibII/net_snmp_agent_ip.o src/mibgroup/mibII/net_
     snmp_agent_tcp.o src/mibgroup/mibII/net_snmp_
     agent_udp.o src/mibgroup/net_snmp_agent_util_funcs.o 
     src/mibgroup/mibII/net_snmp_agent_dot3.o src/mibgroup/
     snmpv3/net_snmp_agent_usmStats.o src/mibgroup/
     snmpv3/net_snmp_agent_usmUser.o src/mibgroup/
     snmpv3/net_snmp_agent_snmpEngine.o src/mibgroup
     /mibII/net_snmp_agent_vacm_vars.o
     make[1]: Leaving directory `/home/grante/ecos-build
     /net/snmp/agent/current'
     make -r -C hal/common/current /home/grante/
     ecos-build/install/lib/extras.o
     make[1]: Entering directory `/home/grante/
     ecos-build/hal/common/current'
     arm-elf-gcc -finline-limit=7000 -mcpu=arm7tdmi 
     -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes 
     -Winline -Wundef -Woverloaded-virtual -g -O2 
     -ffunction-sections -fdata-sections -fno-rtti 
     -fno-exceptions   -nostdlib -Wl,-r -Wl,--whole-archive -o 
     /home/grante/ecos-build/install/lib/extras.o /home
     /grante/ecos-build/install/lib/libextras.a
     make[1]: Leaving directory `/home/grante/ecos-build/hal/common/current'
     make -r -C hal/arm/arch/current /home/grante/ecos-build/install/lib/vectors.o
     make[1]: Entering directory `/home/grante/ecos-build/hal/arm/arch/current'
     arm-elf-gcc -Wp,-MD,vectors.tmp  -I/home/grante/ecos-build/
     install/include -I/home/grante/ecos2src-sdk/hal/arm/arch/
     current -I/home/grante/ecos2src-sdk/hal/arm/arch/current/src 
     -I/home/grante/ecos2src-sdk/hal/arm/arch/current/tests -I. 
     -finline-limit=7000 -mcpu=arm7tdmi -mbig-endian 
     -Wall -Wpointer-arith -Wstrict-prototypes -Winline 
     -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections 
     -fdata-sections -fno-rtti -fno-exceptions   -c -o /home/
     grante/ecos-build/install/lib/vectors.o /home/grante/
     ecos2src-sdk/hal/arm/arch/current/src/vectors.S
     make[1]: Leaving directory `/home/grante/ecos-build/hal/arm/arch/current'
     make -r -C hal/arm/arch/current /home/grante/ecos-build/install/lib/target.ld
     make[1]: Entering directory `/home/grante/ecos-build/hal/arm/arch/current'
     arm-elf-gcc -E -P -Wp,-MD,target.tmp -xc  -I/home/grante/ecos-build/
     install/include -I/home/grante/ecos2src-sdk/hal/arm/arch/current 
     -I/home/grante/ecos2src-sdk/hal/arm/arch/current/src -I/home/
     grante/ecos2src-sdk/hal/arm/arch/current/tests -I. -finline
     -limit=7000 -mcpu=arm7tdmi -mbig-endian -Wall -Wpointer-
     arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual 
     -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions   
     -o /home/grante/ecos-build/install/lib/target.ld /home/grante/
     ecos2src-sdk/hal/arm/arch/current/src/arm.ld
     make[1]: Leaving directory `/home/grante/ecos-build/hal/arm/arch/current'
     build finished
     

You should now have an install directory containing include and library files. This directory is all that is needed to compile and build eCos applications.

The install directory tree should contain a large include directory tree and a lib directory containing a handful of files:

$ tree install

 install
 |-- include
 |    |-- arpa
 |    |   ....
 |    |   `-- tftp.h
 |    |-- assert.h
 |   ...
 |    |-- dhcp.h
 |    |-- dirent.h
 |    |-- dlfcn.h
 |    |-- errno.h
 |   ...
 |    |-- string.h
 |    |-- sys
 |   ...
 |    `-- unistd.h
 `-- lib
      |-- extras.o
      |-- libextras.a
      |-- libtarget.a
      |-- target.ld
      `-- vectors.o
 
 32 directories, 364 files

nice color