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.

CCS/TM4C129XNCZAD: ROV Mailbox usage

Part Number: TM4C129XNCZAD

Tool/software: Code Composer Studio

Is there a way to get the maximum number of mailbox messages that were queued in a task's mailbox during a run sequence?

I want to make sure that each task has enough mailbox slots to handle its load.

Thanks,

-Mark

Using the ROV:Mailbox view, I get the following data that looks like it is a snap shot of the current conditions when the debugger was halted.

  • Hi Mark,

    There are the Mailbox_getNumFreeMsgs and Mailbox_getNumPendingMsgs APIs that you can use. Between the two you can get #free, #used and total (#free + #used). If you want to call both to get the total count, I'd disable interrupts around the calls to make sure you don't context switch out and have mailbox activity without you knowing it. The two APIs are fast (basically just a dereference).

    Int Mailbox_getNumFreeMsgs(Mailbox_Object *obj)
    {
    /* return the number of free msgs */
    return (obj->numFreeMsgs);
    }

    The APIs are described in more details in the TI-RTOS ( or SYS/BIOS) product. For example, you can navigate to Mailbox after you click the "TI-RTOS Kernel Runtime APIs and Configuration (cdoc)" link on this page dev.ti.com/.../

    Todd

  • Thanks for the prompt reply.
    I'll use those APIs.

    Another questions:
    In the ROV for TASK objects the 'Detailed' screen displays the 'StackSize' and the 'StackPeak'.
    Is there a way to use the ROV to get the same data for the 'Mailboxes'?

    Thanks again,
    -Mark
  • ROV will not show the actual mailbox messages or how much of the message is used. It will tell you how many messages there are and their size, how many we in use and how many are free.

    Mailbox has no knowledge of the actual message data.

    Note that the Mailbox_post and Mailbox_pend do not take a size. Each one just copies the size of the message specified in the creation of the mailbox. A common mistake is to supply to small of a buffer to the Mailbox_pend call. For example, if you created the mailbox with message size of 64, but you call Mailbox_pend with a buffer of 48, the module blindly copies 64 bytes into your buffer...thus overwritting 16 bytes.

    Todd