.. _section-building_threadx:
Building the |me_h| Source for ThreadX
======================================
Introduction
------------
This section explains the environment used to run |me| on the Threadx® + NetX™
and is organized as follows:
- `Overview`_
- `Configuration`_
- `CMake Support`_
Overview
--------
|me| is known to run on the ThreadX operating system and NetX network stack.
The Renesas™ SK-S7G2 Starter Kit has been chosen as reference hardware.
This starter kit has a Synergy S7G2 microcontroller with 4 Mbytes of flash memory
and 640 KBytes of SRAM. For a full description, please refer to the microcontroller
and starter kit documentation
(https://www.renesas.com/us/en/products/synergy/hardware/kits/sk-s7g2.html).
Renesas provides an Eclipse-based integrated development environment (IDE) called
e² studio. The Synergy® Software Package (SSP) provides several middleware components
like ThreadX and NetX. e² studio and the SSP allow you to create solutions
based on ThreadX and NetX for the Renesas SK-S7G2.
Renesas provides several examples for the SK-S7G2 and e² studio. The DHCP client
example is particularly useful, as it provides a working ThreadX and NetX
configuration.
We used the following components to build the |me| application:
- e² studio version 5.4.0.018
- SSP version 1.2.0
- ThreadX 5.7
- NetX 5.8
Configuration
-------------
e² studio allows you to configure ThreadX and NetX. |me| expects two
variables to be configured in NetX with the following default names:
- g_ip0 : This is the expected name of the NetX IP instance.
- g_packet_pool0 : This is the expected name of the NextX packet pool instance.
CMake Support
-------------
|me| includes support to compile libraries for ThreadX/NetX using `CMake `_ .
It is assumed that the |me| source-bundle has been downloaded and
installed and that `CMake `_ is available.
1. Make sure `CMake `_ is in the path.
2. Define the following environment variables:
- SYNERGY_PATH : Path to your Synergy project. This is needed to add the include
paths to the ThreadX and NetX public header files, and other header files
used by the ThreadX and NetX public header files.
- PATH : Update your path with the location of the C and C++ compilers. By default
``arm-none-eabi-gcc`` and ``arm-none-eabi-g++`` are used as C and C++ compilers.
3. Enter the following command:
::
cd
resource/scripts/rtime-make --target ThreadX --name cortexm4ThreadX5.8gcc4.9.3 -G "Unix Makefiles" --build
4. The |me| libraries are available in:
::
/lib/cortexm4ThreadX5.8gcc4.9.3
NOTE: ``rtime-make`` uses the name specified with ``--name`` to determine a few
of the settings needed by |me|. Please refer to :ref:`prepare` for details.