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.

A problem about id cannot be larger than numEntries

Other Parts Discussed in Thread: SYSBIOS

hello,

I use the ListMP module to communicate in the six cores of 6472, but when the program run to the ListMP_putTail() function ,i got a problem like this:

ti.sdo.ipc.SharedRegion: line 327: assertion failure: A_idTooLarge: id cannot be larger than numEntries

xdc.runtime.Error.raise: terminating execution

 

the ListMP module is created in the core0,and ListMP module could be opened successfully by calling ListMP_open().

Could anyone tell me what the id reffer to? and how to solve this problem? Thank you!

I use the CCS Version: 4.2.0.10012 and ipc_1_21_02_23. The program is running in the TMS320C6472EVM.

Regards.

Jianlei

 

 

 

 

 

  • Hi Jianlei,

    This error is coming out of the following function, which takes 'id' as an argument:

    SharedRegion_SRPtr SharedRegion_getSRPtr(Ptr addr, UInt16 id)

    Do you know if you are calling this function in your code?  (I'm not sure if it's only called internally or not)

    The assert is happening because the id argument is greater than  ti.sdo.ipc.SharedRegion.numEntries (= 4).

    I also see that the above mentioned function is called with 'regionId' as the 'id' argument.  Is it possible that you are configuring the 'regionId' parameter of GateMP, ListMP or NameServerRemoteNotify in your program?

    Thanks,

    Steve

  • Hi,Steve

    Thank you for your reply.

    I do not call the SharedRegion_SRPtr SharedRegion_getSRPtr(Ptr addr, UInt16 id); 

    and i use the SharedRegion_getIdByName( string Name) to get the regionId and the value is 0;

    typedef struct Rec {
        ListMP_Elem elem;
        Int data;
    } Rec;

    Rec *buf;
    Rec* elem;
    /*
     *  ======== tsk0_func ========
     *  This function is executed only on CORE0.
     */
    Void tsk0_func(UArg arg0, UArg arg1)
    {
        Int status;
        Rec rec1;
        gateHandle = GateMP_getDefaultRemote();
    ListMP_Params_init(&listParams);
    listParams.gate = gateHandle;
    listParams.name = "myListMP";
    listParams.regionId = 0;
    listHandle = ListMP_create(&listParams);
    do{
    status = ListMP_open("myListMP",&listHandle);
    }
    while(status<0);
    System_printf("ListMP_create sucess\n");
    rec1.data = MultiProc_self();
    System_printf("rec1.data:%d\n",rec1.data);
    ListMP_putTail(listHandle,&rec1.elem);//When i setp into this line ,i got the error.
    if (ListMP_empty(listHandle) == TRUE){
    System_printf("Yes,listHandle is empty\n");
    }
    while((elem = (Rec *)ListMP_getTail(listHandle)) == NULL){
    System_printf("ListMp_getTail failed\n");
    }
    System_printf("The Tail Element:%d\n", elem->data);
    buf = Memory_alloc(SharedRegion_getHeap(0),(sizeof(Rec)*6),128,NULL);
        System_exit(0);
    }
    /*
     *  ======== tsk1_func ========
     *  This function is executed on every processor except on CORE0.
     *
     *
     */
    Void tsk1_func(UArg arg0, UArg arg1)
    {
    //No code in this part
    }
    Int main(Int argc, Char* argv[])
    {
        Ipc_start();
        /* Create a unique 'master' Task if on proc 0 */
        if (MultiProc_self() == 0) {
            Task_create(tsk0_func, NULL, NULL);
        }
        else {
            Task_create(tsk1_func, NULL, NULL);
        }
        BIOS_start();
        return (0);
    }

    the code in the *.cfg file:
    var SysStd = xdc.useModule('xdc.runtime.SysStd');
    var System = xdc.useModule('xdc.runtime.System');
    System.SupportProxy = SysStd;

    var MultiProc        = xdc.useModule('ti.sdo.utils.MultiProc');
    MultiProc.setConfig(null, ["CORE0", "CORE1", "CORE2",
                               "CORE3", "CORE4", "CORE5"]);
                               
    var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
    var Notify           = xdc.useModule('ti.sdo.ipc.Notify');
    var ListMP = xdc.useModule('ti.sdo.ipc.ListMP');
    var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');

    /* BIOS/XDC modules */
    var BIOS        = xdc.useModule('ti.sysbios.BIOS');
    var Task        = xdc.useModule('ti.sysbios.knl.Task');
    var Memory     = xdc.useModule('xdc.runtime.Memory');
    Memory.defaultHeapSize = 0x8000;
    Program.heap = 0x8000;
    for (var i = 0; i < MultiProc.numProcessors; i++) {
        Ipc.setEntryMeta({
            remoteProcId: i,
            setupMessageQ: false,
        });
    Ipc.procSync = Ipc.ProcSync_ALL;

    /* Shared Memory base address and length */
    var SHAREDMEM           = 0x200000;
    var SHAREDMEMSIZE       = 0xc0000;
    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.numEntries = 6;
    SharedRegion.setEntryMeta(0,
        { base: SHAREDMEM,
          len:  SHAREDMEMSIZE,
          ownerProcId: 0,
          isValid: true,
          name: "SL2_RAM",
          createHeap: true,
        });
    I do not configure the 'regionId' parameter of GateMP and NameServerRemoteNotify.
    So is there any other way to solve this problem?
    Best regards
    Jianlei

  • What this usually means is that you try to put an element into the ListMP that did not come from a shared memory region.

    I notice you are using an old version of Ipc.  Can you move to a later version?  We've fixed lots of bugs since your version.

    My suggestion would be to move to Ipc 1.23.04.36 and move to BIOS 6.32.04.49

    Judah

  • What this usually means is that you try to put an element into the ListMP that did not come from a shared memory region.

    Do you mean that i should put or creat an element in the shared memory region first, and then put that element to the ListMP?

    And could you paste the site of the latest IPC?I use the CCSV4 to update my IPC, but it shows there is no updates for the currently version. Thank you.

  • Jianlei,

    Yes, any element that you try to put on a ListMP must come from a Shared Region.  The reason is because a ListMP is supposed to be shared across different processors.

    You can grab the latest Ipc and BIOS from:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/index.html

    Judah