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.

HeapBufMP_open crashing core0 in simulator

Other Parts Discussed in Thread: SYSBIOS

I am trying to get working code to run in the 6472 simulator and have run into a problem with IPC.  I have a program running in core0 and core 2.  The both start up fine, but when core2 gets to "HeapBufMP_open("MQHeap", &heap_handle);", core0 suddenly jumps to abort().

Digging deeper into HeapBufMP, it looks like when my core2 task gets to INameServerRemote_get in line 341 of NameServer.c, core2 hangs and core0 dies.  Core2 will continue to run the idle task.  The exact error output I see in the core0 debug console is the following:

ti.sdo.ipc.family.c647x.Interrupt: line 237: assertion failure: A_internal: An internal error has occurred

xdc.runtime.Error.raise: terminating execution

ti.sysbios.gates.GateMutex: line 114: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

xdc.runtime.Error.raise: terminating execution

 

I looked up the GateMutex and found some people recommending System.SupportProxy = SysMin; instead of SysStd in my .cfg file.  I made this change and it had no impact.

This code works in hardware, so any clues as to why NameServer would crash core0 on the simulator would be helpful.

 

Thanks

  • Hi Kevin,

    Which version of CCS, BIOS & IPC are you using?  Could you attach your application to this thread?

    Thanks,

    Shreyas

  • CCS 4.2.1.00004

    BIOS 6.31.04.27

    IPC 1.22.03.23

    I'll try to provide the important parts. 

     

    This is the code core0 executes:

     

    HeapBufMP_Params_init(&heap_buf_params);
       heap_buf_params.regionId       = 0;
       heap_buf_params.name           = "MQHeap";
       heap_buf_params.numBlocks      = 8;
       heap_buf_params.blockSize      = sizeof(BRONCO_MQMessage_s);
       heap_handle = HeapBufMP_create(&heap_buf_params);    
       if(heap_handle == NULL)
       {
          System_printf("HeapBufMP_create failed\n" );
       }
    
       // register the heap with message queue
       MessageQ_registerHeap((IHeap_Handle)heap_handle, 0);
    
       // create the local queue - listeners create queues
       sync_sem_handle = SyncSem_create(NULL, NULL);
       MessageQ_Params_init(&to_Core0_MQ_params);
       to_Core0_MQ_params.synchronizer = SyncSem_Handle_upCast(sync_sem_handle); 
       to_Core0_MQ_handle = MessageQ_create("ToCore0Queue", &to_Core0_MQ_params);    
       if(to_Core0_MQ_handle == NULL)
       {
          System_printf("MessageQ_create failed for ToCore0Queue\n" );
       };
    
       while(1)
       {
          status = MessageQ_get(to_Core0_MQ_handle, (MessageQ_Msg*)&to_Core0_MQ_msg_ptr, MessageQ_FOREVER);
    ......

    Core 0 then blocks on MessageQ_get.


    When core 2 starts up, The first thing it does is try to open the heap with 
       do {
          status = HeapBufMP_open("MQHeap", &heap_handle);
       } while (status < 0);
    the first call to HeapBufMP_open causes the problem.


    Both cores successfully call Ipc_start and BIOS_start before the above task code is run.

  • OK well I am foolish.  I was loading my core2 image onto the wrong core.  Everything works now

  • HI,Kevin:

    I meet the same problem as yours,in my project,core0 send message Q to core1.some code is below:

    core0 task:

    {

    ·······························

    HeapBufMP_Params_init(&heapBufParams);
    heapBufParams.regionId = 0;
    heapBufParams.name = HEAP_NAME;
    heapBufParams.numBlocks = 1;
    heapBufParams.blockSize = sizeof(MessageQ_MsgHeader);
    heapHandle = HeapBufMP_create(&heapBufParams);


    /* Register this heap with MessageQ */
    MessageQ_registerHeap((IHeap_Handle)heapHandle, HEAPID);

    ·····················

    }

    core1 task:

    {

    ··············

    do
    {
    status = HeapBufMP_open(HEAP_NAME, &heapHandle);
    } while (status < 0);

    ``````````````````

    }

    the problem is that core1 can't open the heap,want to ask what should I notice before I call the HeapBufMP_open?

    Thank you very much!