Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ozgurgulsuna/a3c4fa84beed9861a7b7b28380e1bebc to your computer and use it in GitHub Desktop.
Save ozgurgulsuna/a3c4fa84beed9861a7b7b28380e1bebc to your computer and use it in GitHub Desktop.

TI C2000 Launchpad Initialization
METU PowerLab 2022

TI C2000 MCU Initializaiton from Scratch

This document is prepeared to standartize our way of creating a new project on C2000 family microcontrollers. In acts as a guide to prepare for a new project on a TMS320F29379D Launchpad boards with a fresh install on windows. The software developement kit is specified as C2000Ware and its expansions such as MotorControl pack and DigitalPower pack with offline installation.

Installing Code Composer Studio (CCS)

https://www.ti.com/tool/CCSTUDIO

installation directory should be under = C:\ti\

(ie. C:\ti\ccs1210 for CCS version 12.1.0)

We recommend you to choose "full installation" to achieve full families.

https://www.ti.com/design-resources/embedded-development/c2000-real-time-mcus.html

Installing C2000Ware SDK

https://www.ti.com/tool/C2000WARE#downloads

the main SDK

installation directory should be under = C:\ti\c2000

C2000WARE-SDK
C2000WARE-MOTORCONTROL-SDK
C2000WARE-DIGITALPOWER-SDK

Debug probe XDS100v2 FTDI

Connect your MCU using proprierty USB cable, open device manager. Check if below is presented. DeviceManager

If it is not located under debug probes section, install XDS100v2 drivers.

Creating Project

Start CCS IDE, starting with a workspace launcher window, locate your base folder. image

  • Create new project (File>New>CCS Project)
  • Select target according to your device. image
  • Verify connection as "Texas Instruments XDS100v2 USB Debug Probe".
    • working connection results in:
      -----[Perform the Integrity scan-test on the JTAG DR]------------------------
    
      This test will use blocks of 64 32-bit words.
      This test will be applied just once.
    
      Do a test using 0xFFFFFFFF.
      Scan tests: 1, skipped: 0, failed: 0
      Do a test using 0x00000000.
      Scan tests: 2, skipped: 0, failed: 0
      Do a test using 0xFE03E0E2.
      Scan tests: 3, skipped: 0, failed: 0
      Do a test using 0x01FC1F1D.
      Scan tests: 4, skipped: 0, failed: 0
      Do a test using 0x5533CCAA.
      Scan tests: 5, skipped: 0, failed: 0
      Do a test using 0xAACC3355.
      Scan tests: 6, skipped: 0, failed: 0
      All of the values were scanned correctly.
    
      The JTAG DR Integrity scan-test has succeeded.
    
      [End]
    
  • Click finish

Including Source and Header Files

Now we need to import device specific files for the functions already written on the SDK.

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\common

  • "Copy" source folder into the project. image

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\headers\source

  • "Copy" content into the same source folder. image

  • Create a new directory in the project folder named "header_files"

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\common\include

  • "Copy" all content into "header_files" image

  • Create a new directory in the project folder named "header_inc_files"

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\headers\include

  • "Copy" all content into "header_inc_files" image

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\driverlib\f2837xd\driverlib

  • "Copy" all content into "header_files" image

  • Now we should include these header files for the compiler.

  • in CCS, Project>Properties

  • Include Options > Add... > Workspace and select the "header_files" image

  • Include Options > Add... > Workspace and this time select the "header_inc_files"

  • Should be as shown below

    ${PROJECT_ROOT}
    ${workspace_loc:/${ProjName}/header_files}
    ${workspace_loc:/${ProjName}/header_inc_files}
    ${CG_TOOL_ROOT}/include
    
  • Apply and Close

Include Flash Linker

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\common\cmd
  • "Copy" '2837xD_FLASH_lnk_cpu1.cmd' into the project directory.

image

A cmd file named '2837x_FLASH_lnk_cpu1.cmd' is also coming with project files. You should ensure that only one cmd file is included. You can follow the instructions below:

  • Select this '2837x_FLASH_lnk_cpu1.cmd'
  • Right click and choose 'exclude from build'.

image

After that, you should add Bios adjustments.

  • Move to C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\headers\cmd
  • "Copy" 'F2837xD_Headers_nonBIOS_cpu1.cmd' into the project directory.

image

Pre-defined Symbols

Defined symbols are used in project to identify various settings and can be used with #ifdef, #endif.

  • in CCS, Project>Properties
  • in Predefined Symbols you can add various macros such as,
    CPU1
    CPU2
    _FLASH
    _LAUNCHXL_F28379D
    

image

Extra Settings

Good to have

  • Project>Properties>Build>C2000 Compiler> Optimization> Floating Point mode (--fp_mode) : relaxed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment