Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

mailbox problem

I want to communicate between two processors mailbox, I wrote the following code por the first processor:

and the following code for the second processor:

int main()

{

load_data(); //Charge le tableau Z depuis le fichier data.h

alt_u32 message = 0;

alt_mailbox_dev* send_dev;

alt_mailbox_dev* rec_dev;

// Open the two mailboxes between this processor and another

send_dev = altera_avalon_mailbox_open("/dev/mailbox_0");

rec_dev = altera_avalon_mailbox_open("/dev/mailbox_1");

altera_avalon_mailbox_post(send_dev, message);

while(message!=0)

{

message = altera_avalon_mailbox_pend(rec_dev);

// Wait for the other processor to send a message back

}

z6 = (short int*)0x00812028;

printf("CPU2: Mr1= %d\t", *(z6));

}

I want to communicate between two processors mailbox, I wrote the following code por the first processor:

and the following code for the second processor:

int main()

{

alt_u32 message = 0;

alt_mailbox_dev* send_dev;

alt_mailbox_dev* rec_dev;

// Open the two mailboxes between this processor and another

send_dev = altera_avalon_mailbox_open("/dev/mailbox_0");

rec_dev = altera_avalon_mailbox_open("/dev/mailbox_1");

while(message!=0)

{

message = altera_avalon_mailbox_pend(send_dev);

// Wait for the other processor to send a message back

}

load_data(); //Charge le tableau Z depuis le fichier data.h

altera_avalon_mailbox_post(rec_dev, message);

}

i don't know if i am in the right way or not??

can someone help me!

thks for all members

No RepliesBe the first to reply