When I create two instances of sys/bios mailbox object, and try to post one of them, the other one gets signaled. I have the same issue, whether I create objects via C code or via cfg editor.
Furthermore,HMailBox1 and HMailBox2 pointers are different when I watched em. If I am doing something wrong, then what should I do to make two mailbox objects not interrupt each others. Below is the code that causes the issue:
(bios version 6_41_00_26)
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Mailbox.h>
ti_sysbios_knl_Mailbox_Handle HMailBox1;
ti_sysbios_knl_Mailbox_Handle HMailBox2;
/*
* ======== taskFxn ========
*/
Void taskFxn1(UArg a0, UArg a1)
{
while(1)
{
//Task_sleep(1000);
unsigned char message;
// this one gets signaled when HMailBox2 is post!!!
int success = Mailbox_pend(HMailBox1, &message, BIOS_WAIT_FOREVER);
}
}
Void taskFxn2(UArg a0, UArg a1)
{
int semId =4;
while(1)
{
Task_sleep(1000);
Mailbox_post(HMailBox2, &semId, 0);
System_printf("taskFxn2()\n");
System_flush(); /* force SysMin output to console */
}
}
/*
* ======== main ========
*/
Int main()
{
Task_Handle hTask1, hTask2;
Error_Block eb;
System_printf("enter main()\n");
Error_init(&eb);
hTask1 = Task_create(taskFxn1, NULL, &eb);
if (hTask1 == NULL) {
System_printf("Task_create1() failed!\n");
BIOS_exit(0);
}
hTask2 = Task_create(taskFxn2, NULL, &eb);
if (hTask2 == NULL) {
System_printf("Task_create2() failed!\n");
BIOS_exit(0);
}
Mailbox_Params pr1, pr2;
Mailbox_Params_init(&pr1);
Mailbox_Params_init(&pr2);
pr1.__iprms.name = "osman";
HMailBox1 = Mailbox_create(1, 8, &pr1, &eb);
pr2.__iprms.name = "mahmut";
HMailBox2 = Mailbox_create(1, 8, &pr2, &eb);
BIOS_start(); /* does not return */
return(0);
}
thanks