SPRUHU4D—February 2016
Examples for TI-RTOS
17
Creating Example Projects Using the Resource Explorer in CCS
3.1.2
Creating Examples to Build via a Command Line
TI-RTOS has a command-line utility called
examplesgen
that generates example projects along with the
makefiles needed to build the examples for all supported tool chains—TI and IAR. The files are created
in a location you specify on the command line. The
tirtos.mak
file in the top level directory of your TI-
RTOS installation can be used to run examplesgen.
Note:
If you installed TI-RTOS using the standalone installer (
), this
step is not necessary because pre-generated examples are included as part of the
installation for all supported boards and tool chains. The provided examples are
located in the
TIRTOS_INSTALL_DIR\tirtos_msp43x_2_##_##_##_examples
directory. Pre-generated examples are not provided if you installed TI-RTOS through
the CCS App Center.
You only need to perform these steps once:
1.
If you installed TI-RTOS in a location other than the default location of C:\ti, edit the
tirtos.mak
file
in the TI-RTOS installation directory. Modify the following variables as needed to make them point to
the correct locations.
—
DEFAULT_INSTALL_DIR: Full path to the location where TI tools are installed.
—
IAR_COMPILER_INSTALL_DIR: Full path to the IAR code generation tools installation.
—
GCC_INSTALLATION_DIR: Full path to the GCC code generation tools installation. (GCC is not
supported for this device family.)
—
TIRTOS_INSTALL_DIR: Full path to the TI-RTOS installation.
—
XDCTOOLS_INSTALL_DIR: Full path to the XDCtools installation.
2.
If you plan to use TI-RTOS with IAR, set the IAR_BUILD variable in the
tirtos.mak
file to true.
3.
Open a command line window, and use the following commands to run the examplesgen utility. (If
you installed TI-RTOS in a protected directory, you should run the command window as the
administrator.)
For the destination path, use a UNIX-style path. That is, use forward slashes (/) instead of
backslashes (\). For example,
DEST="C:/myfiles"
.
The output from this command is a
tirtos_msp43x_2_##_##_##_examples
directory tree containing
folders for the supported boards. Each board folder contains folders for all the examples available for
that board.
Examples for TI and IAR are generated for boards supported by TI-RTOS. Each board directory contains
a
makedefs
file that can be modified to specify other installation paths or compiler/linker options and a
makefile
that can be used to build all the examples for that board. Each example directory has its own
makefile
that can be used to build that example specifically.
IAR_BUILD ?= true
> cd <
tirtos_install
>
> ..\xdctools_3_31_##_##_core\gmake -f tirtos.mak examplesgen DEST="YOURPATH"