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.

IPC attach error if ownerprocid is not zero in C6678

Other Parts Discussed in Thread: SYSBIOS

Hi ,

     I am having evmC6678 ,I am trying to IPC among the 8 cores ,I have 8 projects and each project has it own .out file and i am loading it onto respective cores (8 cores) among those i did IPC it is working fine,when the ownerprocid is 0 ,please find the .cfg i used

var Notify = xdc.useModule('ti.sdo.ipc.Notify');
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');

var Cache = xdc.useModule('ti.sysbios.hal.Cache');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Settings = xdc.useModule('ti.csl.Settings');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');

Program.linkTemplate = "ti/targets/elf/linkcmdC6678.xdt";

var nameList = MultiProc.getDeviceProcNames();
var HeapBufMP   = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');

var System   = xdc.useModule('xdc.runtime.System');
var SysStd   = xdc.useModule('xdc.runtime.SysStd');
Ipc.procSync = Ipc.ProcSync_PAIR;
MultiProc.setConfig(null,[ "CORE0","CORE1","CORE2","CORE3","CORE4","CORE5","CORE6","CORE7"]);
BIOS.heapSize   = 0x8000;

System.SupportProxy = SysStd;

SharedRegion.numEntries = 2;
SharedRegion.translate = false;

SharedRegion.setEntryMeta(0,
    { base:  0x0C000000,
      len:   0x00200000,
      ownerProcId: 0,
      isValid: true,
      name: "internal_shared_mem",
    }
);

SharedRegion.setEntryMeta(1,
    { base:  0x0C200000,
      len:   0x00200000,
      isValid: true,
      name: "internal_shared_mem_data",
    }
);

my idea is to make ownerprocID as 4

if i change the ownerprocID to 4 i am getting error when i try to attach cores , firstly core0 to core4  getting  attached and i got error( ti.sdo.heapmem error ).

my question is it mandatory to have ownerprocid is 0 because sharedregion entry should be done with index 0 so that ipc_start is done ,in the same way to do ipc_attach() ownerprocid should be 0?

for the same above cfg i madefollowing change:

MultiProc.setConfig(null,[ "CORE4","CORE5","CORE6","CORE7","CORE0","CORE1","CORE2","CORE3"]);

and i given ownerprocid 0 only ipc_attach  works fine.

Please clarify ,Thanks in advance .

Regards,

Harikrishna

  • If you are synching all processors with "Ipc.procSync = Ipc.ProcSync_ALL;", I do see an issue here because all cores must attach to the owner before attaching to each other.  In this case, Ipc_start calls Ipc_attach() in a "For loop" so its a problem.

    If you are synching by pair, I do not see a restriction that the owner id has to be 0.  You must still attach to the owner before attaching to other cores.

    Could you post the actual error because I don't see why you shouldn't be able to do this?  Also, post your BIOS and IPC versions that you are using.

    Judah

  • Hi Judah,

                   i got error : ti.sdo.ipc.heaps.HeapMemMP: line 403: E_internal: An internal error occurred

    BIOS version : bios_6_34_02_18

    IPC version : ipc_1_25_00_04

    Regards,

    Harikrishna

  • someone please reply .

    Regards,

    Harikrishna

  • Hello Harikrishna:

        That error:

    > ti.sdo.ipc.heaps.HeapMemMP: line 403: E_internal: An internal error occurred

        is coming from a failed call to GateMP_openByAddr() in HeapMemMP.c:ti_sdo_ipc_heaps_HeapMemMP_Instance_init():

            status = GateMP_openByAddr(localAddr, (GateMP_Handle *)&(obj->gate));
            if (status != GateMP_S_SUCCESS) {
                Error_raise(eb, ti_sdo_ipc_Ipc_E_internal, 0, 0);
                return(1);

        as a result of a HeapMemMP_create() call.

         HeapMemMP_create() is being called from SharedRegion.c:ti_sdo_ipc_SharedRegion_start(), which is called from Ipc_start().

         HeapMemMP_create() can also be called from SharedRegion_setEntry(),  which I don't see being called directly from Ipc module.

         So, to confirm, is the error coming from Ipc_attach() or Ipc_start() call?  Can you please share the C code that calls Ipc_start() and Ipc_attach()?   And confirm if using Ipc.ProcSync_ALL or Ipc.ProcSync_PAIR?

    Many Thanks,

    - Gil
  • Hi Gil,

     i am using ipc.ProcSync_PAIR only , the cfg what is am using  is there in my first post .


    i have modified .cfg also find the attachment 1055.C6678_Master_0.cfg where i able to run successfully ,but the below changes in .cfg causes error

    in cfg i have config as this MultiProc.setConfig(null,[ "CORE0","CORE1","CORE2","CORE3","CORE4","CORE5","CORE6","CORE7"]); and ownerprocID is 4 then i got error , if MultiProc.setConfig(null,[ "CORE4","CORE5","CORE6","CORE7","CORE0","CORE1","CORE2","CORE3"]); is used ownerprocID as 0 it worked . what is the exact reason for  ownerprocID should always be 0  ?

    i cannot provide the entire C code , as  i can't share it ,  i can provide  the attach function  , it is running on core0

    #define MSMCRAM_MSG_SHR_ID            0
    #define MSMCRAM_MSG_HSK_SHR_ID        1
    #define DDR3_C0_DATA_SHR_ID            2
    #define DDR3_C1_DATA_SHR_ID            3
    #define DDR3_C2_DATA_SHR_ID            4
    #define DDR3_C3_DATA_SHR_ID            5
    #define DDR3_C4_DATA_SHR_ID            6
    #define DDR3_C5_DATA_SHR_ID            7
    #define DDR3_C6_DATA_SHR_ID            8
    #define DDR3_C7_DATA_SHR_ID            9

    Int
    attach (
        Int num
    ) {

        int status;


        SharedRegion_Entry share;
        SharedRegion_Entry share1;
        SharedRegion_Entry share2;



        if ( SharedRegion_getEntry(MSMCRAM_MSG_SHR_ID, &share) == SharedRegion_E_FAIL ) {
            printf("\nSharedRegion_getEntry failed");

            return -1;
        }

        if ( share.isValid == FALSE ) {
            printf("\nNo Valid Shared memory");

            return -1;
        }

        if ( SharedRegion_getEntry(MSMCRAM_MSG_HSK_SHR_ID, &share1) == SharedRegion_E_FAIL ) {
            printf("\nSharedRegion_getEntry failed");

            return -1;
        }

        if ( share1.isValid == FALSE ) {
            printf("\nNo Valid Shared memory");

            return -1;
        }

        if ( SharedRegion_getEntry(DDR3_C4_DATA_SHR_ID, &share2) == SharedRegion_E_FAIL ) {
           printf("\nSharedRegion_getEntry failed");

            return -1;
        }

        if ( share2.isValid == FALSE ) {
            printf("\nNo Valid Shared memory");

            return -1;
        }

        if ( (status = Ipc_start()) < 0 ) {
            printf("\nIpc start failed");

            return -1;
        }

        do {
            status = Ipc_attach(4);
        } while ( status < 0 );

     
        return 0;
    }
     and on core4

    Int
    attach (
        Int num
    ) {

        int status;


        SharedRegion_Entry share;
        SharedRegion_Entry share1;
        SharedRegion_Entry share2;



        if ( SharedRegion_getEntry(MSMCRAM_MSG_SHR_ID, &share) == SharedRegion_E_FAIL ) {
            printf("\nSharedRegion_getEntry failed");

            return -1;
        }

        if ( share.isValid == FALSE ) {
            printf("\nNo Valid Shared memory");

            return -1;
        }

        if ( SharedRegion_getEntry(MSMCRAM_MSG_HSK_SHR_ID, &share1) == SharedRegion_E_FAIL ) {
            printf("\nSharedRegion_getEntry failed");

            return -1;
        }

        if ( share1.isValid == FALSE ) {
            printf("\nNo Valid Shared memory");

            return -1;
        }

        if ( SharedRegion_getEntry(DDR3_C4_DATA_SHR_ID, &share2) == SharedRegion_E_FAIL ) {
           printf("\nSharedRegion_getEntry failed");

            return -1;
        }

        if ( share2.isValid == FALSE ) {
            printf("\nNo Valid Shared memory");

            return -1;
        }

        if ( (status = Ipc_start()) < 0 ) {
            printf("\nIpc start failed");

            return -1;
        }

        do {
            status = Ipc_attach(0);
        } while ( status < 0 );

     
        return 0;
    }

     attach only i will give the error .

    The error is coming beause on ipc_attach only , ipc_start is happening successfully. But what is the reason

    Regards,

    Hari.


  • Hi Hari, 

    Its not mandatory that Owner Id should be 0 always. If you want to set any other Id as owner other than 0, you can dynamically configure it by using

    SharedRegion_setEntry(0, &entry) in your c file.

    Example:

    entry.ownerProcId = 0;
    entry.base = (unsigned int *)0x8E000000;
    entry.len = 0x00100000;
    entry.isValid = 1;
    entry.name = "shared_mem";
    entry.cacheEnable = 1;
    entry.cacheLineSize = 128;
    entry.createHeap = 0;
    SharedRegion_setEntry(0, &entry); 

    Regards,

    Krishna

  • Hi Krishna,

                   Thanks for your reply.

    Regards,

    Harikrishna.K

  • Hi Krishna,

                        In my project i modified accordingly , it did not work for me when i change the ownerprocID to other than 0 .IPC_attcah failed.

    Regards,

    Harikrishna