VAR-SOM-MX7 FreeRTOS for M4 PingPong demo: Difference between revisions

From Variscite Wiki
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=VAR-SOM-MX7 FreeRTOS for M4: RPMsg PingPong demo=
{{PageHeader|VAR-SOM-MX7 FreeRTOS for M4: RPMsg PingPong demo}} {{DocImage|category1=VAR-SOM-MX7|category2=}} __toc__


Build the demo
== Prerequisites ==
Before you begin, ensure to read [[VAR-SOM-MX7_FreeRTOS_for_M4| Complete Developers Guide]] and follow sections 2,3 and 4.
 
== Build the demo ==


  cd ~/var-som-mx7_m4-freertos/freertos-variscite/examples/var-som-mx7_m4
  cd ~/var-som-mx7_m4-freertos/freertos-variscite/examples/var-som-mx7_m4
Line 9: Line 12:
  ./build_all.sh > /dev/null
  ./build_all.sh > /dev/null


Copy the demo binary to FAT32 partition of boot SD card
Copy the demo binary to the BOOT (FAT32) partition of the bootable SD card:
 
cp release/rpmsg_pingpong_freertos_example.bin cp /media/BOOT


Gracefully eject the SD card from host machine, plug it in the EVK.
cp release/rpmsg_pingpong_freertos_example.bin /media/BOOT


Connect UART2 using pins J5.5 (RX) and J5.7 (TX) as 115200 8N1 for Cortex-M4 debug UART.
Gracefully eject the SD card from your host machine, and plug it in the EVK.<br>


Power on on the board and stop the boot process pressing "Enter" key.
Connect UART2 using pins J5.5 (RX) and J5.7 (TX) and configure the connection on your host PC as 115200 8N1 for the Cortex-M4 debug UART.<br>
Connect a micro-USB cable to the DEBUG port and configure the connection on your host PC as 115200 8N1 for the regular (Cortex-A7) debug UART.<br>
Power on the board and hit any key on the Cortex-A7 terminal to stop autoboot and get to the U-Boot command line.<br>


Setup and save uboot environment:
Setup and save the U-Boot environment:


  setenv use_m4 yes
  setenv use_m4 yes
Line 27: Line 30:
  saveenv
  saveenv


Start Cortex-M4 demo
==Start Cortex-M4 demo==


  run m4boot
  run m4boot
Line 40: Line 43:
  run bootcmd
  run bootcmd


Then login and load the pingpong module:
Then login from Yocto console and load the pingpong module:


  modprobe imx_rpmsg_pingpong
  modprobe imx_rpmsg_pingpong
Line 52: Line 55:
  Get Data From Master Side: 33
  Get Data From Master Side: 33
  Get Data From Master Side: 44
  Get Data From Master Side: 44
  ......
  ...
 
A video of the demo starting on our target is available here:
 
<youtube>9W3BGN568HY</youtube>

Latest revision as of 17:09, 2 February 2020

VAR-SOM-MX7 FreeRTOS for M4: RPMsg PingPong demo

Prerequisites

Before you begin, ensure to read Complete Developers Guide and follow sections 2,3 and 4.

Build the demo

cd ~/var-som-mx7_m4-freertos/freertos-variscite/examples/var-som-mx7_m4
cd demo_apps/rpmsg/pingpong_freertos
cd armgcc
export ARMGCC_DIR=~/var-som-mx7_m4-freertos/gcc-arm-none-eabi-5_4-2016q3
./build_all.sh > /dev/null

Copy the demo binary to the BOOT (FAT32) partition of the bootable SD card:

cp release/rpmsg_pingpong_freertos_example.bin /media/BOOT

Gracefully eject the SD card from your host machine, and plug it in the EVK.

Connect UART2 using pins J5.5 (RX) and J5.7 (TX) and configure the connection on your host PC as 115200 8N1 for the Cortex-M4 debug UART.
Connect a micro-USB cable to the DEBUG port and configure the connection on your host PC as 115200 8N1 for the regular (Cortex-A7) debug UART.
Power on the board and hit any key on the Cortex-A7 terminal to stop autoboot and get to the U-Boot command line.

Setup and save the U-Boot environment:

setenv use_m4 yes
setenv fdtfile undefined
setenv m4bootdata 0x007F8000
setenv m4image rpmsg_pingpong_freertos_example.bin
saveenv

Start Cortex-M4 demo

run m4boot

After the boot process succeeds, the Cortex-M4 terminal displays the following information:

RPMSG PingPong FreeRTOS RTOS API Demo...
RPMSG Init as Remote

Start Cortex-A7 core

run bootcmd

Then login from Yocto console and load the pingpong module:

modprobe imx_rpmsg_pingpong

After the Linux ping-pong master side module is installed, the Cortex-M4 terminal displays something like:

Name service handshake is done, M4 has setup a rpmsg channel [1 ---> 1024]
Get Data From Master Side: 0
Get Data From Master Side: 11
Get Data From Master Side: 22
Get Data From Master Side: 33
Get Data From Master Side: 44
...

A video of the demo starting on our target is available here: