iMX8QXP: Use RPMSG to wake up M4 and A35

Document created by Qiang Li - Mpu Se Employee on Apr 8, 2019Last modified by Qiang Li - Mpu Se Employee on May 9, 2019
Version 6Show Document
  • View in full screen mode

The reference code is based on L4.14.78 GA1.0.0 BSP and M4 SDK 2.5.1. 

It is tested on iMX8QXP MEK board, and it should also work for iMX8QM board.


In L4.14.78 GA1.0.0 BSP, MU_5 is used for RPMSG between M4 FreeRTOS and A35 Linux, SC_R_MU_5B is M4 side and SC_R_MU_5A is A35 side. In linux side, we used the "imx_rpmsg_tty.ko" for this test, this driver is built as module in default BSP.


Case 1: M4 wake up A35.

Apply "L4.14.78_rpmsg_wakeup.patch" to linux kernel, this patch will enable the RPMSG wake up feature.

"rpmsg_lite_pingpong_rtos.tar.bz2" is the M4 side test code. After booted the board with Linux + M4 rpmsg software, run followed test commands:

1. In A35 UART side, run followed commands:

    # echo enabled > /sys/bus/platform/devices/90000000.rpmsg/power/wakeup

    # insmod ./imx_rpmsg_tty.ko

    # /unit_tests/Remote_Processor_Messaging/mxc_mcc_tty_test.out /dev/ttyRPMSG30 115200 R 100 1000 &

    # echo deadbeaf > /dev/ttyRPMSG30

    # echo mem > /sys/power/state


2. M4 UART side:

   After run "echo deadbeaf > /dev/ttyRPMSG30" from Linux side, it will show "Got ping..." and wait there, after run A35 suspend commane "echo mem > /sys/power/state", Linux suspends. Then from M4 UART side, press "c" key, it will send RPMSG to A35 and wake up A35 Linux.


Case 2: A35 wake up M4.

"power_mode_switch_rpmsg_wakeup.tar.bz2" is the M4 side test code, After booted the board with Linux + M4 rpmsg software, the M4 UART will wait for A35 RPMSG driver ready. Test commands:

1. In A35 UART side, run followed commands to make RPMSG driver ready:

    # insmod ./imx_rpmsg_tty.ko

    # /unit_tests/Remote_Processor_Messaging/mxc_mcc_tty_test.out /dev/ttyRPMSG30 115200 R 100 1000 &

    # echo deadbeaf > /dev/ttyRPMSG30


2. Now M4 UART shows ping pong messages to make sure RPMSG is ready. Now M4 is in power switch menu, select VLLS power mode in M4 UART:

     Press  H for enter: VLLS     - Very Low Leakage Stop mode

    ... ...

     Press R for RPMSG.

After press "R" key in M4 UART, M4 will print "Send a RPMSG message to wake up" and goto suspend mode.


3. Wake up M4 from A35 side, send any data to RPMSG:

    # echo deadbeaf > /dev/ttyRPMSG30


M4 resumed and goto power switch menu again.



SDK folder to compile the two M4 sample code:



2 people found this helpful