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.

mailbox_pend exception

Other Parts Discussed in Thread: SYSBIOS

I am getting an exception sometimes in mailbox_pend in sysbios. Seems to be in the queue portion of it.  Are there any specific rules as using this with timer interrupts or calling from different tasks. I thought it was thread safe but when I started to look into code I saw things about interrupt levels.

  • Hi James,

    You can call Mailbox_pend and Mailbox_post from a Task, Swi or Hwi. The only caveat is that the timeout must be 0 for the Swi and Hwi case.

    A common issue with Mailbox, is that people call Mailbox_pend with too small of a buffer. For example, let's say you create the Mailbox instance with a message size of 64. If you call Mailbox_pend with a buffer of 48, internally it is going to do a memcpy of 64 bytes and writing past the end of the buffer that was supplied in the Mailbox_pend.

    Could this be the case?

    Which version of SYS/BIOS are you using (and on which device)?

    You can look in ROV to see the exception call stack in the Hwi->Exception tab (this is supported for most devices).

    Todd