The Ping-Pong sample application shows how the two heterogeneous cores communicate on the Vybrid SoC. It uses NXP/Freescales MultiCore Communication (MCC) library to communicate between the Cortex™ A5 (running Linux) and Cortex™ M4 (running eCos).
The firmware source code is available from Github. A pre-built firmware is available form our server: pingpong.bin.
$ git clone https://github.com/antmicro/ecos-colibri-vf61-pingpong.git $ cd ecos-colibri-vf61-pingpong/src
The sample comes with a pre-built eCos Kernel, hence only the cross compiler tool chain is required. Edit make.sh accordingly and extend it with the eCos cross compiler tool chain. Refer to the general eCos documentation eCos on the Cortex M4 of a Colibri VF61 on how to get the cross compiler tool chain.
./make.sh
The Linux memory space must be restricted in order to use DRAM to run eCos. Configure U-Boot using the following commands prior to booting Linux. On device tree kernels, the FDT load address need to be specified too (U-Boot would place the FDT into a location not reachable by the kernel anymore due to the memory restriction):
set memargs mem=240M set fdt_high 0x8e000000 saveenv
Refer to the ECos for Toradex Colibri VF61 manual for more details.
First, the MCC kernel module needs to be loaded:
modprobe mcc
Then, transfer the firmware to the target and load it into to Cortex™ M4 core using mqxboot.
# mqxboot pingpong.bin 0x8f000400 0x0f000411 ...
Starting with Image V2.2 Beta 1, Linux comes with the mcc-pingpong sample application. For older BSPs one can get the source code from http://repository.timesys.com/buildsources/m/mcc-pingpong/mcc-pingpong-1.0
The Ping-Pong demo can be started using mcc-pingpong:
# mcc-pingpong version: 001.002 Message: Size=4, DATA = 2 after 0.005493 seconds. Message: Size=4, DATA = 4 after 0.110847 seconds. Message: Size=4, DATA = 6 after 0.110927 seconds. Message: Size=4, DATA = 8 after 0.110959 seconds. Message: Size=4, DATA = a after 0.111934 seconds. Message: Size=4, DATA = c after 0.110981 seconds. Message: Size=4, DATA = e after 0.110944 seconds.