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.

EVM6670 MessageQ open problem

Other Parts Discussed in Thread: SYSBIOS

Hi

I am running two binaries on core 0 and core 1 of Evm6670 .

I have defined a shared memory and a Heapbuf_MP on this shared region.Both the core can open the heap but core0 task is crashing while doing MessageQ_open for remote messageQ with Stack Overflow. 

[C66XX_0] ti.sysbios.knl.Task: line 334: E_stackOverflow: Task 0x9cc482e8 stack overflow.

Tried with ROV but could not find the task 0x9cc482e8 . Any idea when this can happen and how to find which task is giving stack overflow?

regards

Soumya

  • 1.  Do you have multiple Tasks on core0?

    2.  Are your tasks created dynamically at runtime in your *.c file or statically in your *.cfg file?

    3.  Did you try putting a breakpont at the MessageQ_open() call or calls to determine which one is causing the stack overflow?

    4.  Why don't you just increased the stack size for all tasks then you can see how much stack they use from ROV and scale the sizes back as needed.

    Judah

  • Hi Judah

    1.Yes I have multiple tasks on core 0. But none of these task id is matching with the stack overflow task id in ROV task details.

    2. Core 0 is running NDK, so the first task is statically created from cfg file...from Network open further task is created which is doing this HeapBufMP_create on shared region 1.Attaching code snippet below.

    3. I tried with breakpoints, the moment the control enters into below do while loop, the stack overflow happens even if I comment the messageq_open call also.

    4. Already I have increased all user dfined task stack size to 1MB and 2MB...so that should not be a prob..i just need to find which is this task overflowing the stack and not present in ROV display

    5. Also please let me know I can use same HEAPID value in both core while registering messageq with heap?

    Code snippet

    -- Core 0 --

    /*************************************************************************/
    volatile UInt32 *kick0 = (volatile UInt32 *)0x02620038;
    volatile UInt32 *kick1 = (volatile UInt32 *)0x0262003C;
    kick0[0] = 0x83e70b13;
    kick1[0] = 0x95a4f1e0;
    /*************************************************************************/


    HeapBufMP_Handle heapHandle;
    HeapBufMP_Params heapBufParams;
    /*
    * Create the heap that will be used to allocate messages.
    */
    HeapBufMP_Params_init(&heapBufParams);
    heapBufParams.regionId = 1;
    heapBufParams.name = HEAP_NAME;
    heapBufParams.numBlocks = 1;/** May need to increase later based on network speed **/
    //heapBufParams.blockSize = sizeof(MessageQ_MsgHeader);
    heapBufParams.blockSize = 2048; /** Includes 32 Byte MsgQ Header + data size **/
    heapHandle = HeapBufMP_create(&heapBufParams);
    if (heapHandle == NULL) {
    System_abort("HeapBufMP_create failed\n" );
    }
    else
    {
    System_printf("HeapBufMP_create success:\n");
    }
    /* Register this heap with MessageQ */
    MessageQ_registerHeap((IHeap_Handle)heapHandle, HEAPID);

    messageQ = MessageQ_create(localQueueName, NULL);
    if (messageQ == NULL) {
    System_abort("MessageQ_create failed\n" );
    }
    else
    {
    System_printf("local MsgQ_create success\n");
    }
    /* Open the remote message queue. Spin until it is ready. */
    #if 1
    do {
    System_printf("Inside do while loop\n");
    Task_sleep(10000);
    status = MessageQ_open(nextQueueName, &remoteQueueId);
    /*
    * Sleep for 1 clock tick to avoid inundating remote processor
    * with interrupts if open failed
    */
    if (status < 0) {
    Task_sleep(1);
    }
    } while (status < 0);
    #endif
    System_printf("Remote MsgQ_open success\n");

    /* Allocate a message to be ping-ponged around the processors */

    msg = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader));
    if (msg == NULL) {
    System_abort("MessageQ_alloc failed\n" );
    }
    else
    {
    System_printf("MsgQ_alloc success\n");
    }

    ---Core 1 --

    /* Open the heap created by the other processor. Loop until opened. */
    do {
    System_printf("HeapBufMP_open trying ..\n");
    status = HeapBufMP_open(HEAP_NAME, &heapHandle);
    /*
    * Sleep for 1 clock tick to avoid inundating remote processor
    * with interrupts if open failed
    */
    if (status < 0) {
    System_printf("HeapBufMP_open Sleeping ...\n");
    //Task_sleep(1);
    }
    else
    {
    System_printf("HeapBufMP_open success\n");
    }
    } while (status < 0);
    /* Register this heap with MessageQ */
    MessageQ_registerHeap((IHeap_Handle)heapHandle, HEAPID);
    /* Create the local message queue */
    messageQ = MessageQ_create(localQueueName, NULL);
    if (messageQ == NULL) {
    System_abort("MessageQ_create failed\n" );
    }
    else
    {
    System_printf("local MsgQ_create success\n");
    }
    /* Open the remote message queue. Spin until it is ready. */
    do {
    status = MessageQ_open(nextQueueName, &remoteQueueId);
    /*
    * Sleep for 1 clock tick to avoid inundating remote processor
    * with interrupts if open failed
    */
    if (status < 0) {
    Task_sleep(1);
    }
    } while (status < 0);
    System_printf("Remote MsgQ_open success\n");
    /* Allocate a message to be ping-ponged around the processors */

    msg = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader));
    if (msg == NULL) {
    System_abort("MessageQ_alloc failed\n" );
    }
    else
    {
    System_printf("MsgQ_alloc success\n");
    }

  • Hi, the code you posted is not readable because all the indents are left justified.

    It doesn't make sense that its not in ROV.  Can you put some screen shots up of ROV when all Tasks have been created but before you program crashes?

    It could be that the overflow is overwriting the Task object.  Have you tried stepping through the code to see if you can reproduce the problem?

    Furthermore, are you sure that core 0 and core 1 memory map are not colliding with one another?

    Judah