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.

[BIOS 5.33.06] MBX instance supports multiple writers ?

Hello,

I want to confirm whether a MBX instance supports multiple writers or not.
In other words, I would like to ask you how much level of gates has been implemented in BIOS5 MBX instance.

Let me explain the background.
My customer is using a MBX instance. There are two writers in their system:
1. A message writer from ISR instance. This ISR is being called periodically, just like timer callback.
2. A message writer from TSK instance.

When a single reader (actually, from another TSK instance) tries to read messages from the MBX instance, some messages that should be coming from ISR seems to be lost.
Please note they have already confirmed that MBX_post is always succeeded. And they are using MBX APIs correctly under the constraints and calling contexts described in Bios Users Guide.

They have already found workaround - that is to gate ISR just before calling MBX_post in TSK instance. 
So, I would like to confirm how much level of gates are implemented in MBX. I read Bios User's Guide, I could not find the descriptions for that.

Best Regards,
Kawada

  • Multiple writers to a MBX is allowed. Make sure the ISR is doing it with a timeout of zero when doing the MBX_post. Internally MBX_post calls a SEM_pend to allow it to pull a buffer off the "free" list. ISRs can only call SEM_pend with a timeout of zero.

    A common error is to post or pend with the wrong size buffer. For example let's look at the pend side. If you specified a size of 64bytes in the MBX_create, but pass a buffer of size 32 into MBX_pend, 64 bytes will be copied into the 32 buffer...thus corrupting the next 32 bytes.

    Todd

  • Hello Todd,

    Thank you for your answer. My customer is using 0 value for MBX_post timeout in both TSK and ISR. As for common error, we will suggest the same to customer to check such inconsistency can happen in message size.

    Best Regards,
    Kawada