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.

Impliciting Posting Events with a Mailbox

Other Parts Discussed in Thread: SYSBIOS

Dear Support:

I am following the example of implicit posting of events with a Mailbox in the Sys/BIOS Users Guide section 4.2.1 and following the example pretty much verbatim.  However when I perform the mailbox post, I am not getting an event to trigger and hence the Event_pend(...) call never returns.  However if I follow the mailbox post with an event post, then no issue - I get the event and then do the mailbox pend to get the message.

But per my understanding, if during the creation of my mailbox, I perform the following:

mboxParams.readerEvent  = myEvent;

mboxParams.readerEventId = Event_Id_XX.

then when I perform a Mailbox_post(...) call, that an event is triggered such that the Event_pend(...) returns, correct?  If so, that is definitely not happening.  The only way I can get this to work is to issue a Event_post(...) after my Mailbox(post(...) call which I don't think I should have to do this, correct?  If so, do you know what I may be missing to get this to work properly?  Please advise.

Thanks,
Tim

  • Hi Tim,

    Which device and TI-RTOS / SYSBIOS version are you using?

    Have you added the correct code in your .cfg file?

    Semaphore.supportsEvents = true;

    Also, I am not sure whether it is your case, but if SYS/BIOS is running from ROM, implicit events are not supported.

    Here is a link to my previous thread about this.

    Regards,

    Michel

  • Hey Michel:

    Thanks for your response.  I am using the TM4C1294 and the version of TI-RTOS is v2.16.1.14.

    Your response leaves me perplexed with a few questions?

    Where did this "Semaphore.supportsEvent=true" come from?  I don't see this anywhere in the TI-RTOS Kernel Users Guide.

    And why a semaphore statement in the config file when only using an Event and a Mailbox?

    How would run SYS/BIOS from ROM vs FLASH.  To my knowledge, I think I am running from FLASH.

    Thanks,
    Tim

  • Hi Tim,

    Tim Simerly said:
    Where did this "Semaphore.supportsEvent=true" come from?  I don't see this anywhere in the TI-RTOS Kernel Users Guide.

    I found it in the forums. I have yet to see it in some form documentation.

    Tim Simerly said:
    And why a semaphore statement in the config file when only using an Event and a Mailbox?

    Don't quote me on that one, but I believe the background mechanism of the mailbox is a Semaphore. The semaphore can count and it has a blocking mechanism which is only logical to use with the mailbox.

    Tim Simerly said:
    How would run SYS/BIOS from ROM vs FLASH

    I don't know whether that's the case for the TM4C, but for some devices, TI has placed the most communly used SYS/BIOS functions and modules into ROM to save Flash space. If you are running  from ROM, then you will get a compile error after you add the "supportEvents" line in your .cfg file.

    Regards,

    Michel

  • Hey Michel:

    Thanks again for your response.  Well it did indeed work by adding the "Semaphore.supportsEvent=true" statement to the .cfg file.  I got no compile error, however I did have to move the creation of my mailboxes from the .cfg file to using code to do so.  Not a big deal, but a little perplexed why that was required.  Thanks for responding to my question and helping me to resolve the problem.  I will get with our factory folks to request them to update the documentation to accurately describe how to do this instead of having to go searching through forum posts to figure this out.

    Thanks,
    Tim

  • Hi All,

    I'll open an enhancement request to mention that Semaphore.supportsEvents must be set to true in the configuration file in the kernel's UG. Please note the following two things though

    1. The cdoc for the Mailbox module has this on all the *Event and *EventId configuration settings: "Note that Semaphore.supportsEvents has to be set to true for Mailbox to support Events."

    2. If you have asserts enabled for the kernel (instrumented build or custom with BIOS.assertsEnabled set to true), there would have been an assert triggered when the Mailbox's semaphores were created (actually constructed).

        /* Make sure that supportsEvents is TRUE if params->event is not null */
        Assert_isTrue((Semaphore_supportsEvents == TRUE) ||
                   ((Semaphore_supportsEvents == FALSE) &&
                    (params->event == NULL)), Semaphore_A_noEvents);

    When things are working as expected, I generally recommend using the instrumented libraries or enable asserts to flush out any usage issues.

    Todd