Connect ISR by intConnect() - VxWorks

This is a discussion on Connect ISR by intConnect() - VxWorks ; I am using a StrongArm processor which has no on-chip interrupt controller. BSP provides 32 interrupt vectors with only 1 interrupt level, and I want to connect an ISR to Timer 4: .... 4 T1 Timer 1 5 T2 Timer ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Connect ISR by intConnect()

  1. Connect ISR by intConnect()

    I am using a StrongArm processor which has no on-chip interrupt
    controller. BSP provides 32 interrupt vectors with only 1 interrupt
    level, and I want to connect an ISR to Timer 4:
    ....
    4 T1 Timer 1
    5 T2 Timer 2
    6 T3 Timer 3
    7 T4 Timer 4
    ....

    Here is the code:
    ....
    void timerISR()
    {
    logMsg("\tin timer ISR ...\n", 0,0,0,0,0,0);
    }
    ....
    if ( intConnect(INUM_TO_IVEC(7), (VOIDFUNCPTR) timerISR, 0 ) == ERROR)
    {
    perror("connect ISR failed ...");
    return ERROR;
    }
    ....

    I also tried to add "intEnable(0);" or "intEnable(1);" though I am not
    sure if this is necessary, but it still doesn't work. Could anybody
    give me some suggestions if there is something wrong in the above code?
    Thanks!!!


  2. Re: Connect ISR by intConnect()

    Few remarks, David,

    1) Your ISR receives one integer parameter, hence it should be
    declared as:

    void TimerISR (int param)

    2) Try to play with intEnable: intEnable(7) or intEnable(0xff) - to try
    to enable all
    interrupts, after that consult your BSP manual since the parameter to
    be provided
    as the argument is BSP-specific in ARM

    HTH,
    Akiva Sadovski

    david :
    > I am using a StrongArm processor which has no on-chip interrupt
    > controller. BSP provides 32 interrupt vectors with only 1 interrupt
    > level, and I want to connect an ISR to Timer 4:
    > ...
    > 4 T1 Timer 1
    > 5 T2 Timer 2
    > 6 T3 Timer 3
    > 7 T4 Timer 4
    > ...
    >
    > Here is the code:
    > ...
    > void timerISR()
    > {
    > logMsg("\tin timer ISR ...\n", 0,0,0,0,0,0);
    > }
    > ...
    > if ( intConnect(INUM_TO_IVEC(7), (VOIDFUNCPTR) timerISR, 0 ) == ERROR)
    > {
    > perror("connect ISR failed ...");
    > return ERROR;
    > }
    > ...
    >
    > I also tried to add "intEnable(0);" or "intEnable(1);" though I am not
    > sure if this is necessary, but it still doesn't work. Could anybody
    > give me some suggestions if there is something wrong in the above code?
    > Thanks!!!



  3. Re: Connect ISR by intConnect()


    > david :
    >> I am using a StrongArm processor which has no on-chip interrupt
    >> controller. BSP provides 32 interrupt vectors with only 1 interrupt
    >> level, and I want to connect an ISR to Timer 4:
    >> ...
    >> 4 T1 Timer 1
    >> 5 T2 Timer 2
    >> 6 T3 Timer 3
    >> 7 T4 Timer 4


    The ARM only has one _primary_ interrupt level. It uses an interrupt
    hierarchy to handle multiple interrupts. You must have something like
    sysIntEnable(INT_TMR2) and sysIntConnect(INT_TMR2, my_int, parameter).
    It is also possible to make the "interrupt driver" so that you can use
    intEnable() and intConnect() with the sub-level of interrupts. With
    some ARM CPUs/controllers, there are even more levels. Most ARM
    processors use AMBA. Ie, the main interrupt controller is pretty
    standard.

    I would peruse your BSP directory for "INT_*". The BSP directory will
    have examples where the serial port and system timer are enabled. It
    is a good place to start looking.

    fwiw,
    Bill Pringlemeir.
    --
    Sex without love is a meaningless experience, but as meaningless
    experiences go, it's pretty damned good. - Woody Allen

    vxWorks FAQ, "http://www.xs4all.nl/~borkhuis/vxworks/vxworks.html"

+ Reply to Thread