Dynamically allocate a RTX mailbox

Hello,

I'm using the Realview RTX and facing an issue of how to dynamically allocate a mailbox.

What I'm trying to create a reentrant function, which is called by some RTX tasks, and uses a mailbox to communicate with another task. I search through the RL-ARM manual and forum but all the examples show that the mailbox is declared globally. If so, the function is not reentrant anymore.

I have ask the Keil support but haven't received any response for this issue yet. So I put it here in hope that anyone could have the solution.

Thanks in advance for your answer.

Huy

Parents
  • Why do you need to dynamically create mailboxes? What is wrong with pre-allocated mailboxes?

    The sender must know if a mailbox exists, so you can't just create/destroy things without synchronization anyway.

    Please describe exactly what problem you are trying to solve. Your post do not mention why you need a reentrant function that allocates mailboxes. It isn't uncommon that you have a function that returns a mailbox ID - which (already existing) mailbox to use.

Reply
  • Why do you need to dynamically create mailboxes? What is wrong with pre-allocated mailboxes?

    The sender must know if a mailbox exists, so you can't just create/destroy things without synchronization anyway.

    Please describe exactly what problem you are trying to solve. Your post do not mention why you need a reentrant function that allocates mailboxes. It isn't uncommon that you have a function that returns a mailbox ID - which (already existing) mailbox to use.

Children
More questions in this forum