Install Etherlabs IgH EtherCAT Master

  1. Execute the following command:
    cd external/ethercat
    ./bootstrap
    ./configure --sysconfdir=/etc --enable-8139too=no
    Note: If the headers is compiled in the source code on another host by using the command:
    make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- INSTALL_HDR_PATH=headers_path

    The error configure: error: Failed to find Linux sources. Use --with-linux-dir!”may occur while executing ‘./configure --sysconfdir=/etc --enable-8139too=no, simply add command: --with-linux-dir=/usr/src/linux-headers-xxx to direct the header path and resolve it.

  2. Executhe the following command:
    make
    make modules
    sudo make install
    sudo make modules_install install
    sudo depmod
    Note:

    Error: ‘unrecognized opcode `csrs sstatus,a5’, extension `zicsr' required’ may occur when executing: ‘make modules_install’. If this error occurs, the makefile in path: ‘${headers_path}/arch/riscv/’ need to be modified and add the following two lines of code before KBUILD_CFLAGS in the Makefile:

    toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zicsr_zifencei)
    riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei