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.
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
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
Connect your MCU using proprierty USB cable, open device manager. Check if below is presented.
If it is not located under debug probes section, install XDS100v2 drivers.
Start CCS IDE, starting with a workspace launcher window, locate your base folder.
- Create new project (File>New>CCS Project)
- Select target according to your device.
- 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
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
-
Move to
C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\headers\source
-
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
-
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
-
Move to
C:\ti\c2000\C2000Ware_4_02_00_00\driverlib\f2837xd\driverlib
-
Now we should include these header files for the compiler.
-
in CCS, Project>Properties
-
Include Options > Add... > Workspace and select the "header_files"
-
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
- 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.
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'.
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.
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
Good to have
- Project>Properties>Build>C2000 Compiler> Optimization> Floating Point mode (--fp_mode) : relaxed