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.

CCS/66AK2H12: EDMA Driver Interrupt Generation Problem

Part Number: 66AK2H12
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Is there a answer for this thread?

I also have the same problem. I map SysInt 314 to HostInt 35. Then I enable HWI 5 with event ID 23.

EDMA sets IPR bits correctly according to the registers window in CCS.

Can you help?

Best,

  • Can you share which Processor SDK RTOS are you using?

    Best Regards,
    Yordan

  • I am using SYS/BIOS .73.1.01 under CCSv8

    I modified the code that Scott Specker and Eric Wilbur wrote with EDMA driver. I changed the interrupt init part where I mapped sysint 314 to hostint 35. Also enabled Hwi with intnum 7 and with handler &lisrEdma3ComplHandler0 having event id 23. I can see Hwi configuration in ROV but i cannot see CpIntc module configuration properly in ROV module. I am providing also my project in the attachments.

    Best Regards,

    samseytani

    test_edma_drv_int.tar.gz

  • sysint is 36 which is EDMACC_0_GINT. The number 314 is wrong btw.

  • When I create a similar project using only CSL there is no problem. But with the driver i got stack overflows, instruction fetch exceptions etc.

  • Hi,

    EDMA sets IPR bits correctly according to the registers window in CCS. ====> That is good. So the transfer finished and IPR is set. Please see http://processors.wiki.ti.com/index.php/Configuring_Interrupts_on_Keystone_Devices for interrupt setup.

    Regards, Eric

    CpIntc

    This module manages the CIC hardware. This module supports enabling and disabling of both system and host interrupts. This module also supports mapping system interrupts to host interrupts and host interrupts to Hwis or to the EventCombiner. These functionality are supported statically and during runtime for CICs connected to the GEM interrupt controller but only during runtime for other CICs. There is a dispatch function for handling GEM hardware interrupts triggered by a system interrupt. The Global Enable Register is enabled by default in the module startup function.

    System interrupts are those interrupts generated by a hardware module in the system. These interrupts are inputs into CIC. Host interrupts are the output interrupts of CIC. There is a one-to-one mapping between channels and host interrupts therefore, the term "host interrupt" is also used for channels. Note that this modules does not support prioritization, nesting, and vectorization.

    The SYS/BIOS module that provides the CpIntc APIs is 'ti.sysbios.family.c66.tci66xx.CpIntc.'

    The following code snippet provides an example implementation using CpIntc APIs. The comments before each line of code explain what the code achieves.

    // Map system interrupt 15 to host interrupt 8
    CpIntc_mapSysIntToHostInt(0, 15, 8); 
    
    // Plug the function for event #15
    CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE); 
    
    // Enable host interrupt #8
    CpIntc_enableHostInt(0, 8); // enable host interrupt 8
    

    Example

    Here we put together our learning from this section and walk through a SYS/BIOS example.

    /* Map the System Interrupt i.e. the Interrupt Destination 0 interrupt to the DIO ISR Handler. */
    CpIntc_dispatchPlug(CSL_INTC0_INTDST0, (CpIntc_FuncPtr)myDioTxCompletionIsr, (UArg)hSrioDrv, TRUE);
    
    /* The configuration is for CPINTC0. We map system interrupt 112 to Host Interrupt 8. */
    CpIntc_mapSysIntToHostInt(0, CSL_INTC0_INTDST0, 8);
    
    /* Enable the Host Interrupt. */
    CpIntc_enableHostInt(0, 8);
    
    /* Enable the System Interrupt */
    CpIntc_enableSysInt(0, CSL_INTC0_INTDST0);
    
    /* Get the event id associated with the host interrupt. */
    eventId = CpIntc_getEventId(8);
    
    Hwi_Params_init(&params);
    
    /* Host interrupt value*/
    params.arg = 8;                            
    
    /* Event id for your host interrupt */
    params.eventId = eventId;          
    
    /* Enable the Hwi */
    params.enableInt = TRUE;       
    
    /* This plugs the interrupt vector 4 and the ISR function. */
    /* When using CpIntc, you must plug the Hwi fxn with CpIntc_dispatch */
    /* so it knows how to process the CpIntc interrupts.*/
    Hwi_create(4, &CpIntc_dispatch, &params, NULL);      

    =====

    Or, you can use pure CSL code:

    /*** --- INTC Initializations --- ***/
    
    /* Note that hyplnk_EXAMPLE_COREPAC_VEC = 4, hyplnk_EXAMPLE_COREPAC_INT_INPUT = 0x15, */
    /* CSL_INTC_CMD_EVTCLEAR = 3, CSL_INTC_CMD_EVTENABLE = 0 */
    
    CSL_IntcParam vectId = hyplnk_EXAMPLE_COREPAC_VEC; 
    Int16 eventId = hyplnk_EXAMPLE_COREPAC_INT_INPUT;
    CSL_IntcGlobalEnableState   state;
    
    /* INTC module initialization */
    hyplnkExampleIntcContext.eventhandlerRecord = hyplnkExampleEvtHdlrRecord;
    hyplnkExampleIntcContext.numEvtEntries      = 2;
    CSL_intcInit(&hyplnkExampleIntcContext);  
    
    /* Enable NMIs */
    CSL_intcGlobalNmiEnable(); 
    
    /* Enable global interrupts */
    CSL_intcGlobalEnable(&state);
    
    hyplnkExampleIntcHnd = CSL_intcOpen (&hyplnkExampleIntcObj, eventId, &vectId, NULL);
    hyplnkExampleEvtHdlrRecord[0].handler = hyplnkExampleIsr;
    hyplnkExampleEvtHdlrRecord[0].arg = (void *)eventId;
    CSL_intcPlugEventHandler(hyplnkExampleIntcHnd, hyplnkExampleEvtHdlrRecord);
    
    /* Clear the event in case it is pending */
    CSL_intcHwControl(hyplnkExampleIntcHnd, CSL_INTC_CMD_EVTCLEAR, NULL);
    
    /* Enable event */
    CSL_intcHwControl(hyplnkExampleIntcHnd, CSL_INTC_CMD_EVTENABLE, NULL);
    
    /*** --- CIC Initializations --- ***/
    
    CSL_CPINTC_Handle hnd;
    hnd = CSL_CPINTC_open (0);
      
    /* Disable all host interrupts. */
    CSL_CPINTC_disableAllHostInterrupt(hnd);
        
    /* Configure no nesting support in the CPINTC Module */
    CSL_CPINTC_setNestingMode (hnd, CPINTC_NO_NESTING);
    
    /* Clear Hyperlink system interrupt number 111 */
    /* We get the interrupt number from Table 7-39 in the 6678 */
    /* data manual at www.ti.com/.../sprs691c.pdf */
    CSL_CPINTC_clearSysInterrupt (hnd, CSL_INTC0_VUSR_INT_O);
    
    /* Enable Hyperlink system interrupt number 111 on CIC0 */
    CSL_CPINTC_enableSysInterrupt (hnd, CSL_INTC0_VUSR_INT_O);
    
    /* Map System Interrupt to Channel. */
    /* Note that hyplnk_EXAMPLE_INTC_OUTPUT = 32 + (11 * CoreNumber) = 43 for Core0*/
    CSL_CPINTC_mapSystemIntrToChannel (hnd, CSL_INTC0_VUSR_INT_O, hyplnk_EXAMPLE_INTC_OUTPUT);  
    
    /* Enable the Host Interrupt */
    CSL_CPINTC_enableHostInterrupt (hnd, hyplnk_EXAMPLE_INTC_OUTPUT);
    
    CSL_CPINTC_enableAllHostInterrupt(hnd);