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.

MessageQ_put has an assertion failure

Hi,

I'm running the default qmss IPC benchmark code with a small modification.

When running everything as it comes, the code works fine, however, the moment I change the config file to say that the memory is not shared, strange things start happening.

I have tracked the problems down to the first call of MessageQ_put in the measure_latency() function.  The error that is printed out on the console is "A_invalidMsg", stating that the MessageQ_Msg provided == NULL.  However, I checked the value of the MessageQ_Msg (identifier is 'msg'), and the value is not null, for example, it might be 0x0c002a80.  However, the printout on the console is saying the failure occurred on line 383 of MessageQ.c, which checks if msg != NULL:

Assert_isTrue((msg != NULL), ti_sdo_ipc_MessageQ_A_invalidMsg); 

Also, while this code is running on core 0, the core that crashes due to this assert is core 1, which (at that point) I had spinning in a while(true) loop.

Here is an overview of the code:

UInt16 selfId; //Global

void measure_latency(){

   ...

   if(selfId == 0){

      ...

      msg = MessageQ_alloc(...);

      //Code gets to this point fine (core 0)

      //Once core 0 calls this method, core 1 crashes with A_invalidMsg from MessageQ.c, line 383

      MessageQ_put(..., msg);

      //Code does not reach this point (core 0)

      ...

   }

   for(...){

      //There is a commented out while(1) here, left there by TI.  I did not uncomment this while(1)

      while(1){

         //Core 1 is spinning here, doing nothing.  All interrupts are still enabled.

      }

      MessageQ_get(...);

      ...

   }

   ...

}

void task0(...){

   ...

   measure_latency();

   ...

}

int main(...){

   ...

   selfId = CSL_chipReadReg(CSL_CHIP_DNUM);

   ...

   Bios_start();

}