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  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Interrupt problem.
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: Francisco Ramos <framoslandaeta at gmail.com>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Wed, 26 Jan 2022 02:41:50 +0000
On Jan 25, 2022, at 1:43 PM, Francisco Ramos <framoslandaeta at gmail.com> wrote:

    Regarding the “spurious interrupt”, I was searching for information about it and trying to understand the problem. Yesterday, I created an IOC only with the Bancoom driver to isolate the problem, where the IOC only initializes the Bancom driver and the error appears again. The BC635VEC macro expands out to 0x40.

    The driver, after associating the isr_bc635 function with the interrupt, disables the system clock because it will use the one provided by Bancomm. To do this, it calls the sysClockOff function which calls directly to the rtems function BSP_disconnect_clock_handler(). Perhaps this is causing the exception. The system does not return the prompt and keeps showing the message "spurious interrupt: 32" indefinitely.  

So it sounds like the vector 32 is your system clock tick, and calling BSP_disconnect_clock_handler() looks to be the wrong thing to do (it is disconnecting the handler, but isn't disabling the periodic tick interrupt first).

You would need to ask the RTEMS experts if it’s possible and how to replace the internal clock tick handler with your own dynamically at runtime like that, which is what you’re apparently doing there.

- Andrew


    Honestly, thank you very much Andrew for your help in solving the problems I have been encountering. It is appreciated!

#define BC635VEC    0x40    

void sysClockOff(void)
{
   #if defined  (__rtems__)
      BSP_disconnect_clock_handler();
    #endif
   #if defined (vxWorks)
      sysClkDisable();
   #endif
}

int bcClkRateSet (int intPerSecond, int intPerTick)
{
     /* Set up periodic pulse frequency */
    if (intPerSecond > 0)
    {
       ….    
         /* Ensure interrupt source enabled */
        pbc635->mask = pbc635->mask | 0x02;
        /* Clear interrupt status */
        pbc635->intstat = pbc635->intstat | 0x02;
        /* Save tick frequency value */
        tickFrequency = intPerSecond/bcIntPerTick;
        bcUseper = TRUE;                 /* Set flag to use BC periodics */
        sysClockOff();                   /* disable system clock */
        clock_rate_set(tickFrequency);   /* set system tick rate */
    }
    else
    {        
         /* re-enable system clock */
        sysClockOn();
        ….
}

Regards,

El lun, 24 ene 2022 a las 21:26, Johnson, Andrew N. (<anj at anl.gov>) escribió:
Hi Francisco,

On Jan 24, 2022, at 2:53 PM, Francisco Ramos via Tech-talk <tech-talk at aps.anl.gov> wrote:

I am writing to see if you can help or guide me to find a solution for the error I am having with the "Bancomm 365" driver. We are migrating the module to EPCIS version 7.0.6.1. with rtems5. The driver works correctly for version 3.14.12.8 and RTEMS 4.10. 

When I boot the driver I get the "spurious interrupt: 32" error.  This implies that the function (isr_bc635) associated with the interrupt is never called. In this case, the Bancomm card should issue an interrupt for each tick periodically. 

The error “spurious interrupt: 32” would imply to me that the CPU was seeing an interrupt on vector 32 but that it doesn’t have an interrupt service routine associated with that vector number. Does your macro BC635VEC expand out to 32? Has your bc635IntEnable() routine actually been run at the point when you are seeing the error message?

I assume you have already applied the patch to the epicsEvent API found in the GitHub PR #206 which is essential to be able to call epicsEventSignal() from an ISR on RTEMS-5.1. I just merged that PR into the 7.0 branch earlier today.

HTH,

- Andrew



Thank you very much in advance.


int bc635IntEnable (const epicsUInt16 signal, const char *parm )
{
         ……

        /* Connect bc635 interrupts */
        if( (status = devConnectInterruptVME(BC635VEC, isr_bc635, NULL) ) != OK )
        {
            errMessage(status, "BC635 error - unable to connect\n");
            return status;
        }
        pbc635->vector = BC635VEC;      /* Interrupt vector */
        pbc635->level = BC635LVL;       /* Interrupt level */

        /* Enable interrupts on this level */
        status = devEnableInterruptLevel( intVME, BC635LVL );
        if( status )
            printf("Enabling Bancomm interrupts failed\n");
        init = TRUE;
    }
    ……
}

void isr_bc635 (void *p)
{
   /* First check for periodic interrupt */
   if ( ((pbc635->intstat & 0x02) & pbc635->mask) != 0)
   {
    ……
   }

   /* let a high priority task deal with the other interrupts */
   epicsEventSignal(intSvc);
}

Regards,

-- 
Complexity comes for free, simplicity you have to work for.


-- 
Complexity comes for free, simplicity you have to work for.


References:
Interrupt problem. Francisco Ramos via Tech-talk
Re: Interrupt problem. Johnson, Andrew N. via Tech-talk
Re: Interrupt problem. Francisco Ramos via Tech-talk

Navigate by Date:
Prev: could you tell me how to cancel the toolbar when I deploy a opi file in tomcat by webopi3.3 ? 朱晨晨 via Tech-talk
Next: Use of asyn's setInterruptUInt32Digital in EPICS device support Jure Varlec via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: Interrupt problem. Francisco Ramos via Tech-talk
Next: Adding a second output array to an areaDetector IOC Iain Marcuson via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·