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_alloc()

Using IPC 1.21.02.23 with CCSv4 and SYS/BIOS 6.30.02.32 for the C6472 platform.

Is it alright to call MessageQ_alloc( ) from a helper function outside the function where a heap is registered and a MessageQ is explicitly opened?  For example, I have a BIOS Task MyTask( ) that registers with a SharedMemory heap with ID = 0 and opens up several MessageQ's created by another core.  I call a function Foo( ) from MyTask( ) and pass the MessageQ ID for a MessageQ that I would like to send messages over.  When I call MessageQ_alloc(0, sizeof(myMsg)) in Foo( ), the alloc fails. 

Is it necessary to allocate a MessageQ message in MyTask( ) and pass a message pointer to Foo( )?  Or am I just calling MessageQ_alloc( ) incorrectly from Foo( )? 

Once I can alloc a message, will using a passed MessageQ ID in MessageQ_put( ) cause the message to be placed on the appropriate queue?

Nick

  • Nick,

    You should be able to call MessageQ_alloc() from a function Foo() which is called from MyTask().  That should not be a problem since Foo() is still in a Task thread.  If you tried calling MessageQ_alloc() from a Swi thread then that would be a problem.  Can you please describe what you mean by fail?

    It should not be necessary to allocate the message from MyTask().

    Once you have an alloc'ed message and you call MessageQ_put() to a messageQ Id, the message will be correctly placed into that messageQ.

    Judah