mbox: xmbox_tapp_example.c File Reference

| mbox Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xmbox_tapp_example.c File Reference

## Overview

This file contains a design example for using the Mailbox hardware and driver XMbox.

This example attempts to send a known message through the mailbox from the processor identified as 0 (XPAR_CPU_ID=0) to the other processor. The message is received by the receiver and the test passes. Since the application is running on two seperate processors, the initiator declares success when the message is sent and the receiver declares success when the message is received. There is no feedback to the initiator so a terminal is required for each processor to verify that the test passed for both sides.

The example assumes there are two processors availabile in the system that are expected to inter-communicate. If Mailbox is connected to only one Processor then Data has to be sent from one port and should be received from another port.

This example has been tested on ML505 Hardware Evaluation board.

Note

These code fragments will illustrate how the XMbox component can be used to:

- Initialize the Mailbox core
- pass data between two processors.

      MODIFICATION HISTORY:

      Ver   Who  Date        Changes

      1.00a va            First release
      1.00a ecm  06/09/07 Cleanup, new coding standard, check into XCS
      1.01a ecm  08/28/08 converted to testapp example
      1.01a ecm  10/28/08 corrected output to match the requirements for TestApp
                          integration.
      2.00a hm   04/09/09 Added receiving data from the other processor.
      3.01a sdm  05/06/10 Cleanup for coding guidelines and removed printfs
      4.1   ms   01/23/17 Modified xil_printf statement in main function to
                          ensure that "Successfully ran" and "Failed" strings
                          are available in all examples. This is a fix for
                          CR-965028.
            ms   04/05/17 Added tabspace for return statements in functions for
                          proper documentation while generating doxygen.
    *

## Functions
int | MailboxExample (u16 MboxDeviceId)
| This function sends a message to and receives a message from the other processor. More...
int | main (void)
| This function is the main function for the mailbox example. More...

## Function Documentation

int MailboxExample | ( | u16 | MboxDeviceId | ) |

This function sends a message to and receives a message from the other processor.

Parameters

  MboxDeviceID | is the device Id of the MailBox.

Returns
  - XST_SUCCESS if the test passes.
  - XST_FAILURE if the test fails.

Note
  None.

References XMbox_Config::BaseAddress, MailboxExample_Receive(), MailboxExample_Send(), and XMbox_CfgInitialize().

int main | ( | void |  | ) |

This function is the main function for the mailbox example.

Parameters

  None. |

Returns
  XST_SUCCESS if successful, XST_FAILURE if unsuccessful.

Note
  None.

References MailboxExample().