Experimental Physics and
| |||||||||||||||||
|
David DeBonis wrote: We are working on an embedded EPICS IOC deployment but are running into some confusion on what is necessary to build to our target architecture which is ARM running a linux kernel 2.6.x. We have our own cross-compilers that we would like to use and build with but we seem to be running into issue with some post-build executables that need to be run on the target. You've probably come across the issue with the CA Repeater. All IOCs contain the CA Client library, and when it starts up the client library looks for a running CA Repeater on the localhost network interface. If it doesn't find one, it will fork and attempt to exec the caRepeater binary. In the case of a purely embedded IOC you have two choices about how to solve this issue and prevent the warning message that appears if the exec is unsuccessful. The simplest solution is to include the caRepeater on your target disk partition and arrange for it to be run before the IOC starts. It should never exit even if the IOC does, so it should never need restarting. With this solution you will need to include the caRepeater executable on the target as well as the ioc itself. The alternative solution is to explicitly start the repeater as a separate thread within the IOC's main() program. This may use slightly fewer resources than when running it in a separate process (not least because you don't need the separate caRepeater executable), but it is a little more complicated to set up as it requires adding some lines to main(), and it is not guaranteed to work unchanged on different versions of EPICS Base since the caRepeaterThread() routine is not an official API. The code you would need is as follows: #include "epicsThread.h" extern "C" void caRepeaterThread (void *); epicsThreadCreate("CAC-repeater", epicsThreadPriorityLow, epicsThreadGetStackSize(epicsThreadStackMedium), caRepeaterThread, 0); That epicsThreadCreate() call should appear at the top of the main() definition in your IOC's xxxApp/src/xxxMain.cpp file. You should be able to do what you want using a linux-arm cross-compiler to generate a fully stand-alone ioc executable (and caRepeater if you chose the first option above). You might also want to experiment with statically linking against the EPICS libraries, for which there are controls in the EPICS build system to turn off building shared libraries (make sure you remove the lib*.so files from your lib/linux-arm directories if you do that). If you stick with the shared libraries, you'll need to copy them all to the target as well as the executables, and be aware of the issues of the runtime search path to find them all. HTH, - Andrew -- When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong. -- Arthur C. Clarke
| ||||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |