EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Error msg
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Mon, 13 Jun 2016 10:30:24 -0500
Hi Stefen,

On 06/13/2016 01:13 AM, Stefen Paul wrote:
> *Message-1:*
> 
> ld 0,0, "app1.munch"
> 
> BSP routine sysAtReboot() not found, epicsExit() will not be called by
> reboot.  For reduced functionality, call
> rebootHookAdd(epicsExitCallAtExits)

This is a message from the EPICS code warning you that if you want the
IOC to be able to close its network sockets nicely in response to a
Ctrl+X reboot, you need to make a minor change to your VxWorks source
code. The change is optional, the IOC will work fine without it, but
with it any CA clients will be notified about the IOC rebooting sooner,
and some older network-attached devices using Asyn might not recover
from the IOC rebooting without themselves needing a reboot unless you
add it.

The description of this change at
http://www.aps.anl.gov/epics/tech-talk/2005/msg00004.php was written for
older VxWorks versions; for recent VxWorks 6.x versions I copy the
attached apsRebootHook.c file to
  $(WIND_HOME)/vxworks-$(VXWORKS_VERSION)/target/config/comps/src
and then add the following components to my build:

Folder FOLDER_EPICS {
    NAME	EPICS Components and Configuration
    SYNOPSIS	Additional components for APS use. \
    _CHILDREN	FOLDER_ROOT
}

Component INCLUDE_EPICS_REBOOTHOOK {
    NAME	Early RebootHook capture
    SYNOPSIS	Run sysRebootHook before the network shuts down.
    CONFIGLETTES apsRebootHook.c
    INIT_RTN	rebootHookAdd(sysRebootHook);
    _INIT_ORDER	usrRoot
    INIT_AFTER	usrKernelExtraInit
    INIT_BEFORE	usrNetworkInit
    _CHILDREN	FOLDER_EPICS
    _DEFAULTS	FOLDER_EPICS
}

Copy the above component definitions into a new file
 $(WIND_HOME)/vxworks-$(VXWORKS_VERSION)/target/config/comps/vxWorks/50folder_epics.cdf
then close and reopen your VxWorks Image Project inside Workbench and
you should be able to see and add the above components to your the
Kernel Configuration.


> *Message-2:*
> 
> iocInit
> Starting iocInit
> ############################################################################
> ## EPICS R3.14.12.4 $Date: Mon 2013-12-16 15:51:45 -0600$
> ## EPICS Base built Oct 16 2014
> ############################################################################
> WARNING: OS Clock time was read before being set.
> Using 1990-01-02 00:00:00.000000 UTC
> iocRun: All initialization complete
> value = 0 = 0x0
> 
> Any clues regarding these messages .... may be we need to set the time
> properly for the second case.

Does the IOC ever get the correct time after that?

As Mark Rivers said unless you have configured it otherwise the EPICS
code will ask the boot host for the time using the NTP protocol, but you
can override that and specify a different host for NTP by setting the
environment variable EPICS_TS_NTP_INET with the IP address of the
correct server.

Recent versions of VxWorks also have a built-in time synchronization
task which you can configure while building the OS. In Base-3.15.4 and
later we don't start our own NTP sync task if the OS task is already
running, in which case the above environment variable will never be
used, so you'll want to make sure you have the OS configuration
variables set properly.

HTH,

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon
/* apsRebootHook.c - Initial Reboot Hook capture */

/*
 DESCRIPTION
 This file gives EPICS the ability to run code before the network shuts down,
 and also runs the C++ static destructors of all loaded modules.

 SEE ALSO: 

 NOMANUAL
 */

/* includes */

#include "apsLib.h"

/* globals */

VOIDFUNCPTR _func_sysRebootHook = NULL;

/*******************************************************************************
*
* sysRebootHook - hook routine to call the application shutdown code
*
* This is the routine registered as a reboot hook which calls the
* application's shutdown function and then the C++ destructors.
*
* RETURNS: OK
*
* NOMANUAL
*/

LOCAL STATUS sysRebootHook(int startType)
    {
    if (_func_sysRebootHook)
	(*_func_sysRebootHook)();
    cplusDtors(0);
    return OK;
    }

/*******************************************************************************
*
* sysAtReboot - register an application shutdown function
*
* An application uses this routine to register a shutdown function
* which will be called before the OS disables functionality such as
* the network layer.  This is not possible using rebootHookAdd, which
* executes the hook routines in the order registered so the OS gets
* the first bite of the apple.
*
* RETURNS: OK, or ERROR if a routine is already registered.
*/

STATUS sysAtReboot(VOIDFUNCPTR closedown)
    {
    if (closedown && _func_sysRebootHook)
	return ERROR;
    _func_sysRebootHook = closedown;
    return OK;
    }

Replies:
Re: Error msg Stefen Paul
References:
Error msg Stefen Paul
Re: Error msg Dirk Zimoch
Re: Error msg Dirk Zimoch
Re: Error msg Stefen Paul

Navigate by Date:
Prev: RE: Error msg Mark Rivers
Next: RE: Merlin and AreaDetector Gofron, Kazimierz
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Error msg Mark Rivers
Next: Re: Error msg Stefen Paul
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·