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.

IPC MessageQ_open Threading problems

Other Parts Discussed in Thread: SYSBIOS

Hello,

I am currently working with the device DM8148 and IPC 1.22.03.23.

I have some questions regarding the threading support available for the MessageQ API since we
are experiencing issues when using it.

Is it neccessary for all threads that wants to post message on a queue to call the MessageQ_open function?
What happens if you don't do this and just distribute the Queue ID to the using threads and then start using
MessageQ_put, MessageQ_alloc?

Background to the problem:
Our messaging code is initializing one Mailbox on the A8 and one Mailbox on the M3ISS core. Each core is also
opening both its local and remote queues using the MessageQ_open function. Everything seems to be running fine
as long as I publish messages from the same thread that called MessageQ_open.

However, on the M3ISS core we have two running threads, both of which is sharing our so called "IPC wrapper" module and whose
functions are thread safe, this module is internally using the MessageQ. The module is creating the queues and also calls MessageQ_open
upon initialization of the whole system. This module is then shared between many threads that need to send messages.

When having this setting, as soon as MessageQ_put is called in some thread other than the main one, follwing happens:

ti.sysbios.family.arm.m3.Hwi: line 712: E_hardFault: FORCED
ti.sysbios.family.arm.m3.Hwi: line 789: E_busFault: PRECISERR
Exception occurred in ISR thread.
Exception occurred in ThreadType_Hwi.
Hwi handle: 0x8299babc.
Hwi stack base: 0x8298a310.
Hwi stack size: 0x8000.
R0 = 0x1d34656d R8 = 0x00000000
R1 = 0x8106c3f8 R9 = 0x00000000
R2 = 0x00040000 R10 = 0xffffffff
R3 = 0x8296ba23 R11 = 0xffffffff
R4 = 0x8299bbdc R12 = 0x82961b08
R5 = 0x00000010 SP(R13) = 0x82992258
R6 = 0x82998d24 LR(R14) = 0x829815d7
R7 = 0x8299b88c PC(R15) = 0x8297de6c
PSR = 0x61000020
ICSR = 0x0440f003
MMFSR = 0x00
BFSR = 0x82
UFSR = 0x0000
HFSR = 0x40000000
DFSR = 0x00000000
MMAR = 0x00040010
BFAR = 0x00040010
AFSR = 0x00000000
Terminating execution...

 

 

  • Hi Anders,

    You are not required to call MessageQ_open. As long as you have the queue id, you can call MessageQ_put. The queue id can be extracted from a message itself via the MessageQ_getReplyQueue. Take a look at "Sending a Message" section in the IPC User Guide for an example. Your setup with multiple tasks calling an internal MessageQ_put is a valid use case.

    Note: MessageQ_alloc does not take a queue id. It takes a heap id.

    You can look at the following for more details on how to decode the exception

    http://processors.wiki.ti.com/index.php/SYS/BIOS_FAQs#4_Exception_Dump_Decoding_Using_the_CCS_Register_View

    Todd