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.

Using mailboxes from Timer function

Good day!

I am porting the old project made for LM3S Stellaris MCU to the new Tiva MCU. The old project was made using SYS/BIOS 6.32.02.39, and new is using TI-RTOS with SYS/BIOS 6.45.01.29.

I was using Mailbox_post to send messages from Timer function to the main Task loop, and this worked fine. But now upon the Mailbox_post call I got the "assertion failure: A_badContext: bad calling context. Must be called from a Task." excepton.

Is there any workaround for this situation? Thank you!

  • We added some addtional checks in the newer version. You are not supposed to call Mailbox_post with a non-zero timeout from a Hwi or Swi. Can you confirm you are supplying a non-zero timeout in your timer function and change it to zero (or BIOS_NO_WAIT). Make sure you check the return from Mailbox_post for a failure and act accordingly.

    If this was the case, you were getting lucky with the previous release:)

    Todd
  • Thank you, there was BIOS_WAIT_FOREVER, and the Mailbox_getNumFreeMsgs call was used to check if post will block.