This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

The overflow in the use of CSL_intcPlugEventHandler during the intc configuration



Hi TI engineer

         I try to configure the intc in my project by CSL function, code like this:

         #define MAX_INTR_NUM  16

         CSL_IntcContext             intcContext;

         CSL_IntcEventHandlerRecord  EventRecord [MAX_INTR_NUM ] ;

        void  intc_init(void)

{

intcContext.eventhandlerRecord = EventRecord ;
intcContext.numEvtEntries = MAX_INTR_NUM ;

...........

for ( intrIndex = 0;  intrIndex < MAX_INTR_NUM , intrIndex ++)

{

EventRecord[intrIndex  ] .handler =  ISR[intrIndex   ]
EventRecord[intrIndex ] .arg = NULL

CSL_intcPlugEventHandler(hintc,&EventRecord[intrIndex ])

}

........

}

         The code above works OK except that a bug like this:

         set eventRecord[0]  =   {  isr0,    null     };

         do CSL_intcPlugEventHandler;

          then I find that    eventRecord[1]  become    {  isr0,    null     };  ?!

         next step if I set eventRecord =  {  isr1,    null     };  then the ISR0 will be invalid!  

         So I read the CSL_intcPlugEventHandler code, not so easy to understand, but I still cannot tell why  does CSL_intcPlugEventHandler(hintc,&EventRecord[0]) change the value of  eventRecord[1]? Why does the change of  eventRecord[1] make isr0 invalid?

         Looking forward to your reply,thank you very much

  • Hi Yuchao,
    I did not understand the bug reported here. I would recommend you to debug the application by setting the breakpoints and watch window.
  • Hi Rajasekaran
    Sorry to reply you so late for I have some other things to deal with this months.
    The bug I have described still exists, well, If now I want to create 2 interrupt events, their serivice function is ISR1 and ISR2:
    /**************************************code start*************************************************/
    CSL_IntcContext intcContext;
    CSL_IntcEventHandlerRecord EventRecord [16] ;

    intcContext.eventhandlerRecord = EventRecord ;
    intcContext.numEvtEntries = MAX_INTR_NUM ;

    EventRecord[0].handler = ISR1; ( assume its addr is 0x00804000 )
    EventRecord[0].arg = NULL

    EventRecord[1].handler = ISR2; ( assume its addr is 0x00805000 )
    EventRecord[1].arg = NULL

    then I call:
    CSL_intcPlugEventHandler( hintc,&EventRecord[0] )
    CSL_intcPlugEventHandler( hintc,&EventRecord[1] )
    /**************************************code end*************************************************/
    Until now, do you think there is any wrong operation?
    After these operation , I find that 2nd interrupt doesn't be serviced, then I found that:
    before I call "CSL_intcPlugEventHandler( hintc,&EventRecord[0] ) ",
    EventRecord[] = { ISR1,NULL} , { ISR2,NULL}
    after it , EventRecord has been changed to:
    EventRecord[] = { ISR1,NULL} , { ISR1,NULL}
    It means that:
    the operation "CSL_intcPlugEventHandler( hintc,&EventRecord[0] )" changed the value of EventRecord[1] like this:
    EventRecord[1] = EventRecord[0]
    But it should't be this ,isn't it? I read the function CSL_intcPlugEventHandler,I just can't understand it. Well, could you understand my question now? Looking forward for your reply, thank you very much.
    Regards,
    Yuchao.