CCS Extras

Introduction

These are the course extras related to Code Composer Studio, the IDE of choice for this class.
Obviously, you need CCS installed, if you haven't had that done, head over here, CCS Installation.

As with any of the other course extras, please DO NOT attend office hours or post on Piazza for help with these guides (aside from a few occasions, usually during the first couple weeks of class).
Discuss these in the #embedded-chat on Discord.

Linux Support

This is going to be a short one.

In the ECE curriculum, the software used in Introduction to Embedded Systems is relatively Linux friendly.
Some, if not most of you, may go on to attend Intro to Unix, which teaches some basics about the Linux Operating System environment.
Otherwise, some of the future programming courses also inform students about a Linux environment and its perks, but ironically, still don't support them, so at the very least I can start off nicely with this course.

CCS has supported Linux officially for a long time (Ubuntu and Fedora), and their installers are relatively painless to install.

After downloading the installer, make sure its executable with chmod +x, then run the installer (./<file>), and there is a dependency check that is pretty accurate.
Use your distribution's corresponding package manager to install the dependencies accordingly.

A list of dependencies can also be found here: https://github.com/haoxiangliew/nix-environments/blob/master/ccstudio-env/fhs-env.nix

MobaXTerm has a variety of alternatives on Linux, my favorite is picocom

Although just like some other things, Linux is unsupported as of now in the ECE department, and for this course.
All of the technical support will have to be done yourself, reach out to your distribution's community, or other Linux related forums and wikis such as the ArchWiki and their forums.

MacOS w/ Apple Silicon Support

You're not supposed to be using one as-per the Department of Engineering standards, but it is definitely a nice laptop :)

Recently tested, the latest version of CCS runs perfectly on MacOS, just make sure to install all the components correctly, as well as install the ARM GCC Compiler Suite inside CCS.

Make sure Rosetta is enabled, as CCS is not arm64-native software.

As with Linux, picocom is available on mac, as well as screen for a serial terminal.

As there is no USB-A port on the MacBook, do make sure that your adapter does support adequete USB data transfer for the MSP432. Even on any other laptops, docks that plug into one USB port with additional items plugged into it will not work for debugging or flashing. Sometimes the dock is just a bad dock. To keep things safe, I use a dock designed for the MacBook that plugs directly into two USB-C ports and has adequate transfer specs.

Content Assist

TI is a bit creative with their names, although "content assist" is just another word for basic code completions on any other IDE.

2. Then access the settings for "Content Assist" under C/C++ -> Editor -> Content Assist

Make sure that we check all of the options highlighted, as well as set the delay to 0 ms, which lets candidates that are triggered automatically show up without a delay.

Completions that aren't triggered automatically can still be attempted with Ctrl + Space

3. Go to Advanced Settings under C/C++ -> Editor -> Content Assist -> Advanced

And here I like to enable "Word Proposals" which is unchecked by default.

Formatting

Sometimes, even when you're not supposed to, your functions can get pretty long and illegible. Formatting helps us solve that, CCS has several inbuilt formatters by default.

Manual Format

In order to manually format a file, you can right click a particular file in the Project Explorer, and then select Source -> Format.

By default, this will use the original TI formatting scheme, which I'm not a big fan of, but its servicable.

Auto Format

Instead of doing manual formats every time we edit a file, we can enable automatic formatting in the preferences.

2. Then access C/C++ -> Editor -> Save Actions

Here you have some choices, typically, formatting only edited lines is preferred in the industry, to prevent errors when collaborating.

However, there are also other standards such as clang-format for C and C++, as well as stylua.toml for Lua, which rigorously makes sure everything in the directory is formatted according to defined rules in the file.

Since it is likely you are the only one working on the content in this course, formatting all lines should be fine.

Remove trailing whitespace is basically removing extra spaces and blank lines, which is recommended.

Align Const makes sure your const directives are aligned.

My personal settings for autoformatting are shown above in the highlighted areas.

Changing the style of the formatter

By default, the formatter uses a TI-style format.
Which looks like this.

Of course, there is a lot of debate on which is the best format for C code.
I'm not here to tell you which is, just how to change it.

2. Then access C/C++ -> Code Style -> Formatter

Of the built-in options, I find K&R to be the most acceptable.

However, I am a firm believer in Google's Style Guides (https://google.github.io/styleguide/), so in order to get that into CCS, you can select "Import" underneath the active profile dropdown.

I would download the following file (as .xml) : https://github.com/google/styleguide/blob/gh-pages/eclipse-cpp-google-style.xml

And import that with the steps described above.

Dark Mode

Warning for users on CCS v10 (Eclipse <v.4.20) trying to use plugins

This does not work since March 2021 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=572034), since the way Eclipse plugins were signed was changed, and the fix landed in Eclipse 4.20.

As of January 2022, I have spent hours attempting different versions of this plugin, as well as updating Equinox, Eclipse's update system, which still fails to install the plugin.

The only way to use plugins from the Eclipse marketplace on CCS is to upgrade to a version that includes an Eclipse version greater than 4.20, currently, CCS v12.2 includes Eclipse 4.23, and works perfectly with the following guide.
As far as I know, in my experience, there are no known problems with the course content with CCS versions greater than 10.

However, this is not recommended, as this course does recommend you to use CCS v10.0.
Therefore, if any problems arise, please assume no support from course staff, and reach out to TI's official forums for CCS as well as internet search results.
If you choose go this route, I highly recommend having an extra computer with CCS v10.0 installed, or starting your assignments earlier to account for potential problems.

By default, Code Composer Studio comes with a dark mode that is barely serviceable. If you find illegible consoles and messages, and don't want to be blinded by the light, this is the guide for you!


2. Then access the available software sites under Install/Update -> Available Software Sites

3. Add the following sites, using the highlighted buttons above.

Orbit Repo: https://download.eclipse.org/tools/orbit/downloads/drops/R20191126223242/repository

Webtools Repo: https://download.eclipse.org/webtools/repository/2019-12/


Then for each repo click Reload and then Apply and Close.

4. Head over to the Eclipse Marketplace with the top bar -> Help -> Eclipse Marketplace

5. Now that we added the repositories, we can install Darkest Dark Theme with DevStyle from the marketplace.

Run through the process, and accept the terms and conditions.

It will ask if you want to bundle the CodeTogether plugin, which is a nice live co-editing plugin for those who have it installed, I leave it unchecked, but it can be nice for peer programming.

It will install the plugin, and prompt you to restart CCStudio, go ahead and restart.

You now have dark mode!

Extras to the Extras

Aside from this plugin, there are a variety of additional plugins available for CCS, since its built on top of Eclipse, we can use any plugin available to Eclipse.

Feel free to explore on your own whim!

One of my personal favorites: