6.4. Using MCAL with CCS projects

Note

The steps on this page show screen shots and description based on Windows. However the steps in Linux would remain the same, unless mentioned otherwise.

By default, CCS import of MCAL example projects performs a copy of example, example configuration, utils files to CCS workspace. User are free to modify the example files without affecting the files in the MCAL installed location. Deleting the CCS project, deletes the project files from CCS workspace. User should be careful especially when the copied example files are modified by user.

The screen shots shown on this page are for AM263x MCAL 9.01. You would see your specific SOC and MCAL version that is installed. However the instructions and steps mentioned remain the same, unless mentioned otherwise.

6.4.1. Background

All MCAL examples can be built using CCS projects. This section provides basic instructions and tips on using CCS projects.

CCS version: 12.5 Download CCS12.5

TI Arm Clang Compiler Tools version: 2.1.3 Download TI-arm-clang-Version=2.1.3

Note

SBL appimage generation is not supported. It will be added in future Release. Currently, only xer5f file is supported.

6.4.2. CCS Projectspec and CCS Projects

  • When a example project is imported into CCS, what is really getting imported is a projectspec file.

  • This file is a definition or blueprint of a CCS project, like compiler options, files to compile, libraries to link.

  • CCS takes the projectspec as input and then generates CCS project files in the user workspace.

  • Default workspace is:

    C:/Users/{user name}/workspace_v{CCS major version}/{project name}/
    
  • The projectspec is also human readable, i.e you can open it in a text editor to see all the different options for that project.

6.4.3. Import a Project in CCS

  • First open the “project explorer” as shown below

../_images/open_project_explorer.png
  • “Right-click” in the project explorer window to import a project

../_images/import_ccs_project.png
  • Click “Browse” and go to ${MCAL_INSTALL_PATH}/examples/ folder

  • This will list all example projects, now you can select one or more or all projects to import into CCS.

../_images/select_project_to_import.png
  • All examples follow below naming convention:

    {example name}_{app}
    

6.4.4. Browse a Project in CCS

  • You can explore project files by clicking on them.

File/Folder

Description

Location

Drivers

Contains source of required MCAL drivers

Linked to MCAL Source files

examples_config

Contains configuration files for example

Copied into CCS workspace

Include

Headerfiles required for examples and drivers

Document release version column removed

Utils

Utils code required in examples

Copied into CCS workspace

lnk_r5_am263_CLANG.cmd

Linker file

Copied into CCS workspace

sys_intvecs.asm

Assembly file

Copied into CCS workspace

sys_startup.asm

Assembly file

Copied into CCS workspace

Example Startup files

Dio example startup file

Copied into CCS workspace

Example files

Dio example files

Copied into CCS workspace

6.4.5. Build a Project in CCS

  • To build a project “right-click” on the project name and select “Build Project” to build it

  • By default it builds in “release” profile. In “debug” profile it runs without compiler optimizations. To build with compiler optimizations, select “release” profile by clicking, “Build Configurations > Set Active > Release” as shown below.

../_images/ccs_active_configuration.png
  • You can explore additional project options in the same menu.

6.4.6. 1 Click Debug with CCS Projects

  • Projects imported in CCS can be loaded and run on the EVM with single click.

  • Right click on the project and select the Code Composer debug session as shown below

../_images/ccs1_clickdebug_session.png
  • Select the Core to run

  • This will build the example internally

  • The target configuration is launched and the example is loaded on the core and halts in Main

  • Click on the resume to run the example

  • The program output will be seen on CCS console, and/or UART terminal, if enabled. Below shows a sample output on both CCS console and UART console, after running the “hello world” program.

6.4.7. Add New file in CCS Projects

  • Right click on project name Go to New and select New File.

../_images/add_new_file_ccs.png
  • Choose destination (parent) folder and type name of new file.

    ../_images/new_file_name_folder_ccs.png
  • Click Finish.

  • New file will be added in destination provided in above step. Now you can write and edit code in this newly added file.

6.4.8. Load and Run Executables Built with CCS Projects

  • Simply load and run binary .xer5f on EVM using CCS (see CCS Launch, Load and Run)

6.4.9. Delete a Project in CCS

  • To delete a imported project “right-click” on the project name and select “Delete” to delete it.

../_images/ccs_delete_project.png
  • It is recommended to check the box as shown below, else you will have trouble re-importing the project

  • Note, that deleting a project, only deletes it from your CCS workspace, the .c, .h and other project files are located with the ${MCAL_INSTALL_PATH}/examples and these are not deleted.

  • You can reimport a project later as needed.

6.4.10. References

Reference to compile differrent files