<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=Transclusion%3A_FreeRTOS%3A_Introduction_to_NXP_FreeRTOS_development</id>
	<title>Transclusion: FreeRTOS: Introduction to NXP FreeRTOS development - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=Transclusion%3A_FreeRTOS%3A_Introduction_to_NXP_FreeRTOS_development"/>
	<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=Transclusion:_FreeRTOS:_Introduction_to_NXP_FreeRTOS_development&amp;action=history"/>
	<updated>2026-04-30T10:06:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://www.mediawiki.compulab.com/w/index.php?title=Transclusion:_FreeRTOS:_Introduction_to_NXP_FreeRTOS_development&amp;diff=3866&amp;oldid=prev</id>
		<title>Nikita at 14:15, 22 October 2017</title>
		<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=Transclusion:_FreeRTOS:_Introduction_to_NXP_FreeRTOS_development&amp;diff=3866&amp;oldid=prev"/>
		<updated>2017-10-22T14:15:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview ==&lt;br /&gt;
The FreeRTOS operating system is designed to be compact and task specific. As such, instead of the popular kernel/driver/filesystem/userspace division used by general purpose operating systems, FreeRTOS is just one binary that contains an application and all the relevant kernel code that is necessary to support it. This includes startup code, code that accesses SoC subsystems (drivers), as well as standard kernel functionality such as multitasking, which allows the single-application-per-image model to spawn multiple tasks. In addition to this standard functionality, middleware libraries can be added to the core OS to augment its functionality. For example, the CL-SOM-iMX7 FreeRTOS BSP is augmented with the Open-AMP software stack, which allows the M4 and A7 cores to communicate.&lt;br /&gt;
&lt;br /&gt;
== Project architecture ==&lt;br /&gt;
FreeRTOS consists of multiple modular parts:&lt;br /&gt;
{| cellpadding=&amp;quot;3&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 1px solid rgb(85, 85, 85); border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Unit&lt;br /&gt;
! Description&lt;br /&gt;
! Location&lt;br /&gt;
|-&lt;br /&gt;
| kernel&lt;br /&gt;
| FreeRTOS kernel&lt;br /&gt;
| rtos/FreeRTOS/Source&lt;br /&gt;
|-&lt;br /&gt;
| CMSIS headers and libraries&lt;br /&gt;
| Cortex-M specific support&lt;br /&gt;
| platform/CMSIS&lt;br /&gt;
|-&lt;br /&gt;
| SOC specific definitions&lt;br /&gt;
| This BSP only has MCIMX7D definitions&lt;br /&gt;
| platform/devices&lt;br /&gt;
|-&lt;br /&gt;
| Drivers&lt;br /&gt;
| All the drivers in the FreeRTOS BSP are stateless&lt;br /&gt;
| platform/drivers&lt;br /&gt;
|-&lt;br /&gt;
| Middleware libraries&lt;br /&gt;
| Open-AMP stack, including RPmsg support&lt;br /&gt;
| middleware/multicore/open-amp&lt;br /&gt;
|-&lt;br /&gt;
| Additional utilities&lt;br /&gt;
| Contains some printing functions&lt;br /&gt;
| platform/utilities&lt;br /&gt;
|-&lt;br /&gt;
| App code&lt;br /&gt;
| Application code and project files&lt;br /&gt;
| examples/cl-som-imx7&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For development, the focal point is the apps projects, which pick and choose the various pieces of FreeRTOS and combine them with the app code into a single project. A good starting point is to pick an example project and start adding functionality.&lt;br /&gt;
&lt;br /&gt;
== FreeRTOS API reference ==&lt;br /&gt;
The CL-SOM-iMX7 FreeRTOS BSP is based on the NXP FreeRTOS BSP. The NXP BSP has some useful documents in the BSP archive, one of which provides a comprehensive documentation of FreeRTOS API. The NXP BSP can be downloaded [http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-processors/i.mx-7-processors/i.mx-7dual-processors-heterogeneous-processing-with-dual-arm-cortex-a7-cores-and-cortex-m4-core:i.MX7D?tab=Design_Tools_Tab here] in the Board Support Packages section.&lt;br /&gt;
&lt;br /&gt;
== Multicore development and coexisting with Linux ==&lt;br /&gt;
Since Cortex-A7 and Cortex-M4 share both memory and peripherals, it is necessary to isolate or synchronize between these cores to prevent them from interfering with one another. The RDC (Resource Domain Controller) subsystem of iMX7 provides ways to implement this isolation/synchronization on the hardware level, and RDC support is part of the FreeRTOS API. Nevertheless, the general purpose OS that runs on the Cortex-A7 may not be prepared to handle the possibility that a bus or subsystem may be locked from it, or concurrently used by somebody else, and so disabling functionality on the Cortex-A7 OS may be necessary. In the case of Linux, a special device tree can be used to tell Linux not to touch iMX7 subsystems that we expect to be used by FreeRTOS. Such a device tree is provided in the CL-SOM-iMX7 FreeRTOS BSP.&lt;br /&gt;
&lt;br /&gt;
== Building FreeRTOS ==&lt;br /&gt;
=== Setup development tools ===&lt;br /&gt;
For FreeRTOS development it is possible to use either the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads GNU ARM Embedded toolchain], or the [https://developer.arm.com/products/software-development-tools/ds-5-development-studio/downloads ARM DS5 IDE] suite. The FreeRTOS BSP has build scripts/project files for both tools.&lt;br /&gt;
==== GNU ARM Embedded toolchain ====&lt;br /&gt;
* Create a directory for downloading.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;mkdir -p ~/toolchain&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* Download the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads GNU ARM Embedded toolchain] to the toolchain directory.&lt;br /&gt;
* Extract the toolchain archive:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/toolchain&lt;br /&gt;
tar xvf gcc-arm-none-eabi-6-2017-q1-update-linux.tar.bz2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* Let the host system know where the toolchain is located&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;export ARMGCC_DIR=~/toolchain&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ARM DS5 IDE ====&lt;br /&gt;
* Create a directory for downloading.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;mkdir -p ~/toolchain&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* Download [https://developer.arm.com/products/software-development-tools/ds-5-development-studio/downloads ARM DS5 IDE] to the toolchain directory.&lt;br /&gt;
* Extract the downloaded archive:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/toolchain&lt;br /&gt;
tar xvf DS500-BN-00019-r5p0-27rel1.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* Run the installation script and follow the instructions&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;./install.sh&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Getting FreeRTOS BSP sources ===&lt;br /&gt;
* Create a directory for development.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;mkdir -p ~/development&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* [[#See also|Download]] the FreeRTOS BSP to the development directory.&lt;br /&gt;
* Extract the FreeRTOS BSP archive:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/development&lt;br /&gt;
unzip cl-som-imx7_freertos.zip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* Extract the BSP source archive inside the BSP package:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cd cl-som-imx7-freertos/freertos&lt;br /&gt;
tar xvf freertos.tar.bz2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building FreeRTOS ===&lt;br /&gt;
In this example we will use the {{cmd|hello_world}} demo project as reference.&lt;br /&gt;
==== Invoking build ====&lt;br /&gt;
===== GNU ARM Embedded toolchain =====&lt;br /&gt;
* Go to the {{filename|armgcc}} folder inside the {{filename|hello_world}} project directory&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;cd ~/development/cl-som-imx7-freertos/freertos/freertos_source/examples/cl_som_imx7_m4/demo_apps/hello_world/armgcc&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
* Run the build script for either of build configurations:&lt;br /&gt;
** For Debug configuration:&amp;lt;pre&amp;gt;./build_debug.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
** For Release configuration:&amp;lt;pre&amp;gt;./build_release.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
** For Both (debug and release) configurations:&amp;lt;pre&amp;gt;./build_all.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== ARM DS5 IDE =====&lt;br /&gt;
* Open DS5 IDE&lt;br /&gt;
* Go to File-&amp;gt;Import&lt;br /&gt;
* Select General-&amp;gt;Existing Projects into Workspace&lt;br /&gt;
* Click Browse and go to {{filename|~/development/cl-som-imx7-freertos/freertos/freertos_source/examples/cl_som_imx7_m4/demo_apps/hello_world/armgcc}} and click OK&lt;br /&gt;
* Click Finish&lt;br /&gt;
&lt;br /&gt;
Now you can right click on the project and select the build option.&lt;br /&gt;
&lt;br /&gt;
=== Image location ===&lt;br /&gt;
Depending on the tool used, and the selected build target, the built binary will reside in {{filename|~/development/cl-som-imx7-freertos/freertos/freertos_source/examples/cl_som_imx7_m4/demo_apps/hello_world/{armgcc,ds5}/{debug,release}/hello_world.bin}}.&lt;/div&gt;</summary>
		<author><name>Nikita</name></author>
		
	</entry>
</feed>