Running RPMsg Demo Applications for Multicore Communication with IMX6SX and IMX7D

Document created by Carlos_Musich Employee on Jan 19, 2017Last modified by Carlos_Musich Employee on Feb 9, 2017
Version 6Show Document
  • View in full screen mode

NXP provides Dual cores in iMX6SX and iMX7D integrating Cortex M4 cores. To take advantage of dual core capabilities FreeRTOS provides M4 BSPs which contain intercore communication demo application examples.


These demo applications demonstrate how the 2 cores (Cortex A and M4) transmit dummy messages between them using the RPMsg remote peer stack working on FreeRTOS OS with RPMsg RTOS API extension. It works with Linux RPMsg master peer to transfer integer values back and forth.


All the information required about RPSMG examples is located in several documents, this document intends to summarize all what is needed to run the RPMsg demo applications.





Either IMX6SX or IMX7D evaluation board





First you may download and install FreeRTOS BSP for the i.MX processor you are using.


  • > Software & Tools tab > FreeRTOS™ BSP 1.0.1 for the i.MX 6SoloX ARM® Cortex®-M4 core
  • > Software & Tools tab > FreeRTOS™ BSP for the i.MX 7Dual ARM® Cortex®-M4 core


      The default installation folder is inside C:\nxp




    Inside the FreeRTOS BSP installation folder you will find documentation including the following files, you may take a look to the chapters indicated below..


    • Getting_Started_with_FreeRTOS_BSP_for_i.MX_7Dual.pdf / Getting_Started_with_FreeRTOS_BSP_for_i.MX_6SoloX.pdf

             Chapter 6 Running Application with U-Boot


    • FreeRTOS_BSP_for_i.MX_7Dual_Demo_User’s_Guide.pdf / FreeRTOS_BSP_for_i.MX_6SoloX_Demo_User’s_Guide.pdf

             Chapter 10 RPMsg Ping-Pong FreeRTOS Demo with RTOS API


    It is also necessary to download the documentation of the Cortex A BSP which you can download in the links below. Please note that you must select the documents belonging to the Linux kernel you are using.



    Here you will find the following documents which you will need.


    • i.MX_Linux_Reference_Manual.pdf

             Remote Processor Messaging (RPMsg)


    • i.MX_Linux_User's_Guide.pdf

             Chapter 3 Basic Terminal Setup






       4.1    Follow the instruction in chapter ‘3 Basic Terminal Setup’ of ‘i.MX_Linux_User's_Guide.pdf’ to setup serial driver. This driver will install 2 COM ports, one for A9 and other for    M4. The USB to serial driver can be found under


       4.2    Verify if your compiled Yocto image was built with RPMsg modules enabled by running command below. For reference on how to use bitbake options please see Yocto Training - HOME


    $ bitbake -c menuconfig linux-imx


          Then go to Device drivers -> Rpmsg drivers and set an ‘M’ to enable the driver modules in case they are not enabled, then rebuild kernel.





    4.3    To open RPMsg pingpong demo application go to C:\nxp\<FreeRTOS_BSP_Dir>\examples\<imx_board>\demo_apps\rpmsg\pingpong_freertos, here you will find source code for IAR, DS5 and GCC, you may choose the toolchain of your convenience, in this case IAR is used, then copy the .bin file which should be generated inside folder ‘debug’ into the FAT partition of the SD card where the i.MX Linux image is deployed.




    4.4    Connect the UART to USB port of IMX6SXSABRESD to your PC and open 2 terminals (one for A9 and other for M4 as mentioned in point 3.1) with the parameters indicated in Chapter ‘6 Running Application with U-Boot’ of the Getting Started with FreeRTOS guide (Getting_Started_with_FreeRTOS_BSP_for_i.MX_6SoloX.pdf) .


    4.5    Start A9 core and stop booting process to stay in U-boot console. Here you can set the cortex A core to launch the rpmsg demo applications resident in M4 core entering the following command sequence.


    env default -a
    setenv fdt_file imx6sx-sdb-m4.dtb
    setenv m4image 'rpmsg_pingpong_freertos_example.bin'
    setenv run_m4_tcm 'if run loadm4image; then cp.b ${loadaddr} 0x7f8000 0x8000; bootaux 0x7f8000; fi'
    setenv bootcmd "run run_m4_tcm;${bootcmd}"
    setenv mmcargs "${mmcargs} uart_from_osc"





       5.1    Once Cortex A core finishes booting sequence initiate rpmsg application as a Linux module using the commands below.


    $ cd /lib/modules/<kernel version>/kernel/drivers/rpmsg

    $ insmod imx_rpmsg_pingpong.ko

    $ rmmod imx_rpmsg_pingpong



    6 people found this helpful