AM62Px MCU+ SDK  09.02.01
IPC RP Message Linux Echo

Introduction

This example shows usage of RP Message APIs to exchange messages between RTOS/NORTOS CPUs as well as exchange message with Linux on Cortex-A CPU.

In this example,

  • We create two RP Message end points
    • One end point to exchange messages with Linux kernel
    • One end point to exchange messages with Linux user space and other RTOS/NORTOS CPUs
  • All cores on startup after driver initialization first wait for Linux to be ready
  • Then they announce the end points on which they are waiting for messages to Linux.
  • This is needed to be done else Linux cannot initiate message exchange with RTOS/NORTOS CPUs.
  • Two tasks are then created which listen for incoming messages and echo it back to the sender. The sender can be Linux CPU or other RTOS/NORTOS CPUs.
  • Meanwhile Linux kernel and user space test applications initiate message exchange with RTOS/NORTOS CPUs and wait for the echoed message.
  • The example also shows a "main" RTOS/NORTOS CPU exchanging message with other RTOS/NORTOS CPUs by sending messages to the same end point as that where LInux sends messages.
  • This shows that all CPUs can exchange messages with each other, no matter which OS or RTOS or NORTOS is running on the sender or receiver CPUs.

The example integrates bootloading funtionality with SBL on OSPI bootmedia. It also integrates Device manager functionality. The SBL stage 2 thread boots all the cores along with HLOS like Linux. Refer SBL Booting Linux From OSPI for boot flow sequence.

Supported Combinations

Parameter Value
CPU + OS mcu-r5fss0-0 freertos
wkup-r5fss0-0 freertos
Toolchain ti-arm-clang
Board am62px-sk
Example folder examples/drivers/ipc/ipc_rpmsg_echo_linux

Steps to Run the Example

  • This example integrates SBL on OSPI bootmedia which needs to be flashed on the EVM flash, along with sample application images for MCU R5 CPUs, HSM M4F and Linux Appimage.
  • For HS-FS device, use default_sbl_ospi_linux_hs_fs.cfg as the cfg file.
  • To flash to the EVM, refer to Flash a Hello World example .
  • Example, assuming SDK is installed at C:/ti/mcu_plus_sdk and this example and IPC application is built using makefiles, and Linux Appimage is already created, in Windows,
        cd C:/ti/mcu_plus_sdk/tools/boot
        python uart_uniflash.py -p COM13 --cfg=C:/ti/mcu_plus_sdk/tools/boot/sbl_prebuilt/am62px-sk/default_sbl_ospi_linux_hs_fs.cfg
    
  • If Linux PC is used, assuming SDK is installed at ~/ti/mcu_plus_sdk
      cd ~/ti/mcu_plus_sdk
      python uart_uniflash.py -p /dev/ttyUSB0 --cfg=~/ti/mcu_plus_sdk/tools/boot/sbl_prebuilt/am62px-sk/default_sbl_ospi_linux_hs_fs.cfg
    
  • Switch to OSPI NOR BOOT MODE and power on the EVM.
Attention
As the wake-up R5 is the device manager, it needs to be started by the SBL. So it can not be loaded through CCS. It should be flashed and booted through SBL.

See Also

IPC RPMessage

Sample Output

There is no direct output from the RTOS/NORTOS CPUs on the UART or CCS console. The output is seen on the Linux console on Cortex-A CPU.