Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

CCSv7 Grace Migration

From Texas Instruments Wiki
Jump to: navigation, search

Overview

These steps take an existing Code Composer Studio Grace project and create a new non-Grace project that preserves the Grace generated peripheral initialization code.
In the existing Grace project, all MSP430 peripheral initialization source code generated by Grace is in `<CCS workspace dir>/<Grace project dir>/src/grace`. It contains a simple makefile that builds a library, `grace.lib`, which contains the compiled form of the Grace generated sources. These steps create a new CCSv7 GraceLib project, that builds grace.lib using a modified version of the makefile.
A new MSP430 executable project is also created, which contains the existing Grace project's source code (main.c), and links with the newly created grace.lib.

Create the Grace.lib project

  1. In the menu File -> New -> Project..., select C/C++ -> Makefile Project with Existing Code and click Next
  2. In Project Name, enter GraceLib
  3. In Existing Code Location, Browse to `<CCS workspace dir>/<Grace project dir>/src/grace` and click OK
  4. In Toolchain for Indexer Settings, select TI Build Tools
  5. Click Finish

Make required modifications to the Grace.lib project

  1. Copy the file `<CCS Install Dir>/<Grace Install Dir>/packages/ti/mcu/msp430/Grace.h` into `<GraceLib project dir>/src/grace`
  2. Delete the file `<GraceLib project dir>/src/grace/CSL_init.c`
  3. Edit the file `makefile` in GraceLib project
    • Remove all references to `objs/CSL_init.obj`
    • In the CPPFLAGS definition, remove the include path: `-I "<CCS install dir>/<Grace install dir>/packages"`
  4. Build the project

Create MSP430 executable project

  1. Select the menu File -> New -> CCS Project
  2. In the Target box, select the same MSP430 peripheral as the Grace project that is being migrated
  3. In Project Name, enter the same as the Grace project that is being migrated
  4. In Project template and examples, select Empty Project and click Finish
  5. Copy the file `<CCS workspace dir>/<Grace project dir>/main.c` into this project
  6. Edit the `main.c`
    • Change `#include <ti/mcu/msp430/Grace.h>` to `<Grace.h>`
  7. Right-click on the project in Project Explorer and select Properties
    • Select Build -> MSP430 Compiler -> Include Options
      • In the Add dir to #include search path box, click Add... and Browse... to `<GraceLib project dir>/src/grace` and select OK
    • Select Build -> MSP430 Linker -> File search path
      • In the Include library file or command file as input box, click Add... and enter `grace.lib`
      • In the Add <dir> to library search path box, click Add... and Browse... to `<GraceLib project dir>/src/grace` and select OK
  8. Build the project
  9. Done

Code Composer Studio 6 dependencies

The newly created GraceLib makefile project is still dependent on Code Composer Studio 6 CodeGen tools and MSP430 driverlib.
The following steps can be taken to remove these dependencies

  1. Change CCSv6 include paths
    • Edit the file `makefile` in GraceLib project
      • In the CCOPTS definition, change all include paths that reference `<CCSv6 install dir>/ccsv6` to `<CCSv7 install dir>/ccsv7`
  2. Use CCSv7 CodeGen tools
    • Edit the file `makefile` in GraceLib project
      • Change all occurrences of `<CCSv6 install dir>/ccsv6/tools/compiler/ti-cgt-msp430_4.4.3` to `<CCSv7 install dir>/ccsv7/tools/compiler/ti-cgt-msp430_16.9.0.LTS` (version numbers may be different)
  3. Use the latest MSP430 driverlib
    • Install MSP430Ware with Resource Explorer
    • Edit the file `makefile` in GraceLib project
      • Change all occurrences of `<CCSv6 install dir>/msp430/driverlib_2_30_00_49` to `C:/ti/tirex-content/msp/MSP430Ware_3_60_00_10/driverlib` (version numbers may be different)