In this section, you will learn how to transfer information between the heterogeneous cores. To accomplish this, Linux has the Remote Processor Messaging framework, known as RPMsg. It is based on virtio, which is an I/O virtualization framework.

RPMsg allows kernel drivers to communicate with remote processors, so one can develop userspace applications where these drivers are used to achieve send and receive data from a remote processor to further process it.

In this module, you will:

Create and configure an Eclipse RPMsg project for the Cortex-M4 core

Build the application and run it on your module, evaluating on both cores

Enter the middleware/multicore/open-amp/porting/env folder and delete the freertos folder. These are environment definitions for using RPMsg with FreeRTOS applications. Since we're going with a bare-metal implementation in this example, we can delete the FreeRTOS definitions and keep the bm folder.

Since the processor cores on the Colibri iMX7 have access to the same peripherals, we must disable some of them to avoid conflicts.

By default, the device tree on the Toradex-provided Linux image uses UART_B, which is the UART port used for debug on the M4 core, so we must disable it on Linux to avoid a kernel panic.

It can be done either by modifying the status property for the peripheral on the device tree to disabled (see Device Tree Customization) or, as a temporary solution, using the fdt_fixup command on U-Boot:

Now you can open the TTY device and run write and read operations like you would do with an UART port. The following code opens the device, assigns it a file descriptor, writes and reads to int, then closes it: