Changes

Jump to: navigation, search
no edit summary
==Introduction==
This application note describe how to build the software components required to set up asymmetric multi-processing (AMP for short) configuration required to run Linux OS on first Cortex®-A9 core and FreeRTOS on second Cortex®-A9 core of the Freescale i.MX6 SOC.  The latencystat demo is a RPMsg-based application that exploits sophisticated techniques to handle inter-processors communication and synchronization.
== Asymmetric Multiprocessing ==
This application note describes in detail the implementation of Linux/FreeRTOS asymmetric multiprocessing configuration on DAVE Embedded Systems AXEL LITE SoM. This configuration is a typical example about how to leverage AMP flexibility to combine, on one single piece of silicon, the versatility of Linux o.s. for general purpose computation, connectivity and HMI and the determinism of an RTOS to satisfy real-time constraints. Since AXEL family products are all based on Freescale i.MX6 processors, what here described applies to AXEL ULTRA too.
As known, AMP allows a multicore system to run simultaneously1 simultaneously[1] multiple Operating Systems (OS) that are independent of each other. In other words, each core has its own private memory space, which contains the OS and the applications that are to run on that core. In addition, there can be some shared memory space that is used for inter-core communication. This is in contrast to Symmetric Multiprocessing (SMP), in which one OS runs on multiple cores using a public shared memory space.
Thanks to AMP, developers can use open-source Linux and FreeRTOS operating systems and the RPMsg Inter Processor Communication (IPC) framework to quickly implement applications that need to deliver deterministic, real-time responsiveness for markets such as automotive, industrial and others with similar requirements, while preserving the openness of Linux.
 
[1] This is true simultaneity because multiple instructions are executed at the same time
The following picture depicts the structure of the system.
Inter-core communication is based on RPMsg framework2. The adoption of a standardized and mainlined protocol improves dramatically the portability and the maintainability of the application code.
 On Linux kernel, this framework is supported by the kernel 3.10.17_GA – released by Freescale itself along with L3.10.17_1.0.0_IMX6QDLS_BUNDLE BSP – upon which the XELK 2.0.0 is based3based
The picture below shows how the system memory is fragmented. The portion of memory used to create a shared area between the two cores – ring buffers – is allocated inside the 256 MByte region used by FreeRTOS.
== XELK platform ==
 
AXEL Embedded Linux Kit (XELK for short) provides all the necessary components required to set up the developing environment for:
* building the second stage bootloader (U-Boot)
DAVE Embedded Systems provides all the customization required (in particular at bootloader and Linux kernel levels) to enable customers use the standard i.MX6 development tools for building all the firmware/software components that will run on the target system.
Please refer to the [[Axel_Embedded_Linux_Kit_(XELK)#Quick_start_guide | XELK Quick Start Guide ]] for further details on XELK.
<b>N.B.: </b>this application note has been tested using XELK 2.0.0.
The following sections describe how to build the software components required to set up asymmetric multi-processing (AMP for short) configuration required to run Linux OS on first Cortex®-A9 core and FreeRTOS on second Cortex®-A9 core.
 
The <code>latencystat</code> demo is a RPMsg-based application that exploits sophisticated techniques to handle inter-processors communication and synchronization.
== Building the software components ==
The following paragraphs describe how to build the software components required for this application. Please note that:
* the standard Linux infrastructure will be used to load the firmware for the second core Linux will start in SMP mode, running on both cores; then CPU1 will be shutdown and freeRTOS firmware will be loaded and run
* the GPIO7_13 pin (JP10.9 of the AXEL EVB-LITE) is toggled during the ISR
* the EIM_D19 signal (available on the R5 resistor on the AXEL EVB-LITE) is the output of the EPIT1 (which is the interrupt source)
</pre>
The file <code>arch/arm/boot/uImage </code> is the binary image of the kernel that must be used to boot the system, together with the file <code>arch/arm/boot/dts/imx6q-xelk-l.dtb</code>, which is the binary image of the device tree with the XELK hardware configuration.
The following kernel modules, resulting from the kernel build procedure, must be copied from the building directory to the root file system (usually into <code>/lib/modules/<kernel version>/kernel</code>, but any other directory can be used):
<pre>
=== Build FreeRTOS ===
 For building the FreeRTOS, a proper toolchain has to be used, then enter the following commands
<pre class="board-terminal">
dvdk@dvdk:~/xelk$ cd freertos
dvdk@dvdk:~/xelk/freertos$ export ARCH=arm
dvdk@dvdk:~/xelk/freertos$ export CROSS_COMPILE=arm-none-eabi-
</pre>
and then run <code>make</code> to build the RTOS binary image:
</pre>
<pre class="board-terminal">
dvdk@dvdk:~/xelk/freertos$ make
</pre>
 
The output of the build is contained into <code>output/mx6dq/Rpmsg-Demo/axellite_rev_a/Rpmsg-Demo.elf</code> (N.B: the elf file must be used, not the bin) e must be renamed as <code>freertos</code> and installed into the <code>/lib/firmware</code> directory of the root file system.
=== Building latencystat ===
Enter For building the <code>latercystat</code> example, enter the <code>latecystat</code> directory and build with '''then una <code>make'''</code>:
<pre class="board-terminal">
dvdk@dvdk:~/xelk$ cd latencystat
</pre>
The resulting binary must be copied from the building directory to the root file system, e.g. on the <code>/home/root</code> directory of the root-file system.
=== Running the AMP on the target ===
</pre>
Then run the <code>latencystat </code> application as shown below. The typical output will look like this:
<pre class="board-terminal">
8,154
edits

Navigation menu