Title: EPICSRTEMS at NSLS
1 EPICS/RTEMS at NSLS
- S. Kate Feng
- EPICS Meeting at DLS, UK
- June 19, 2003
1
2Projects that use EPICS at NSLS
- DUV-FEL accelerator (only one beamline)
- I began to implement EPICS/VxWorks in 2000
- 400 nm SASE achieved in February, 2002
- 266 nm HGHG achieved in October, 2002
- Currently in operation for users
- NSLS beamlines (currently gt 10)
- Peter Siddons and Ivan So began to implement
EPICS/VxWorks in 2000 - Peter Siddons proposed to use RTEMS for beamline
applications
2
3EPICS/RTEMS at NSLS
- I began the project in October, 2002
- Development platform is Linux RedHat 7.3
- EPICS 3.14 IOC test platform is RTEMS
- Evaluated cexp vs. esh for RTEMS dynamic loading
- cexp is ideal for run-time dynamic loading plus
other nice features - esh would be a good debugging tool (e.g.
breakpoint and single step) if it is fully
developed as promised. All the run-time modules
to be loaded have to be pre-mounted into the IMFS
file system via a makefile before running
3
4Sample features as of June 10, 2003
4
5RTEMS IOC configuration at NSLS
- RTEMS IOC configuration
- CPU MVME2306
- RTEMS gcc-3.2.2, newlib-1.11.0, rtems-4.6.0pre3
- RTEMS image download bootp/tftp
- Shell rtems-cexp for dynamic loading (T.S.,
SSRL) - Remote login telnetd (Till Straumann, SSRL,
SLAC) - Portability RTEMS devLib.c (T.S., SSRL), epics
threads, epicsMutex, and so on (Eric Norum, APS) - EPICS 3.14.0beta2 (Marty Kraimer, APS, and Jeff
Hill LANL)
5
6EPICS 3.14 OSI for the DUV-FEL project
- Radiation monitor IOC (needed for operation)
- Tested on the RTEMS and Tornado2.02 platform
- Used epicsTime thread instead of routines from
drvTS.c - drvXVme293.c driver for the MVME293 counter
- devWFXvme293.c radiation counts at various
locations - devWF30secTotal.c average radiation dose every
30 seconds at various locations - devWFHourTotal.c total radiation dose hourly at
various locations - devWFWorkdayTotal.c total radiation dose during
an eight-hour workday at various locations -
6
7EPICS/RTEMS for NSLS beamlines
- Added OSI over the beamline device/driver
routines from the R3.13.x release and tested
successfully on the RTEMS platform for the bitIO,
scaler and OMS58 motor controller - stdApp (50)
- motorApp
- Collaborating with Mark River, Time Mooney and
others from APS to install and test the
up-to-date beamline device/driver routines
7
8What did I modify in EPICS 3.14?
- I modified the registerRecordDeviceDriver.pl file
so that I could continue the scheme of dynamic
loading to load the Record/Device/Driver for
stdApp and motorApp in the startup script - Instead of registerRecordDeviceDriver(pdbase) for
both the stdApp and motorApp, I used - std_registerRecordDeviceDriver(pdbase)
- motor_registerRecordDeviceDriver(pdbase)
-
8
9Excerpt of the RTEMS startup script
cexpModuleLoad("std.obj") cexpModuleLoad("motor.ob
j) vmeUniverseInit() devAvme9440Config(1,0x8000,0
x80) VSCSetup(1, 0x20000000, 200) oms58Setup(1,
8, 0xa000, 190, 7,0.2) dbLoadDatabase("../dbd/std.
dbd") std_registerRecordDeviceDriver(pdbbase) dbLo
adDatabase("../dbd/motor.dbd") motor_registerRecor
dDeviceDriver(pdbbase) dbLoadRecords("../db/Acroma
g_16IO.db","PKate,AB1") dbLoadRecords("../db/Js
caler.db","PKate,Sscaler1,C0") dbLoadTemplate(
"../db/motor.substitutions") dbLoadRecords("../db/
scanParms.db","PKate,Qm10,SCANREC(P)scan1,POS
(Q).VAL,RDBK(Q).RBV") iocInit()
9
10Next step
- To install and test RTEMS NFS (Till Straumann,
SSRL) so that we can use EPICS save_restore (Tim
Mooney, APS) - To find a different VME/CPU board to run RTEMS in
the event that Motorola discontinues the MVME230x
board -
10
11RTEMS-specific issues that I encountered
- Most of the RTEMS-specific issues are
transparent over the EPICS OSI. The
RTEMS-specific issues I dealt with were very
minor. For example - Use strtok instead of strtok_r for strict ANSI C
- I/O Ops. in_8(), in_be16(), ....out_be32() for
PPC - The NTP client for RTEMS reads only the GMT time.
An easy workaround is to change the value of
rtems_bsdnet_timeoffset in the osdTime.cpp file
to offset the local time. -
11
12Summary
- While RTEMS is lacking in source level debugging
tools, the existing EPICS OSI/RTEMS/CEXP packages
are sufficient for us to port the IOC
applications to RTEMS. - As of today, RTEMS meets the requirements of our
real-time IOC applications. The challenge to its
wider use lies in its limited range of BSPs.
12