1# @Time    : 2019-11-30
2# @Language: Markdown
3# @Software: VS Code
4# @Author  : Di Wang
5# @Email   : [email protected]

Build MRF EVR230 on vxWorks

This file is a guide to build your own MRF Timing IOC on vxworks as well as write your own device support to meet your own demand of EPICS record.

Some links might be helpful:

Requirements

  • EPICS Base >= 3.14.8.2
  • devLib2 (2.9)
  • MSI (Macro expansion tool) Required with Base < 3.15.1

Build mrfioc2

Download mrfioc2-2.2.0.tar.gz and extract to directory, name as “mrfioc2-2.2.0”

Download devlib2-2.9.tar.gz and extract to directory name as “devlib2-2.9”

devlib2:

edit file: configure/RELEASE

Add EPICS base full path

run make

mrfioc2

edit file: configure/RELEASE

Add EPICS base full path and DEVLIB2 path e.g. DEVLIB2=$(EPICS_BASE)/modules/devlib2-2.9

run make

Create EVR application

1# use these command to create the IOC
2$EPICS_BASE/bin/$EPICS_HOST_ARCH/makeBaseApp.pl -t ioc temp
3$EPICS_BASE/bin/$EPICS_HOST_ARCH/makeBaseApp.pl -i -t ioc -p temp temp
4# The following target architectures are available in base:
5    linux-x86_64
6    vxWorks-ppc604_long
7What architecture do you want to use? vxWorks-ppc604_long
8# Then you should get below files in the directory
9configure  iocBoot  Makefile  tempApp

edit file: configure/RELEASE

Add DEVLIB2, MRFIOC2 and EPICS_BASE full path

Then write your own database file and device support file if needed. (Talked later)

Modify following files with the instruction of the simple example of Device Support.

***App/src/Makefile

***App/Db/Makefile

edit file:**App/src/Makefile

1for EVR (mrfioc2)
2***_DBD += mrfCommon.dbd drvemSupport.dbd
3***_DBD += evrSupport.dbd mrmShared.dbd
4
5for devlib2
6***_DBD += epicsvme.dbd epicspci.dbd
7
8***_LIBS += evrMrm mrmShared evr mrfCommon
9***_LIBS += epicspci epicsvme

edit file:iocBoot/ioc**/st.cmd

1# id, slot(1 org), base Adr, level, vector
2mrmEvrSetupVME("tstEVR", 3, 0x08000000, 5, 0xc0)

run make

run this IOC on vxWorks

How to write your EPICS own device support

You need to Add these files:

1***App/src/devYourdevsup.c
2***App/src/devYourdevsup..h
3***App/src/Yourdbd.dbd
4***App/Db/Yourdb.db

And edit

1***App/src/Makefile
2***App/Db/Makefile
3iocBoot/ioc***/st.cmd

For example, I changed the static long read_wf(waveformRecord *prec) function from the original

epics-base-master/src/std/dev/devWfSoft.c file

and add my feature (make it possible to storage String type array in a waveform record).

My EventWf-IOC on GitHub

Note this IOC runs on Windows 10

1***App/src/devEventWf.c
2***App/src/devEventWf.h
3***App/src/eventWf.dbd
4***App/Db/eventWf.db

In the ***App/src/Makefile file, add:

1LIBRARY_IOC += eventWf
2DBD += eventWf.dbd
3eventWf_SRCS += devEventWf.c
4eventWf_LIBS += $(EPICS_BASE_IOC_LIBS)
5***_DBD += eventWf.dbd
6myapp_LIBS += eventWf

In the ***App/Db/Makefile file, add:

1DB += eventWf.db

In the iocBoot/ioc***/st.cmd file, add your db.

run make