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.

TDA2EXEVM: Integrating Mailbox Communication with SYS/BIOS configuration on EVE Processors

Part Number: TDA2EXEVM

Hi ,

I'm working on establishing the mailbox communication between EVE processors with SYS/BIOS configuration. Integrating the mailbox example which is given under startarware.
Trying to send the message from EVE1 to EVE2 , problem here is we are unable to receive the message on EVE2.

NOTE: we are able to establish the mailbox communication between EVE1 and EVE2 in bare-metal application

but communication is not working when we tried to do the same with SYS/BIOS configuration of Processor Vision SDK. 

FYI, I'm including  the Interrupt Service Table in C code as below:

extern interrupt void NMI_IRQ(void);

extern interrupt void SWI_IRQ(void);
extern interrupt void INTH_IRQ4(void);
extern interrupt void INTH_IRQ5(void);
extern interrupt void INTH_IRQ6(void);
extern interrupt void INTH_IRQ7(void);
extern interrupt void INTH_IRQ8(void);
extern interrupt void INTH_IRQ9(void);
extern interrupt void INTH_IRQ10(void);
extern interrupt void INTH_IRQ11(void);
extern interrupt void INTH_IRQ12(void);
extern interrupt void INTH_IRQ13(void);
extern interrupt void INTH_IRQ14(void);
extern interrupt void INTH_IRQ15(void);

#pragma DATA_SECTION (ist_table, ".intvecs");
typedef interrupt void(*inthandler)(void);


volatile inthandler ist_table[17] =
{
   &NMI_IRQ,
   &SWI_IRQ,
   &INTH_IRQ4,
  &INTH_IRQ5,
  &INTH_IRQ6,
  &INTH_IRQ7,
  &INTH_IRQ8,
  &INTH_IRQ9,
  &INTH_IRQ10,
  &INTH_IRQ11,
  &INTH_IRQ12,
  &INTH_IRQ13,
  &INTH_IRQ14,
  &INTH_IRQ15

};

Please let us know if we are missing any configuration to enable mailbox with SYS/BIOS.

Regards,
Manavi

  • Hi,

    You can refer to IPC lite which is also bare-metal IPC used in SYSBIOS with Vision SDK.

    ~/pdk_xx_xx_xx/packages/ti/drv/ipc_lite/src/ipclib_interrupt.c

    Regards,
    Stanley

  • Hi Stanley,

    Thank you for the response.
    As you suggested I tried to use IPC lite with SYS/BIOS to communicate between EVE1 to EVE2 processor.
    I'm facing the binary crash issue while sending the message on EVE1 to EVE2. 


    NOTE: one behavior I observed is that I'm  able to establish the communication between EVE1 to EVE2 if I disable eveMmuConfig() function in configuration file of EVE processors. I'm using 0x40081000U as a base address on EVE1 and EVE2 to configure MMU. Is this base address should be different on each EVE processor ?



    Below are the steps I'm following at sender and receiver side.
    Receiver's sequence
    1. IPCLib_interruptSetDefaultInitPrm()
    2. Change params as required
    3. IPCLib_interruptInit() - with valid params
    4. IPCLib_interruptRegisterEvent() - with valid callback function

    Sender's sequence
    1. IPCLib_interruptSetDefaultInitPrm()
    2. Change params as required
    3. IPCLib_interruptInit() - with valid params
    4. IPCLib_interruptRegisterEvent() - with valid callback function
    5. IPCLib_interruptSendEvent() - with valid payload and event id


    here at sender sequence execution is crashing when it executes 

    HW_RD_REG32(baseAddr+MAILBOX_MESSAGE(queueId)) function in IPCLib_interruptSendEvent() step( 5th step).

    I have attached the EVE1 and EVE2 source file.

    Please let me know how eveMmuConfig() function is effecting for the communication and also  if I'm missing any steps to enable IPC_LIB with SYS/BIOS configuration.

    main_EVE1.txt
    #include <xdc/std.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    
    #include <xdc/runtime/System.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/Memory.h>
    #include "ipclib_interrupt.h"
    
    
    #define EV1_EVE2_EVENT_NOTIFY 23
    #define EVE_LOADING_IPC_EVENT_ID 8
    
    
    Void eve11_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status);
    
    
    Void Taskfxn_1(UArg arg1, UArg arg2)
    {
        System_printf("Hello !! This is from taskfxn_1() \n");
        System_flush();
    
        Int32 status = IPCLIB_SOK;
    
        UInt16  eveProcId = MultiProc_getId("EVE2");
        printf("\n EVE2 Id = %d", eveProcId);
        printf("\n Im a task function of eve1 \n ");
        
        uint32_t numprocs = 0U;
        
        System_printf("\n Initializing IPC lib on EVE1  ..... \n");
        System_flush();
        IpcLib_InterruptInitPrms initPrm;
        IpcLib_interruptSetDefaultInitPrm(&initPrm);
    
        initPrm.validProcIds[numprocs] = IPCLIB_EVE1_ID; 
        numprocs++;
        initPrm.validProcIds[numprocs] = IPCLIB_EVE2_ID; 
        numprocs++;
    
        initPrm.numValidProcs   = numprocs;
        initPrm.msgTimeOut      = 0xFFFF;
    
        status = IpcLib_interruptInit(&initPrm);
        System_printf("\n IPC_LIB initialization is done  ..... \n");
        System_flush();
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB initialization failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB initialization successful : EVE1!! =%d \n ",status);
            System_flush();
        }
    
        status = IpcLib_interruptEnable(IPCLIB_EVE2_ID);
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB interruptEnable failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB interruptEnable successful : EVE1!! =%d \n ",status);
            System_flush();
        }
    
        System_printf("\n Registering the IpcLib event..... \n");
        System_flush();
        status =
               IpcLib_interruptRegisterEvent(
                 IPCLIB_EVE2_ID,
                 6,
                 (IpcLib_InterruptCallback) (&eve11_IPC_CallbackFun),
                 NULL);
    
        if (status != IPCLIB_SOK)
        {
            System_printf("Register event failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("Register event successful : EVE1! = %d! \n ", status);
            System_flush();
        }
    
        System_printf("\n Calling IpcLib_interruptSendEvent()  ..... \n");
        System_flush();
    
        status = IpcLib_interruptSendEvent(IPCLIB_EVE2_ID, EVE_LOADING_IPC_EVENT_ID, EV1_EVE2_EVENT_NOTIFY, FALSE);
        if (status != IPCLIB_SOK)
        {
            System_printf("Message sent event failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("Message sent event successful : EVE1! = %d! \n ", status);
            System_flush();
        } 
    }
    
    Void Taskfxn_2(UArg arg1, UArg arg2)
    {
        System_printf("\n Hello !! This is from taskfxn_2() >>. DONE....\n");
        System_flush();
    
    }
    
    int main(int argc, char** argv)
    {
        Task_Handle task1, task2;
        Error_Block eb1,eb2;
        Task_Params taskparams1,taskparams2;
        int status;
    
        System_printf("\n Starting main()\n");
        System_flush();
    
        Error_init(&eb1);
        Error_init(&eb2);
    
        Task_Params_init(&taskparams1);
        Task_Params_init(&taskparams2);
      
        taskparams1.priority = 2;
        taskparams2.priority = 1;
    
        task1 = Task_create(Taskfxn_1, &taskparams1, &eb1);
        task2 = Task_create(Taskfxn_2, &taskparams2, &eb2);
    
        if(NULL==task1 || NULL==task2)
        {
            System_abort("\n Error in creating a task for eve1 \n");
            System_flush();
        }
    
        BIOS_start();
    	return 0;
    }
    
    Void eve11_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status)
    {
    
      uint32_t paylodRecv;
      paylodRecv = payload;
    
    }
    
    
    
    
    
    
    main_EVE2.txt
    #include <xdc/std.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    
    #include <xdc/runtime/System.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/Memory.h>
    
    #include "ipclib_interrupt.h"
    
    #define EVE_LOADING_IPC_EVENT_ID 8
    
    Void eve22_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status);
    
    
    uint32_t paylodRecv;
    uint32_t event_acc=0;
    
    
    Void Taskfxn_1(UArg arg1, UArg arg2)
    {
        System_printf("Hello !! This is from taskfxn_1(): EVE2 \n");
        System_flush();
    
        Int32 status = 0;
    
        UInt16  eveProcId = MultiProc_getId("EVE1");
        printf("\n EVE1 Id = %d", eveProcId);
        printf("\n Im a task function of eve2 \n ");
    
        System_printf("\n Initializing IPC lib on EVE2  ..... \n");
        System_flush();
        uint32_t numprocs = 0U;
    
        IpcLib_InterruptInitPrms initPrm;
        IpcLib_interruptSetDefaultInitPrm(&initPrm);
    
         initPrm.validProcIds[numprocs] = IPCLIB_EVE1_ID;
         numprocs++;
         initPrm.validProcIds[numprocs] = IPCLIB_EVE2_ID;
         numprocs++;
    
        initPrm.numValidProcs   = numprocs;
        initPrm.msgTimeOut      = 0xFFFF;
    
        status = IpcLib_interruptInit(&initPrm);
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB initialization failed : EVE2! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB initialization successful : EVE2!! =%d \n ",status);
            System_flush();
        }
    
         status = IpcLib_interruptEnable(IPCLIB_EVE1_ID);
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB interruptEnable failed : EVE2! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB interruptEnable successful : EVE2!! =%d \n ",status);
            System_flush();
        }
    
        System_printf("\n Registering the IpcLib event..... \n");
        System_flush();
        status =
            IpcLib_interruptRegisterEvent(
                0,
                EVE_LOADING_IPC_EVENT_ID,
                (IpcLib_InterruptCallback) (&eve22_IPC_CallbackFun),
                NULL);
    
        if (status != IPCLIB_SOK)
        {
            System_printf("Register event failed : EVE2!! \n ");
            System_flush();
        }
        else
        {
            System_printf("Register event successful : EVE2!! \n ");
            System_flush();
        }
        
        System_printf("\n Registering the IpcLib event DONE ..... \n");
        System_flush();
        
    }
    
    Void Taskfxn_2(UArg arg1, UArg arg2)
    {
        System_printf("Hello !! This is from taskfxn_2(): EVE2 \n");
        System_flush();
    
         while (event_acc != 1);
        System_printf(" EVE PAYLOAD = %d \n", &paylodRecv);
        System_flush();
    
    }
    
    int main(int argc, char** argv)
    {
        Task_Handle task1, task2;
        Error_Block eb1,eb2;
        Task_Params taskparams1,taskparams2;
         int status;
    
        System_printf("Starting main(): EVE2\n");
        System_flush();
    
    
        Error_init(&eb1);
        Error_init(&eb2);
    
        Task_Params_init(&taskparams1);
        Task_Params_init(&taskparams2);
      
        taskparams1.priority = 2;
        taskparams2.priority = 1;
    
        task1 = Task_create(Taskfxn_1, &taskparams1, &eb1);
        task2 = Task_create(Taskfxn_2, &taskparams2, &eb2);
        
    
        if(NULL==task1 || NULL==task2)
        {
            System_abort("\n Error in creating a task for EVE");
            System_flush();
        }
    
        BIOS_start();
    
    	return 0;
    }
    
    Void eve22_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status)
    {
      
      paylodRecv = payload;
      event_acc++;
    
    }
    

    Regards,
    Manavi

  • Hi Stanley,

    The above communication between EVE1 and EVE2 with IPC lite is resolved after adding 0x42000000 address in TTB buffer entry table of MMU config function.

    Now the problem is,
    I'm unable to establish the communicate between EVE1 to EVE2 if I use "SR1_FRAME_BUFFER_MEM" shared region between EVE1 and EVE2 . 


    NOTE:  I'm  able to establish the communication between EVE1 to EVE2 if I disable the usage of shared region that is "SR1_FRAME_BUFFER_MEM : org = 0x8a783000, len = 0x1537d000" .



    Below are the steps I'm following at sender and receiver side.
    Receiver's sequence
    1. IPCLib_interruptSetDefaultInitPrm()
    2. Change params as required
    3. IPCLib_interruptInit() - with valid params
    4. IPCLib_interruptRegisterEvent() - with valid callback function

    Sender's sequence
    1. IPCLib_interruptSetDefaultInitPrm()
    2. Change params as required
    3. IPCLib_interruptInit() - with valid params
    4. IPCLib_interruptRegisterEvent() - with valid callback function
    5. IPCLib_interruptSendEvent() - with valid payload and event id


    here all the sequence at sender and receiver side is executing successfully. EVE1 is sending the message to EVE2 but at EVE2 side interrupt call back function is not getting invoked.



    I have attached the EVE1 and EVE2 source file.

    Please let me know how the usage of shared region "SR1_FRAME_BUFFER_MEM" is effecting for the communication and also  if I'm missing any steps to enable shared region with IPC_LIB in SYS/BIOS configuration.

    main_EVE1.txt
    #include <xdc/std.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    
    #include <xdc/runtime/System.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/Memory.h>
    #include "ipclib_interrupt.h"
    
    
    #define EV1_EVE2_EVENT_NOTIFY 23
    #define EVE_LOADING_IPC_EVENT_ID 8
    
    
    Void eve11_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status);
    
    
    Void Taskfxn_1(UArg arg1, UArg arg2)
    {
        System_printf("Hello !! This is from taskfxn_1() \n");
        System_flush();
    
        Int32 status = IPCLIB_SOK;
    
        UInt16  eveProcId = MultiProc_getId("EVE2");
        printf("\n EVE2 Id = %d", eveProcId);
        printf("\n Im a task function of eve1 \n ");
        
        uint32_t numprocs = 0U;
        
        System_printf("\n Initializing IPC lib on EVE1  ..... \n");
        System_flush();
        IpcLib_InterruptInitPrms initPrm;
        IpcLib_interruptSetDefaultInitPrm(&initPrm);
    
        initPrm.validProcIds[numprocs] = IPCLIB_EVE1_ID; 
        numprocs++;
        initPrm.validProcIds[numprocs] = IPCLIB_EVE2_ID; 
        numprocs++;
    
        initPrm.numValidProcs   = numprocs;
        initPrm.msgTimeOut      = 0xFFFF;
    
        status = IpcLib_interruptInit(&initPrm);
        System_printf("\n IPC_LIB initialization is done  ..... \n");
        System_flush();
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB initialization failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB initialization successful : EVE1!! =%d \n ",status);
            System_flush();
        }
    
        status = IpcLib_interruptEnable(IPCLIB_EVE2_ID);
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB interruptEnable failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB interruptEnable successful : EVE1!! =%d \n ",status);
            System_flush();
        }
    
        System_printf("\n Registering the IpcLib event..... \n");
        System_flush();
        status =
               IpcLib_interruptRegisterEvent(
                 IPCLIB_EVE2_ID,
                 6,
                 (IpcLib_InterruptCallback) (&eve11_IPC_CallbackFun),
                 NULL);
    
        if (status != IPCLIB_SOK)
        {
            System_printf("Register event failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("Register event successful : EVE1! = %d! \n ", status);
            System_flush();
        }
    
        System_printf("\n Calling IpcLib_interruptSendEvent()  ..... \n");
        System_flush();
    
        status = IpcLib_interruptSendEvent(IPCLIB_EVE2_ID, EVE_LOADING_IPC_EVENT_ID, EV1_EVE2_EVENT_NOTIFY, FALSE);
        if (status != IPCLIB_SOK)
        {
            System_printf("Message sent event failed : EVE1! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("Message sent event successful : EVE1! = %d! \n ", status);
            System_flush();
        } 
    }
    
    Void Taskfxn_2(UArg arg1, UArg arg2)
    {
        System_printf("\n Hello !! This is from taskfxn_2() >>. DONE....\n");
        System_flush();
    
    }
    
    int main(int argc, char** argv)
    {
        Task_Handle task1, task2;
        Error_Block eb1,eb2;
        Task_Params taskparams1,taskparams2;
        int status;
    
        System_printf("\n Starting main()\n");
        System_flush();
    
        Error_init(&eb1);
        Error_init(&eb2);
    
        Task_Params_init(&taskparams1);
        Task_Params_init(&taskparams2);
      
        taskparams1.priority = 2;
        taskparams2.priority = 1;
    
        task1 = Task_create(Taskfxn_1, &taskparams1, &eb1);
        task2 = Task_create(Taskfxn_2, &taskparams2, &eb2);
    
        if(NULL==task1 || NULL==task2)
        {
            System_abort("\n Error in creating a task for eve1 \n");
            System_flush();
        }
    
        BIOS_start();
    	return 0;
    }
    
    Void eve11_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status)
    {
    
      uint32_t paylodRecv;
      paylodRecv = payload;
    
    }
    
    
    
    
    
    
    main_EVE2.txt
    #include <xdc/std.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    
    #include <xdc/runtime/System.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/Memory.h>
    
    #include "ipclib_interrupt.h"
    
    #define EVE_LOADING_IPC_EVENT_ID 8
    
    Void eve22_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status);
    
    
    uint32_t paylodRecv;
    uint32_t event_acc=0;
    
    
    Void Taskfxn_1(UArg arg1, UArg arg2)
    {
        System_printf("Hello !! This is from taskfxn_1(): EVE2 \n");
        System_flush();
    
        Int32 status = 0;
    
        UInt16  eveProcId = MultiProc_getId("EVE1");
        printf("\n EVE1 Id = %d", eveProcId);
        printf("\n Im a task function of eve2 \n ");
    
        System_printf("\n Initializing IPC lib on EVE2  ..... \n");
        System_flush();
        uint32_t numprocs = 0U;
    
        IpcLib_InterruptInitPrms initPrm;
        IpcLib_interruptSetDefaultInitPrm(&initPrm);
    
         initPrm.validProcIds[numprocs] = IPCLIB_EVE1_ID;
         numprocs++;
         initPrm.validProcIds[numprocs] = IPCLIB_EVE2_ID;
         numprocs++;
    
        initPrm.numValidProcs   = numprocs;
        initPrm.msgTimeOut      = 0xFFFF;
    
        status = IpcLib_interruptInit(&initPrm);
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB initialization failed : EVE2! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB initialization successful : EVE2!! =%d \n ",status);
            System_flush();
        }
    
         status = IpcLib_interruptEnable(IPCLIB_EVE1_ID);
        if (status != IPCLIB_SOK)
        {
            System_printf("IPC_LIB interruptEnable failed : EVE2! = %d! \n ", status);
            System_flush();
        }
        else
        {
            System_printf("IPC_LIB interruptEnable successful : EVE2!! =%d \n ",status);
            System_flush();
        }
    
        System_printf("\n Registering the IpcLib event..... \n");
        System_flush();
        status =
            IpcLib_interruptRegisterEvent(
                0,
                EVE_LOADING_IPC_EVENT_ID,
                (IpcLib_InterruptCallback) (&eve22_IPC_CallbackFun),
                NULL);
    
        if (status != IPCLIB_SOK)
        {
            System_printf("Register event failed : EVE2!! \n ");
            System_flush();
        }
        else
        {
            System_printf("Register event successful : EVE2!! \n ");
            System_flush();
        }
        
        System_printf("\n Registering the IpcLib event DONE ..... \n");
        System_flush();
        
    }
    
    Void Taskfxn_2(UArg arg1, UArg arg2)
    {
        System_printf("Hello !! This is from taskfxn_2(): EVE2 \n");
        System_flush();
    
         while (event_acc != 1);
        System_printf(" EVE PAYLOAD = %d \n", &paylodRecv);
        System_flush();
    
    }
    
    int main(int argc, char** argv)
    {
        Task_Handle task1, task2;
        Error_Block eb1,eb2;
        Task_Params taskparams1,taskparams2;
         int status;
    
        System_printf("Starting main(): EVE2\n");
        System_flush();
    
    
        Error_init(&eb1);
        Error_init(&eb2);
    
        Task_Params_init(&taskparams1);
        Task_Params_init(&taskparams2);
      
        taskparams1.priority = 2;
        taskparams2.priority = 1;
    
        task1 = Task_create(Taskfxn_1, &taskparams1, &eb1);
        task2 = Task_create(Taskfxn_2, &taskparams2, &eb2);
        
    
        if(NULL==task1 || NULL==task2)
        {
            System_abort("\n Error in creating a task for EVE");
            System_flush();
        }
    
        BIOS_start();
    
    	return 0;
    }
    
    Void eve22_IPC_CallbackFun(uint32_t remoteProcId,
                               uint32_t eventId,
                               uint32_t payload,
                               void *arg,
                               int32_t status)
    {
      
      paylodRecv = payload;
      event_acc++;
    
    }
    

    Regards,
    Manavi

  • Hi Manavi,

    I think the cache is enabled in the SR1_FRAME_BUFFER_MEM region.

    You will need to perform cache maintenance routines to maintain the cache coherence between EVE1 and EVE2.

    Regards,
    Stanley