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.

Directly using IPC with CSL

Other Parts Discussed in Thread: TMS320C6678

I don't use BIOS. I use EVM6678 and CCS 5.5. In my multicore but single image project I need IPC for cores synchronization. I would like to use CSL for directly access to IPC. Here is my example code inside main function:

	Uint32 core_id = CSL_chipReadDNUM();
	Uint32 i;

	if (core_id == 1)
	{
		GPIO_DIR = ~(1<<GPIO_15);

	    if (intc_init() < 0)
	    {
	        printf ("Error: Initialization of the INTC module failed\n");
	        return;
	    }

	    CSL_IntcEventHandlerRecord  EventRecord;
	    CSL_IntcParam               vectId;
	    CSL_IntcHandle              ipcIntcHandle;

	    /**************************************************************
	     ********************** INTC related code *********************
	     **************************************************************/

	    /* Open INTC */
	    vectId = CSL_INTC_VECTID_5;
	    ipcIntcHandle = CSL_intcOpen(&ipcIntcObj, 91, &vectId, NULL); //event ID 91 for IPC_LOCAL

	    /* Bind ISR to Interrupt */
	    EventRecord.handler = (CSL_IntcEventHandler)&ipc_interrupt; //register ISR function
	    EventRecord.arg     = (void *)ipcIntcHandle;
	    CSL_intcPlugEventHandler(ipcIntcHandle, &EventRecord);

	    /* Event Enable */
	    CSL_intcHwControl(ipcIntcHandle, CSL_INTC_CMD_EVTENABLE, NULL);
	}

    while(1)
    {
    	if (core_id == 0)
    	{
    		CSL_IPC_genGEMInterrupt(1, 0); //interrupt from CORE0 to CORE1
    		for(i = 0; i < 10000; i++); //delay
    	}
    }

In this case I need call interrupt from CORE0 to CORE1. Here is my ISR function:

static void ipc_interrupt (void *arg)
{
	GPIO_OUT_DATA = GPIO_OUT_DATA ^ (1<<GPIO_15); //blinking GPIO_15

    /* Clear the event ID. */
    CSL_intcEventClear((CSL_IntcEventId)arg);
}

My intc_init() function:

static Int32 intc_init (void)
{
    CSL_IntcGlobalEnableState   state;

    /* INTC module initialization */
    context.eventhandlerRecord = NULL;
    context.numEvtEntries      = 0;
    if (CSL_intcInit(&context) != CSL_SOK)
        return -1;

    /* Enable NMIs */
    if (CSL_intcGlobalNmiEnable() != CSL_SOK)
        return -1;

    /* Enable global interrupts */
    if (CSL_intcGlobalEnable(&state) != CSL_SOK)
        return -1;

    /* INTC has been initialized successfully. */
    return 0;
}

ISR doesn't occur inside CORE1. For test purposes I run CORE1 and then CORE0. Where is my mistake ? Hope someone can help me. I need it for my scientific application in electrical engineering for real time modeling of electric circuits.

I attached complete project from CCS in ZIP format. My PDK version is 1.1.2.5.

ipc_interrupt_csl.zip
  • Hi,

    Did you refer any TI examples for your implementation? I did not see the IPC test code using CSL without BIOS.

    • The Inter-Process Communication (IPC) APIs make use of SYS/BIOS, and so IPC can only be used on processors running SYS/BIOS applications.
    • IPC provides modules and APIs that extend SYS/BIOS to make it easy to communicate between processors in a multi-processor environment.

    Find the IPC related wiki pages, this will be useful for the begineers to better understand the IPC.
    http://processors.wiki.ti.com/index.php/IPC_Users_Guide/Use_Cases_for_IPC
    http://processors.wiki.ti.com/index.php/IPC_DEBUG

  • I didn't refer to TI examples of IPC test code using CSL without BIOS because I can't find it. Does TI provide such example ? Where can I find example of IPC based on CSL ? I would like to develop low level application for some experiments so in such case I can't use BIOS.

    In Data Manual (SPRS691D) of TMS320C6678 processor type I found description about IPC interrupt generation using IPCGRx registers. Manual says: A write of 1 to IPCG field of IPCGRx register will generate an interrupt pulse to CorePacx (0 <= x <= 7). I think it means I can use directly IPC interrupt generation using CSL. TI provide csl_chipAux.h and csl_chip.h but question is why it doesn't work ?

  • Hi,

    I solved it. I only need unlock kicker mechanism. It's describe o page 81 in Data Manual of C6678. Addresses of KICK0 and KICK1 can be find on page 75. Unlocking kicker mechanism:

    	if (core_id == 0)
    	{
    		KICK0 = 0x83e70b13;
    		KICK1 = 0x95a4f1e0;
    	}
    

    I use it in main function. KICK0 and KICK1 global definitions:

    #define KICK0       *( volatile Uint32* )( 0x02620038 )
    #define KICK1       *( volatile Uint32* )( 0x0262003C )
    

  • hi,

    Glad to hear to find the solution. I thought you are looking for IPC module to use communication between cores.

    I believe that, now you are understood the kicker mechanism. You can comeback if you have doubt on this.