Project

General

Profile

EPICS IOC for Embedded Systems

Introduction

What follows is a description of a template IOC which can be used on any platform.

For embedded systems, the concept is that the embedded processor serves as a gateway to the outside world (either
EPICS guis and/or acnet). For example a SoC (System on Chip) is an arm processor and an FPGA on the same board.
The arm processor accepts any requests from the operator; these requests may be to initiate configurations and/or
processes to be accomplished on the arm and/or FPGA. It also performs any monitoring, again of processes on the
arm and/or the FPGA.

The expectation is that the FPGA developer already has a library of commands which are initiated by the processor.
This template is then modified to include these commands and make them available as PVs. It is also modified to
create PVs and populate their values (most data types and structures) to present to the operator. The IOC is then
rebuilt against these libraries.

Features of the template are:
  • heartbeat
  • IOC statistics (e.g. CPU usage, memory usage, etc.)
  • 20 Hz scan rate capability
  • use of aSub record (an EPICS Support module) for interfacing with IOC specific custom code (C/C++) libraries
  • access to acnet using acnetPV (Fermilab EPICS Support module)

Buildroot toolchains

Presently, all architecture/board software is cross-compiled with Buildroot on adlinux. These are

/usr/local/products/buildroot/ARCH-BOARD_generic/output/target/images

If you're using an SD card, the steps to prepare it are as follows:
  1. from adlinux.fnal.gov:/usr/local/products/buildroot/ARCH-BOARD_generic/output/target/images copy image file, dtb, rootfs.tar.gz to host server
  2. mount SD card
  3. copy image and dtb files to /boot
  4. untar rootfs.tar.gz to convenient directory
    1. rm -rf usr/local/epics usr/local/products /etc/host* /etc/fstab /etc/krb5.keytab /etc/network/interfaces
    2. deluser XXX for all users who will not have access
    3. cp resultant root filesystem to SD card /
  5. replace four configuration files (I keep a permanent copy of these):
    1. /etc/fstab
    2. /etc/hosts
    3. /etc/hostname
    4. /etc/network/interfaces #

EPICS Build

In what follows, EPICS is built as a 3-tiered system:
  1. EPICS base - base code and tools required for all EPICS installations
  2. EPICS Support - driver modules specific to field devices and/or tools
  3. EPICS IOC - input/output controller: built with base and specific Support modules particular to the task, plus custom code for controlling/monitoring front end

EPICS Infrastructure

The assumption for a Fermilab standard EPICS deployment is that EPICS base and Support are built in:
/usr/local/epics

Creating an EPICS build for specific architecture/board

EPICS base
/usr/local/epics/base
├── ./bin
│   ├── ./bin/linux-686_conc405x
│   ├── ./bin/linux-arm_achilles
│   ├── ./bin/linux-arm_raspberrypi2
│   ├── ./bin/linux-arm_terasicsoc
│   ├── ./bin/linux-ppc_mvme8100
│   └── ./bin/linux-x86_64
├── ./cfg
├── ./configure
│   └── ./configure/os
├── ./db
├── ./dbd
├── ./documentation
├── ./html
├── ./include
├── ./lib
│   ├── ./lib/linux-686_conc405x
│   ├── ./lib/linux-arm_achilles
│   ├── ./lib/linux-arm_raspberrypi2
│   ├── ./lib/linux-arm_terasicsoc
│   ├── ./lib/linux-ppc_mvme8100
│   ├── ./lib/linux-x86_64
│   ├── ./lib/perl
│   └── ./lib/pkgconfig
├── ./modules
├── ./src
├── ./startup
├── ./templates
└── ./test

EPICS Support

Accessing EPICS base & Support from embedded controller

Fermilab template IOC

Features of template IOC

  • 20 Hz operation scan rate
  • IOC status: computer statistics (e.g. CPU, memory, disk space)
  • Heartbeat
  • acnetPV - EPICS interface to acnet devices

Building template IOC

Deploying template IOC

Graphical Tools

Modifying template IOC for specific needs