Tuesday, May 14, 2013

Communication with Remote Processor


Interrupt method

The interrupt method, which is the simplest of the three methods, lets one core send an interrupt to the other, as notification that an application-defined event has occurred. The interrupt routine is very compact, so it doesn’t require a lot of code space. The designer can specify a callback function, for execution during the interrupt, to perform some quick function. If the callback function isn’t used, it can be left as an empty function.
To signal the remote core, the local core issues the dedicated instruction SEV (send event), which is included in the Cortex architecture. Once an IPC notification is received, a flag variable is set. The flag variable can be used by the receiving core to check for status.
Message queue
In the message queue method, the designer defines two areas of shared memory, to be used to store messages that each core sends to the other. A Host Command buffer is dedicated to the commands sent from the master to the slave, and a separate Host Message Buffer is dedicated to the messages the slave sends back in response. Figure 1 shows the setup.
Figure 1. The message queue method for IPC in the LPC4300
Mailbox method
As the name implies, this method draws on the concept of a mailbox. Each core has a placeholder in RAM memory that is used to send and receive messages. Each core manages its own RAM mailbox, and messages are directed to the other core’s mailbox.

Reference:
NXP blog by