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.

[C6748] No interrupt from event 19 flag ( USB0 controller )

Other Parts Discussed in Thread: TMS320C6748, OMAPL138

OMAP L138 EVM      with   TMS320C6748 SOM-M1.

If I set flag event 19 to 1, interrupt don't generated.

But,   I see that interrupt is generated after reset  bits 14-8 in INT_MUX1   from 0x13 to 0x00.

Where is my mistake ?

 

 

   CSR &=  0xFFFFFFFE;   ICR = 0xFFF0;      EVTCLR0 |= 0x00080000;   // clear  event19  flag
    INT_MUX1 &= 0xFFFF00FF;           INT_MUX1 |= 0x00001300;  // int_sel5 (14-8 bits) event19 (USB0_INT  DSP)
count= 0;              ISTP = (unsigned int)intcVectorTable;         ICR = 0xFFF0;     IER = 0x000000F3;    CSR |=  0x00000001;

 

for (ii=0; ii<1000; ii++){                  EVTSET0 |= 0x00080000;   // set  event19  flag    // No interrupt !!!

for (jj=0; jj<100; jj++){ kk += jj;  if (kk > 100) kk= 0; };
};

//  No interrupt:     count==0 !!!

 

    INT_MUX1 |= 0x00001300; // int_sel5 (14-8 bits) event19 (USB0_INT  DSP)

for (ii=0; ii<1000; ii++){
    EVTSET0 |= 0x00080000;   // set  event19  flag
    INT_MUX1 &= 0xFFFF00FF;    // interrupt  !!!

    INT_MUX1 |= 0x00001300; // int_sel5 (14-8 bits) event19 (USB0_INT  DSP)  
for (jj=0; jj<100; jj++){ kk += jj;  if (kk > 100) kk= 0; };
};

//   count == 1000 !!!

 

for (ii=0; ii<1000; ii++){
    ISR = 0x00000020; // set interrupt   // ISR register bit 5        //  interrupt also generated !!!

for (jj=0; jj<100; jj++){  kk += jj;  if (kk > 100) kk= 0;  };
};

 

interrupt void USB0_Isr(void)
{             
count++;                        EVTCLR0 |= 0x00080000;   // clear  event19  flag   

                                         ICR = 0x00000020;    //  clear  bit 5  
//    INT_MUX1 |= 0x00001300; // int_sel5 (14-8 bits) event19 (USB0_INT  DSP)

}

  • Are you able to get other interrupts to work with your code setup?  If you would like to see a working example, the BIOS PSP package includes an rCSL interrupt example.

    -Tommy

  • I don't used DSP/BIOS.    I read   cslr_userguide.pdf (from BIOS PSP 01 30 00 05 ) .

     

    My problems:

    1.  I write C-code for work with USB0 controller in TMS320C6748. Code is running on OMAPL138 EVM board (Logic PD).

    In first time I used INTSRCR register from USB0 controller. But now I want to use interrupt from event 19 flag (USB0_INT).

     I init event 19 flag and interrupt from int_sel5 and run my programm. But I don't recive interrupt from USB0. Why ?

    Is it nessesary to do some USB0 controller initialization  or  to write some config data to some system registers ?

     

    2. Than I write this test. I manualy set/reset event 19 flag. For my mind, I must get interrupts, I don't get interrupt. Why?

     

    3. I get interrupts after reset  INT_MUX1  (int_sel5) from 0x13 to 0x00.   I cann't read about this effect in documentation.  Is it a bug?

     

    This is the part of code for event 16. Result is the same (as for event 19 flag). This code may work (after little correct ) for int_sel4.

    CSR &=  0xFFFFFFFE;   ICR = 0xFFF0;      EVTCLR0 |= 0x00010000;   // clear event 16 flag
        INT_MUX1 &= 0xFFFF00FF;           INT_MUX1 |= 0x00001000;  // int_sel5 (14-8 bits) event16
    count= 0;              ISTP = (unsigned int)intcVectorTable;         ICR = 0xFFF0;     IER = 0x000000F3;    CSR |=  0x00000001;

     

    for (ii=0; ii<1000; ii++){                  EVTSET0 |= 0x00010000;   // set  event16  flag    // No interrupt !!!

    for (jj=0; jj<100; jj++){ kk += jj;  if (kk > 100) kk= 0; };
    EVTCLR0 |= 0x00010000;   // clear  event16  flag   

    for (jj=0; jj<100; jj++){ kk += jj;  if (kk > 100) kk= 0; };
    };

    //  No interrupt:     count==0 !!!

     

        INT_MUX1 |= 0x00001000; // int_sel5 (14-8 bits) event16

        EVTCLR0 |= 0x00010000;   // clear  event16  flag

    for (ii=0; ii<1000; ii++){
        EVTSET0 |= 0x00010000;   // set  event16  flag
        INT_MUX1 &= 0xFFFF00FF;    // interrupt  !!!

    for (jj=0; jj<100; jj++){ kk += jj;  if (kk > 100) kk= 0; };
        INT_MUX1 |= 0x00001000; // int_sel5 (14-8 bits) event16   
        EVTCLR0 |= 0x00010000;   // clear  event16  flag

    for (jj=0; jj<100; jj++){ kk += jj;  if (kk > 100) kk= 0; };
    };

    //   count == 1000

     

    for (ii=0; ii<1000; ii++){
        ISR = 0x00000020; // set interrupt   // ISR register bit 5        //  interrupt  generated !!!

    for (jj=0; jj<100; jj++){  kk += jj;  if (kk > 100) kk= 0;  };
    };

    //   count == 2000

     

    interrupt void USB0_Isr(void)       {     count++;     }

     

  • Alex,

    I understand that you do not wish to use BIOS.  Within the install directory, you will find a simple C-based interrupt example here:

    ..\pspdrivers_01_30_01\packages\ti\pspiom\cslr\evmOMAPL138\examples\intc

    -Tommy

  • Yes, I red  this examle.  I do the same in my programm, but it don't  work correct  (no interrupts).

     

    I have the question about this example.

    I compile and run this example on my EVM board.  I get result:

    "Testing CPU Interrupt 4 using TIMER0

    Starting TIMER0

    Interrupt test:  PASSED"

     

    Than I replase one line of programm code:

    //  CSL_FINS(intcRegs->INTMUX1, DSPINTC_INTMUX1_INTSEL4,TIMER0_EVENT);
      CSL_FINS(intcRegs->INTMUX1, DSPINTC_INTMUX1_INTSEL4,CSL_INTC_EVENTID_USBINT0 );  

    I compile, load and run this programm  and I recive :

    "Testing CPU Interrupt 4 using TIMER0

    Starting TIMER0
    Error

    Interrupt test:  FAILED"

     

    That is rigth.

     

    After that I change the code to begining state:

      CSL_FINS(intcRegs->INTMUX1, DSPINTC_INTMUX1_INTSEL4,TIMER0_EVENT);
    //  CSL_FINS(intcRegs->INTMUX1, DSPINTC_INTMUX1_INTSEL4,CSL_INTC_EVENTID_USBINT0 );  

    I compile, load and run this programm. But I recive:

    Starting TIMER0
    Error

    Interrupt test:  FAILED

     

     After this it's beginning problems.

     

    I do    1)  "CPU Reset"  2)  load programm  3) run programm.

    I may recive "FAILED', I may recive "PASSED" and result  is  unpredictable.

    Instead "CPU Rest"  I may do "Advanced Rest/System Reset" or close CCS and  OFF/ON board Power.

     

    Please, Tommy,   may You do the same on your OMAP L-138 EVM board and tell me about your results?

    - Alex

     

     

  • Alex,

    I saw the same behavior.  I think it has to do with the fact that the code to disable TIMER is not executed when the test fails.  When I add this line to the end of the testcase so that it is executed regardless of pass/fail results, I am able to pass the test again when I switch from TIMER -> USB -> TIMER:

        CSL_FINST(tmr0Regs->TCR,TMR_TCR_ENAMODE12,DISABLE);

    As far as reset goes, I would recommend using the advanced System Reset.  The CPU reset may not clear the interrupt combiner circuitry that is located outside of the DSP.

    -Tommy

  • Tommy, thanks for your answer.

    But  I  may turn OFF power EVM board for 5 minutes(or for 5 hours), than I ON power and  load test.  I may recived "FAILLED".

      Is it don't clear interupt combiner circuitry?  I don't understand it.

     

    Please, Tommy, reply me for simple question.

    I manually set/rest event flag 19 (and if I do all correct),  Must I recive interrupt?

    - Alex.

  • Hi, Tommy.

    Can  You  answer  on my simple question?

    - Alex.

     

  • Alex,

    I apologize for not replying earlier.  I was looking into your question, but forgot to post an update.

    Performing a power off/on should reset the interrupt logic.  Looking at the interrupt controller block diagram from SPRUFK5, setting the event flag will only generate an interrupt if the Event Combiner is used.

    -Tommy

  • Tommy,

    thanks for your answer.

    I undestand my mistake in manualy set/reset event flag.

    But my main question is about USB20 controller interrupt.

    I run my programm, it work with USB controler. Program work successfully. It read sector of flash-drive (LBA=0), and I see that result is correct.

    I multiplex event 19 flag to int5 hardware vector. Now I can see, that It work correct, if I manualy set/rest event 19 flag.

    But when my program work, I recive only one interrupt on the int5 vector - in the beginning of the work.  This is USB_DRVVBUS interrupt.

    I can see USB20 internal interrupts in the INTSRCR register. But I don"t recive another interrupt on the int5 hardware vector when my progam work. 

    Where is my mistake?

    On my EVM board  S7.5 and S7.8 is ON.

    - Alex.

     

     

     

     

     

  • Alex,

    Did you write to the End Of Interrupt Register (EOIR) to acknowledge the interrupt?

    -Tommy

  • Tommy,

    yes, I write to EOIR in ISR subroutine.

    For example,

    if I write 0x13 (or 0x05 or 0x08)  to EOIR, than result is the same - I recive only one interrupt;

    if I write 0x00 to EOIR , than I recive very-very many interrupts (it may be infinite).

    I don't used CPPI 4.1 DMA. But nessesary to write EOIR register is discribed in 2.8.13 section . 2.8 section describe CPPI 4.1 DMA in sprufm9g.

    If I used event 19 and  int5 harware vector, what value  I must  write to EOIR?  Must I write EOIR register in ISR subroutine or in main code?

    I can not find anwers for this questions in documentation.

    - Alex.

     

  • You should write a 0x00 to EOIR to acknowledge completion of an interrupt.  This is mentioned in the EOIR register description of the USB20 user guide. 

    A potential reason why you receive infinite interrupts if you write 0x00 to EOIR, could be due to the SOF interrupt being triggered continuously.  Can you check the INTMSKSETR register to determine which interrupts are enabled?

    --Christina

  • Christina,

    thanks for your answer.

    In my program USB controller work on full speed, i.e. SOF interrupt must be every 1 ms.

    For example:

     every 5 sec I recive 9129127 interrupts, but it can be only 5000 SOF interupts for this 5 sec.

    For 

    USB_OTG->INTMSKSETR = 0x01FF1E1F; 

    or

     USB_OTG->INTMSKSETR = 0x01F71E1F; 

    result is the same:-  very-very many interrupts.

    - Alex.

     

     

  • I forgot to ask, but what type of USB interrupt mode are you using?  In particular, what is the value of CTRLR[UINT]? 

    --Christina

  • Christina,

    in my program I used

          USB_OTG->CTRLR &= 0xFFFFFFF7; // 0 =  Enable PDR

     

    --Alex

     

  • Thanks for the information.  I just wanted to check which interrupt mode you are operating in before giving additional suggestions.

    Both INTMSKSETR and INTMSKCLRR registers are used to manipulate the INTMSKR fields.  Can you check INTMSKR to make sure that the mask is set correctly? Also, did you clear/acknowledge the interrupt, via INTCLRR, before clearing EOIR?  If the interrupts are not cleared before clearing EOIR, it might trigger the ISR again.

    --Christina

  • Christina,

    thanks for your answer.

    Yes, I recive interrupts correctly, if I clear USB0 interupt via INTCLRR befor write 0 to EOIR.

    It may be better  to write  in documentation about this case obviously (IMHO).

    Christina, let  me  ask you yet about interrupt ( "last" question).

    If I load/run my programm first time - all is OK. But if I do it repeatedly,  I don't recive interrupts.

    I must do "System Reset" form Debug menu, and than, if I load/run my programm, all is OK again.

    What do "System Reset"?  May I do the same from my programm or no?

    I.e. can I "clear interrupt combiner circuitry from my code"?  In one of the previously posts, Tommy told me:

    "The CPU reset may not clear the interrupt combiner circuitry that is located outside of the DSP."

    But how  I can see in sprufk5, the interrupt controller is inside the TMS320C674x megamodule.

    Is it   nessesary to do external hardware reset only?

    -- Alex

     

  • From my knowledge, "System Reset" is the easiest solution.

    When the program is halted, there might be some interrupts left over in the interrupt combiner circuitry.  Potentially during the USB initialization, you can try clearing and acknowledging any leftover interrupts.  However, it might be more tedious to chase down all the remaining flags than doing "System Reset" 

    You can also add the "System Reset" in the GEL file.  Here is someone's workaround: http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/65116/235546.aspx#235546.

    --Christina

  • Christina,

    thanks for your answer.

    Previously I said that "all is OK", but I was hurry. Not all is OK (or all is not OK).

    I see, that reset by power  OFF/ON is not the same as reset  by  "System Rest".

    After  "power reset" my test programm  work correct. After "System Reset" it don't work correct..

    For example, after I run my test programm, I recive interrupt  USBDRVVBUS,

    and then I insert my Flash-drive into USB-connector.

    I recive interrupt CONN  immediately, if it was be power reset.

     But when I do System Reset, I not recive CONN interrupt.  I can see in INTSRCR that  bit CONN = 0.

    Than I eject flash-drive and insert it again. After 2 or 3 or 4 times I recive interrupt CONN.

    May I see code for "System reset"?

    What occur in "power reset"? May I do the same in my code or no? I.e. must it be only hardware reset?

    -- Alex.

     

  • Are you using Advanced Resets > System Reset?  There's no actual code for the Advanced Reset/System Reset.  It tells the JTAG emulator to toggle the TRST signal.  It's almost the same as a physical power on reset. 

    --Christina

     

  • Christina,

    thanks for your answer.

    Yes, I am using Advanced Resets > System Reset, or call it from GEL file (on load programm). Result is the same.

    I forgot to say that my JTAG emulator (XDS100) works on 1 MHz. May be better used it on 6 MHz?

    iI don't know, but may problem be in my EVM board hardware?

    And some question about SOF. Now it is masked in my test program.

    When I unmasked it, than I don't recive interrupt on vecot 5 (wheer I recive other USB interrupt).

    Is it correct?

    -- Alex.

     

     

  • 1Mhz or 6Mhz shouldn't make a difference.

    System Reset should reset everything back to its default state, including the PLL configurations.  After a System Reset, are you re-initializing the PLL settings (similar to the OnTargetConnect() GEL function)? 

    --Christina