.. _sysconfig-sysconfig:

Get started with SysConfig
==========================

System Configuration Tool (SysConfig) is a graphical interface for configuring
your |SDK| project. Configuration files, C source files and header files are generated
based on the parameters configured in the SysConfig dashboard.

SysConfig can be used as a standalone tool, or as a plug-in to |CCS|.

.. attention::

    Files and code generated by SysConfig should be thoroughly checked and
    reviewed.

Using Stand-alone SysConfig
---------------------------

You can find the standalone SysConfig tool on the `SysConfig Standalone Installer Download Page`_.

Open the System Configuration Tool, and select your device, part and package,
then press ``START``.

When you have finished configuring your ``.syscfg`` file, save and generate
files. Export the generated files to your project, overwriting existing files if
necessary. Make any needed changes to your application for interfacing with the
SysConfig-generated files.

.. _sysconfig-use-iar:

Using SysConfig with IAR Workbench
----------------------------------

If you are using IAR, you can use SysConfig as a standalone desktop tool to
generate the configuration files to be compiled and linked with your application.
The different SDK's require specific versions of SysConfig and IAR Embedded
Workbench. Refer to the Release Notes for these version numbers.

These steps assume the TI Code Generation Tools are installed in the default
location. The figures use the MSP432 SDK as an example, but other SimpleLink SDKs
follow the same procedure. 

1. Install `SysConfig <http://www.ti.com/tool/SYSCONFIG>`__ as a standalone tool in the default location (``C:\ti``).

2. Open IAR and follow these steps to configure it to use the correct viewer for
   ``*.syscfg`` files:

    a. Choose Tools > Configure Viewers from the menus, and then click Import.

    b. Navigate to the SDK installation directory 
       ``$SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$\tools\iar\`` and select the
       file ``sysconfig_iar_setup.xml``

   .. note::

    Make sure to select the correct $SIMPLELINK_SDK_INSTALL_DIR$ for your device family (e.g. |DEVICE|)

3. Make sure you imported the custom argument variables and that the paths
   are correct. 

.. figure:: resources/sysconfig_iar_2.png
    :align: center

    Configuring Custom Argument Variables

4. Import an example project workspace.

5. Double click on the \*.syscfg file in your project. This will open the
   SysConfig standalone tool. You can configure all the settings, then save your
   changes and switch back to the IAR view.

6. Rebuild the project to perform the custom build step, which uses SysConfig to
   generate additional files.

.. figure:: resources/sysconfig_iar_3.png
  :align: center

  Building with SysConfig in IAR


Using SysConfig as a Plug-In to CCS
-----------------------------------

SysConfig requires |CCS| v. 8.3 or later. (Please use the version of CCS
recommended for the |SDK| you are working with. You can find the
recommended tool version numbers in the release notes.)

In CCS, import a SysConfig enabled project from the ``examples``
folder.

In the project folder in |CCS|, you will see a ``.syscfg`` file. Open this file to
start the SysConfig graphical interface.

.. figure:: resources/sysconfig_dashboard.png
    :align: center


.. _sec-sysconfig-view-output:

Viewing SysConfig Output
------------------------

If you click the ``Generated Files`` (< >) :ref:`fig-generated-files` button
at the top of the ``Configuration`` pane you will find a list of Generated Files.
After selecting a file you will be able, in real-time, to identify how the
changes in the GUI effect the generated files. This will help you review the
relationship between the GUI and the code.

.. _fig-generated-files:
.. figure:: resources/syscfg_generated_files_ble.png
  :align: center

  Generated Files