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.

TMS320C64X+: Warning: CPU:Interrupt No. 4 dropped, an earlier interrupt is pending to be taken

The code is as follows... how to solve this issue? ... i am trying to set the port interrupt in the code to verify if the code works and executes the interrupt....

U32 looper;

S32 retError;

U32 lsbMPC;

U32 megaframe[] = {0x23,0x34,0x54,0x65};

U32 *trial = (U32*)mem;

U32 doorbelldata = 0x0;

U32 counter = 0x1000;

//////////////////////////////////

volatile U32 index, dummy_cnt;

    U8 lsu_no;

CSL_SrioContext context;

    CSL_Status status;

 

    CSL_SrioHandle hSrio;

    CSL_SrioObj   srioObj;

    CSL_InstNum   srioNum = 0;  /* Instance number of the SRIO */

    CSL_SrioParam srioParam;

 

    CSL_SrioDirectIO_ConfigXfr lsu_conf = {0};

    CSL_SrioDirectIO_ConfigXfr lsu_conf1 = {0};

    CSL_SrioPortData response;

CSL_IntcObj intcObj;

CSL_IntcHandle hIntc;

CSL_IntcGlobalEnableState state;

CSL_IntcEventHandlerRecord EventRecord;

CSL_IntcContext icontext;

CSL_IntcParam vectid = CSL_INTC_VECTID_4;

CSL_IntcEventId eventId = CSL_INTC_EVENTID_GPINT12;

CSL_IntcEventEnableState prevstate;

 

//////////////////////////////////

void (*x)(void) = c_int00;

 

    printf("%x\n",x);

 

    *trial = 0x0450;

/* ------- Set up PLL: set core clock to 1G HZ ----- */

printf("Initializing PLL1...");

InitPll(1);

printf("Done\n");

/*------- Test 1: setup / test GPIO ----------*/

printf("Testing GPIO, blink GREEN/RED led three times...");

TestGpio();

//TurnOnRedLed();

printf("Done\n");

/*--------- Init DDR2 ---------*/

printf("Init DDR2 memory...");

InitDdr2();

printf("Done\n");

/*--------- Interrupt setup ----------*/

// prevstate = CSL_intcEventEnable(eventId);

EventRecord.handler = &event63Handler;

EventRecord.arg = hIntc;

icontext.numEvtEntries = 0; /* number of events handled by intc */

icontext.eventhandlerRecord = &EventRecord;

status = CSL_intcInit(&icontext);

if(status != CSL_SOK){

return;

}

// CSL_intcGlobalNmiEnable();

CSL_intcGlobalEnable(&state);

hIntc = CSL_intcOpen(&intcObj,eventId,&vectid,NULL);

status = CSL_intcPlugEventHandler(hIntc,&EventRecord);

prevstate = CSL_intcEventEnable(eventId);

//returnVal = CSL_intcInterrupEnable(vectid1);

/*--------- Srio Config --------*/

#if 0

/* Unlock the powersaver control register */

    CSL_FINST (((CSL_DevRegs*)CSL_DEV_REGS)->PERLOCK, DEV_PERLOCK_LOCKVAL, UNLOCK);

 

    /* Enable the SRIO */

    CSL_FINST (((CSL_DevRegs*)CSL_DEV_REGS)->PERCFG0, DEV_PERCFG0_SRIOCTL, ENABLE);

 

 

    status = CSL_srioInit (&context);

 

hSrio = CSL_srioOpen (&srioObj, srioNum, &srioParam, &status);

    if (status != CSL_SOK) {

        printf("SRIO: ... Cannot open SRIO, failed\n");

        return;

    }

 

    /* Setup the source and destination */

 /*   for(index=0; index<TRANSFER_SIZE; index++) {

   src[index] = index + 0x1;

   dst[index] = 0;

}

*/

 

  for(index=0; index<TRANSFER_SIZE; index++) {

   src[index] = 0x12345678;

}

 

 

    /* Create an LSU configuration */

    lsu_conf.srcNodeAddr           = (U32)&src[0]; /* Source address */

    lsu_conf.dstNodeAddr.addressHi = 0;

    lsu_conf.dstNodeAddr.addressLo = 0xb0000000; /* Destination address */

    lsu_conf.byteCnt               = TRANSFER_SIZE;

    lsu_conf.idSize                = 0;               /* 8 bit device id */

    lsu_conf.priority              = 2;               /* PKT priority is 2 */

    lsu_conf.xambs                 = 0;               /* Not an extended

                                                          address */

    lsu_conf.dstId                 = SMALL_DEV_ID;

    lsu_conf.intrReq               = 0;               /* No interrupts */

    lsu_conf.pktType               = SRIO_PKT_TYPE_NWRITE;

                                                      /* write with no

                                                          response */

    lsu_conf.hopCount              = 0;               /* Valid for

                                                          maintainance pkt */

    lsu_conf.doorbellInfo          = 0;               /* Not a doorbell pkt */

    lsu_conf.outPortId             = 0;               /* Tx on Port 0 */

 

/* doorbell */

 

lsu_conf1.idSize                = 0;               /* 16 bit device id */

    lsu_conf1.priority              = 0;               /* PKT priority is 0 */

    lsu_conf1.xambs                 = 0;               /* Not an extended

                                                          address */

    lsu_conf1.dstId                 = SMALL_DEV_ID;

    lsu_conf1.intrReq               = 0;               /* No interrupts */

    lsu_conf1.pktType               = SRIO_PKT_TYPE_DOORBELL;

                                                      /* write with no

                                                          response */

    lsu_conf1.hopCount              = 0;               /* Valid for

                                                          maintainance pkt */

    lsu_conf1.doorbellInfo          = 0x0;               /* doorbell 0 */

    lsu_conf1.outPortId             = 0;               /* Tx on Port 0 */

 

 

    /* Configure the LSU1 and start transmission */

    lsu_no = SELECTED_LSU;

 

    for(looper = 0; looper < 256; looper++)

    {

    CSL_srioLsuSetup (hSrio, &lsu_conf, lsu_no);

/* Wait for the completion of transfer */

    response.index = lsu_no;

    do {

        CSL_srioGetHwStatus (hSrio, CSL_SRIO_QUERY_LSU_BSY_STAT, &response);

    }while(response.data == 1);

 

    lsu_conf.dstNodeAddr.addressLo = 0xb0000000+counter; /* Destination address */

    counter += 0x1000;

 

    }

//CSL_srioLsuSetup (hSrio, &lsu_conf1, 2);

/*

response.index = 2;

    do {

        CSL_srioGetHwStatus (hSrio, CSL_SRIO_QUERY_LSU_BSY_STAT, &response);

    }while(response.data == 1);

    }

*/

/* A delay, above checks seems to be not working

  may be because, it is a write operation with

  no response */

#endif   

TurnOffAllLeds();

TurnOnGreenLed();

 

TurnOnRedLed();

printf("done\n");

*trial = 0x64;

// while(1)

// {

// }

CSL_intcEventSet(eventId);

CSL_intcEventSet(eventId);

CSL_intcEventSet(eventId);

CSL_intcEventSet(eventId);

while(1)

{

}

return;

}

 

 

//void event63Handler(CSL_IntcHandle hIntc)

 

void event63Handler(void* hIntc)

{

static U32* ptr = (U32*)mem1;

static U32 value = 0x1;

CSL_IntcEventId eventId = CSL_INTC_EVENTID_GPINT12;

value++;

*ptr = value; 

CSL_intcEventClear(eventId);

}

 

 

  • Ok i realise that by only setting the interrupt once, the warning goes but the the interrupt does not occur....

  •  

    I also realise that the correct bit in the flag register is being set, So the interrupt handler is definitely not being called....

  •  

    main()

    {

    /* Intc variables declaration */

    CSL_IntcContext                 context; 

    CSL_IntcEventHandlerRecord      EventHandler[30];

    CSL_IntcGlobalEnableState       state;

    CSL_IntcEventHandlerRecord      EventRecord;

    CSL_IntcEventHandlerRecord      EventRecord1;

     

    /* Obj for combined events */

        CSL_IntcObj         intcObj;

        CSL_IntcObj         intcObj2;

        CSL_IntcObj         intcObj4;

        CSL_IntcObj         intcObj6; 

     

        /* Obj for combiner events */

        CSL_IntcObj         intcObj0;

        CSL_IntcObj         intcObj1;

        CSL_IntcObj         intcObj3;

        CSL_IntcObj         intcObj5; 

     

        CSL_IntcHandle      hIntc;

        CSL_IntcHandle      hIntc0;

        CSL_IntcHandle      hIntc1;

        CSL_IntcHandle      hIntc2;

        CSL_IntcHandle      hIntc3;

        CSL_IntcHandle      hIntc4;

        CSL_IntcHandle      hIntc5;

        CSL_IntcHandle      hIntc6; 

        CSL_Status          intStat;

        CSL_IntcParam       vectId;

        CSL_BitMask32       evtEn;

        Uint32              eventId;

        Uint32              evtClr;

        Uint32              idx;

    CSL_IntcEventHandlerRecord Record[128]; 

     

    /*--------- Interrupt setup ----------*/

        context.numEvtEntries = 128; 

        context.eventhandlerRecord = Record;

     

        /* Initializes the CPU vector table, dispatchr */

        intStat = CSL_intcInit(&context);

        if (intStat != CSL_SOK) {

            printf ("INTR: Initialization... Failed.\n");

            printf ("\tReason: CSL_intcInit failed. [status = 0x%x].\n", intStat);

        }

        else {

            printf ("INTR: Initialization... Passed.\n");

        }

     

        /* Enable NMIs */

        intStat = CSL_intcGlobalNmiEnable();

        if (intStat != CSL_SOK) {

            printf ("INTR: Global NMI Enable ... Failed.\n");

            printf ("\tReason: CSL_intcGlobalNmiEnable failed. [status = 0x%x]\n", 

                                                                         intStat);

        }

        else {

            printf ("INTR: Global NMI Enable... Passed.\n");

        }

     

        /* Enable Global Interrupts */

        intStat = CSL_intcGlobalEnable(&state);

        if (intStat != CSL_SOK) {

            printf ("INTR: Global Enable ... Failed.\n");

            printf ("\tReason: CSL_intcGlobalEnable failed. [status = 0x%x].\n", 

                                                                         intStat);

        }

        else {

            printf ("INTR: Global Enable... Passed.\n");

        }

    vectId = CSL_INTC_VECTID_5;

        hIntc1 = CSL_intcOpen (&intcObj1, CSL_INTC_EVENTID_EVT1, &vectId , NULL);

        if ((hIntc1 == NULL) || (intStat != CSL_SOK)) {

                printf ("INTR: Open... Failed.\n");

                printf ("\tReason: Error opening the instance. [status = 0x%x, \

                                            hIntc = 0x%x].\n", intStat, hIntc1);

     

        }

        else

            printf ("INTR: Open... Passed.\n");

    /* Clear the all events */

        for (idx = 0; idx < 4; idx++) {

            evtClr = ((CSL_IntcRegsOvly)CSL_INTC_0_REGS)->EVTFLAG[idx];

            ((CSL_IntcRegsOvly)CSL_INTC_0_REGS)->EVTCLR[idx] = evtClr;

        }

     

        eventId = 63;

     

    vectId = CSL_INTC_VECTID_COMBINE;

         hIntc2 = CSL_intcOpen (&intcObj2, (CSL_IntcEventId)eventId, &vectId, 

                                                                             NULL);

         EventRecord1.handler = (CSL_IntcEventHandler)&event63Handler;

         EventRecord1.arg = hIntc2;

         CSL_intcPlugEventHandler(hIntc2,&EventRecord1); 

         evtEn = (1<<(eventId-32));

     

         /* Note :- Combined events along with the combiner event all can be 

                    enabled in one API */

         intStat = CSL_intcHwControl(hIntc1,CSL_INTC_CMD_EVTENABLE,&evtEn);

         if(intStat != CSL_SOK) {

            printf("INTR: HwControl to enable event ... Failed.\n");

         }

         else

            printf("INTR: HwControl to enable event ... Passed.\n");

     

     

     

            /* Set events manually */

            intStat = CSL_intcHwControl(hIntc2,CSL_INTC_CMD_EVTSET,NULL);

            if(intStat != CSL_SOK) {

                printf("INTR: HwControl to set an event  ... Failed.\n");

            }

            else

                printf("INTR: HwControl to set an event ... Passed.\n");           

    eventId = 53;

     

    vectId = CSL_INTC_VECTID_COMBINE;

         hIntc3 = CSL_intcOpen (&intcObj3, (CSL_IntcEventId)eventId, &vectId, 

                                                                             NULL);

         EventRecord.handler = (CSL_IntcEventHandler)&event63Handler;

         EventRecord.arg = hIntc3;

         CSL_intcPlugEventHandler(hIntc3,&EventRecord); 

         evtEn = (1<<(eventId-32));

     

         /* Note :- Combined events along with the combiner event all can be 

                    enabled in one API */

         intStat = CSL_intcHwControl(hIntc1,CSL_INTC_CMD_EVTENABLE,&evtEn);

         if(intStat != CSL_SOK) {

            printf("INTR: HwControl to enable event ... Failed.\n");

         }

         else

            printf("INTR: HwControl to enable event ... Passed.\n");

     

     

     

            /* Set events manually */

            intStat = CSL_intcHwControl(hIntc3,CSL_INTC_CMD_EVTSET,NULL);

            if(intStat != CSL_SOK) {

                printf("INTR: HwControl to set an event  ... Failed.\n");

            }

            else

                printf("INTR: HwControl to set an event ... Passed.\n");   

     

    }

     

    void event63Handler(CSL_IntcEventId *event)

    {

    printf("INTR: EVENT Handler for event:%d\n",*event);

    CSL_intcEventClear(*event);

    }