Developing with IAR

Installing IAR

The IAR toolchain contains many features beyond the scope of this document. More information and documentation can be found at IAR.com.

Check the BLE-Stack 3.02.03.00 release notes to see which IAR version to use and any required workarounds. Object code produced by IAR may differ in size and performance as compared to CCS produced object code.

The following procedure describes installing and configuring the correct version of IAR and the necessary tools.

  1. Install IAR Embedded Workbench for Arm

    Download and install IAR EW ARM

    To get IAR, choose one of the following methods:

    • Download the IAR Embedded Workbench 30-Day Evaluation Edition – This version of IAR is free, has full functionality, and includes all of the standard features. The size-limited Kickstart evaluation option is not compatible with this SDK.
    • Purchase the full-featured version of IAR Embedded Workbench – For complete BLE application development using the CC2640R2F, TI recommends purchasing the complete version of IAR without any restrictions. You can find the information on purchasing the complete version of IAR.

    Attention

    The version required is stated in the release notes. Opening IAR project files with a previous version of IAR may cause project file corruption.

  2. Show Build Messages

    TI recommends showing all the build output messages for full verbosity during building. To do this, go to Tools -> Options and set Show Build Messages to All (see Figure 17.)

    ../_images/image15.png

    Figure 17. Show All Build Messages in IAR

Importing TI Drivers IAR Projects

IAR projects for TI Drivers must be imported rather than opened. All TI Drivers project are created from the original sources in <SDK_INSTALL_DIR>/source/ti/drivers. Because of this difference, you must not open TI Drivers .eww IAR projects directly from within the SDK.

Here are the steps on how to import a TI Drivers project.

Error

Do NOT try to open the .eww projects in <SDK_INSTALL_DIR>/source/ti/drivers directly in IAR!

Doing so will cause IAR to generate project files directly in the example you opened. The result of this is a project that does not open the correct source files and if you try to import the project afterwards with the import procedures listed below, not all source files will be imported into the project!

  1. Open the version of IAR that is stated in the release notes.

  2. Globally import the .custom_argvars file provided by the SimpleLink CC2640R2 SDK:

    1. Select Tools -> Configure Custom Argument Variables

      ../_images/iar_global_custom_vars.png

      Figure 18. Configuring Custom Argument Variables

    2. Select the Global Tab and click on the Import button

      ../_images/iar_global_imports.png

      Figure 19. Global Custom Variable Imports

    3. Select <SDK_INSTALL_DIR>/tools/iar/SIMPLELINK_CC13XX_CC26XX_SDK.custom_argvars

  3. Now you can import TI Drivers examples

    1. Open Help -> Information Center, and click on Integrates solutions.

    2. Go into the Texas Instruments Example projects.

      ../_images/iar_ti_import_examples.png

      Figure 20. Texas Instruments Example projects

    3. Click on example applications

      ../_images/iar_ti_list_examples.png

      Figure 21. To go to the list of available TI Drivers examples

    4. Click on the TI-RTOS link for the TI Drivers example you want to import.

      ../_images/iar_ti_import_project.png

      Figure 22. Select the project you want to import and specify where you want to save it.

  4. At this stage, you have imported a new TI Drivers project.

Accessing Preprocessor Symbols

Various C preprocessor symbols may need to be set or adjusted at the project level. The following procedure describes how to access and modify preprocessor symbols.

  1. Open the Project’s Options and select the C/C++ Compiler Category.
  2. Open the Preprocessor tab.
  3. View the Defined symbols box (see Figure 23.).
  4. Add or edit the preprocessor symbols.
../_images/image38.jpeg

Figure 23. IAR Defined Symbols Box

Certain projects also use a list of predefined symbols found in the Tools -> defines project folder.

Accessing Linker Symbols

Linker symbols may need to be set or adjusted at the project level in order to control the memory layout of the generated image. The following procedure describes how to access and modify linker symbols.

  1. Open the Project’s Options and select the Linker Category.
  2. Open the Config tab.
  3. View the Configuration File symbol definitions box (see Figure 24.).
  4. Add or edit the preprocessor symbols.
../_images/iar_linker_opts.png

Figure 24. IAR Defined Symbols Box

Resetting the CC2640R2F in IAR

Select the Board Reset option from the following Reset (back arrow) Debug Menu drop-down box.

../_images/image182.jpeg

Figure 25. IAR Board Reset