/TI_Platform_Cores_For_Arduino

Replace Energia with Arduino. Use the Arduino IDE or CLI with Texas Instruments processors in the MSP430, MSP432, and Tiva families using the Arduino Boards Manager.

OtherNOASSERTION

Using Arduino to Develop With Texas Instruments Processors

Check Markdown Links

The Arduino Boards Manager makes it possible to load other processor families besides the original AVR-based Arduino boards. This repo contains instructions and relevant files for loading processor cores for Texas Instruments LaunchPad products in the MSP430, MSP432, and Tiva families. This allows development for TI LaunchPads using the Arduino IDE or CLI instead of the Energia IDE.

Energia was originally developed in 2012 as a fork from Arduino specifically to support Texas Instruments LaunchPads. Unfortunately, it is no longer under active development, with the last version released in 2019. The good news is that the processor cores used by Energia are compatible with Arduino. This means that Arduino can be used as a replacement for Energia, allowing for continued software development using TI’s LaunchPad products.

Loading a LaunchPad Board into Arduino IDE

  1. Open the Arduino Preferences pane.
  2. Click on the box next to the text field labeled Additional Boards Manager URLs.
  3. Add the following URL (on a line of its own) to the list: https://raw.githubusercontent.com/Andy4495/TI_Platform_Cores_For_Arduino/main/json/package_energia_optimized_index.json
  4. Click OK to close the window and OK to close the Preferences pane
  5. Open Tools->Board->Boards Manager... menu item
  6. Select the board platform you wish to install:
    • Use the search box at the top to make it easier to find the board (e.g., "MSP430")
    • Hover the mouse over the board platform you want, and click "Install"
    • It can take several minutes to install a board package
  7. Once the board package is installed, you can select the board you want with the Tools->Board menu.

Energia Application Libraries

The Energia IDE includes several libraries at the application level of the IDE instead of in the platform cores. This means that if you use the Arduino IDE/CLI and install an MSP or Tiva core, you don't end up getting every library that you would when using the Energia IDE. Most of the libraries included with the Energia application are either readily available as an Arduino library or are obsolete. However, two libraries in particular are specific to the platforms supported by Energia. I have created stand-alone repositories for these libraries:

More Detailed Information

The following sections contain more details on the board packages, sample GitHub action files, and the descriptions of the various files included in this repo.

Texas Instruments Platform Cores for Arduino IDE

With the end of development of the Energia IDE, I created this repository as an archive of the key files and packages needed to develop for various Texas Instruments LaunchPads.

This repository contains tested JSON index files and hadware platform cores for the Texas Instruments MSP430, MSP432, and Tiva C microcontrollers for use with the Arduino IDE or CLI. In addition, platform cores for msp432e (ethernet), cc13xx, cc3220emt, and cc3200 are also included but have not been tested.

Platform cores are used to add support for boards to the Arduino development software. The cores in this repo were originally developed for the Energia IDE, which is a fork of the Arduino IDE specifically for Texas Instruments processors. Software for many TI processors can now be developed directly using the Arduino IDE once the appropriate platform core is installed.

In addition to being able to use the Arduino IDE/CLI to develop for TI processors, it is also possible to use the compile-arduino-sketches GitHub action to automatically verify that sketches compile whenever they are checked into GitHub. Since the action uses the Arduino CLI, all you need to do is configure the workflow to install the appropriate platform core to have the action compile for TI processors.

Because compiling a sketch does not need all the data and tools required for a full development environment, I created some slimmed-down platform index files used by Arduino to load the cores. Only boards from a related family are defined, and only the compiler for that family of boards is downloaded (no debugger or other tools are configured).

These "minimal" platform configurations should slightly speed up the run times for the compile-arduino-sketches action and may also help reduce timeout errors when running the compile-sketches action. If your GitHub action exits with the following error when running a build using the official Energial board package file, try replacing it with the corresponding "minimal" file from this repo:

ERRO[0130] Error updating indexes: Error downloading index 'http://energia.nu/packages/package_energia_index.json': Get "http://energia.nu/packages/package_energia_index.json": dial tcp 107.180.20.87:80: connect: connection timed out

MSP432 Support

GitHub user ndroid created MSP432 board package version 5.29.4 based on the Energia version 5.29.1 board package. 5.29.4 adds support for the MSP432P4111 LaunchPad and fixes several issues with the board package as described in the change log.

Details on MSP432 Board Packages 5.29.1 and 5.29.2 Created by Andy4495

This section is provided to document the creation of updated MSP432 board packages that turned out to be unnecessary.

At the time I created this repo, the latest Energia-supplied board package for MSP432 that I could find was version 5.29.0. That version (and all earlier versions) has an issue that made it incompatible with the Arduino build tools, as documented in this thread and this unmerged pull request. The issue has to do with accessing a temporary path from within the build scripts. The Energia builder makes use of a variable called "build.project_path" which is not available with the arduino-builder. However, a global predefined property named "build.source.path" is available for use in platform.txt and defines the path needed for building MSP432 with Arduino.

In addition, the ino2cpp tool version 1.0.6 used during the MSP432 build process makes some assumptions on the availability and location of Java during the build process. This can cause issues when building locally with Arduino and when running the compile-arduino-sketches GitHub action both locally using nektos/act and on GitHub's servers.

So I created new MSP432 board package versions 5.29.1 and 5.29.2 based off of version 5.29.0. The only differences are changes to the platform.txt file as listed below. Version 5.29.1 fixes the Java issue for MacOS and Linux, and version 5.29.2 also adds a fix for Windows.

  • Update recipe.hooks.sketch.prebuild.1.pattern definition to change {build.project_path} to {build.source.path}
  • Change java.path.macosx value to /usr/bin/java
  • Change build.ino2cpp.cmd.linux value to "/usr/bin/java"
  • Change build.ino2cpp.cmd.windows value to "java" (5.29.2 only)
  • Update version to 5.29.2
  • Update version.string to 5292

As it turns out, an Energia-supplied board package version 5.29.1 is available that fixes the Arduino build issue and removes the Java dependency (by using ino2cpp version 1.0.7).

Because I was unaware of the Energia MSP432 version 5.29.1, there are two MSP432 board packages archived in this repo with a version 5.29.1: I added suffixes to the filenames to differentiate them.

Extra Step Needed for Windows - No Longer Necessary

If using the latest board package for MPS432 (version 5.29.4 or later), it is not necessary to install Java.

When using an older MSP432 board package, then Java needs to be installed on the build machine. I have successfully tested the 5.29.2 board package with both the Microsoft and Temurin Java distributions.

Details on Generating a Board Package

I ran the following steps to create the new board package using MacOS:

  1. Download version 5.29.0 (https://github.com/Andy4495/TI_Platform_Cores_For_Arduino/raw/main/boards/msp432r-5.29.0.tar.bz2)
  2. Decompress and extract files (in MacOS, this can be done by double-clicking the downloaded file)
  3. Change directory into the extracted folder
  4. Duplicate platform.txt and rename the copy to platform_orig.txt
  5. Update platform.txt as noted above
  6. Rename the parent folder to msp432r-core-5.29.2
  7. Recompress the updated folder: tar cvyf msp432r-5.29.2.tar.bz2 msp432r-core-5.29.2
  8. Calculate SHA-256 checksum: shasum -a 256 msp432r-5.29.2.tar.bz2
  9. Note the new file's size: ls -l msp432r-5.29.2.tar.bz2
  10. Udpate appropriate key values url, archiveFileName, checksum, and size in the package index file

Repository Contents

Package Index JSON Files

Located in the json folder.

The Package Index file names need to follow the convention specified in the Arduino Package Index Specification. Specifically, the file name needs be of the form package_YOURNAME_PACKAGENAME_index.json. The prefix package_ and suffix _index.json are mandatory, while the choice of YOURNAME_PACKAGENAME is left to the packager.

Package Index File MSP Board Version Tiva Board Version Notes
package_energia_index.json 1.0.5 1.0.3 Official board manager URL version from Energia.
package_Energia23_index.json 1.0.6 1.0.3 Version installed by Energia23.
package_energia_latest_index.json 1.0.7 1.0.4 See Note 1 below.
package_energia_optimized_index.json 1.0.7 1.0.4 Latest version of each board only. Use as Board Manger URL.
package_msp430_elf_GCC_index.json See Note 2 below.
package_energia_minimal_MSP_105_index.json 1.0.5 N/A MSP430 boards only and installs from this repo.
package_energia_minimal_MSP_107_index.json 1.0.7 N/A MSP430 boards only and installs from this repo.
package_energia_minimal_MSP_107_alternate_index.json 1.0.7 N/A MSP430 boards only, installs from this repo, compiler from Release.
package_energia_minimal_TM4C_103_index.json N/A 1.0.3 TM4C boards only and installs from this repo.
package_energia_minimal_TM4C_104_index.json N/A 1.0.4 TM4C boards only and installs from this repo.
package_energia_minimal_TM4C_104_alternate_index.json N/A 1.0.4 TM4C boards only, installs from this repo, compiler from Release.
package_energia_development_MSP432r_index.json 5.29.4 N/A MSP432P401R board only, use with local Arduino IDE/CLI.
package_energia_minimal_MSP432r_index.json 5.29.4 N/A MSP432P401R board only, installs minimal tools.
package_msp432_index.json 5.29.4 N/A MPS432 package index created by ndroid
Note
  1. This version of the package index is loaded by Energia23 when using the Board Manager menu item in Energia. Note that the filename loaded as-is (platform_index.json) does not conform to the Package Index Specification naming convention. It is renamed in this repo with a valid name.
  2. package_msp430_elf_GCC_index.json is an alternate package index file which defines 2.0.x versions of the msp430 platform. The 2.0.x vesions are not part of the official Energia application and use a much newer GCC compiler (V2.x) which supports C99. This package index file only includes definitions for msp430 and not any other platforms. This thread explains the differences and the file can be downloaded from the Energia.

Board Package Files

Located in the boards directory. These files are referenced by the package index json files.

These are copies of the board package files avaialble from Energia (with the exception of the mps432 packages as explained above).

  • msp430-1.0.5.tar.bz2
  • msp430-1.0.6.tar.bz2
  • msp430-1.0.7.tar.bz2
  • msp430elf-2.0.7.tar.bz2
  • msp430elf-2.0.10.tar.bz2
  • msp432r-5.29.2.tar.bz2
  • msp432-5.29.4.tar.bz2
  • tivac-1.0.3.tar.bz2
  • tivac-1.0.4.tar.bz2
Board Platform Compiler and Tool Versions

The tools are specific to the board package platform and version.

Board Version Compiler dslite mspdebug ino2cpp
MSP430 1.0.7 msp430-gcc 4.6.6 9.3.0.1863 0.24 N/A
MSP430 1.0.6 msp430-gcc 4.6.6 9.2.0.1793 0.24 N/A
MSP430 1.0.5 msp430-gcc 4.6.6 8.2.0.1400 0.24 N/A
MSP430 2.0.10 msp430-elf-gcc 9.2.0.50 9.3.0.1863 0.24 1.0.4
MSP430 2.0.7 msp430-elf-gcc 8.3.0.16 9.3.0.1863 0.24 1.0.4
MSP432 5.29.4 arm-none-eabi-gcc 8.3.1-20190703 9.3.0.1863 N/A 1.0.7
MSP432 5.29.2 arm-none-eabi-gcc 6.3.1-20170620 9.2.0.1793 N/A 1.0.6
Tiva 1.0.4 arm-none-eabi-gcc 8.3.1-20190703 9.3.0.1863 N/A N/A
Tiva 1.0.3 arm-none-eabi-gcc 6.3.1-20170620 7.2.0.2096 N/A N/A
Tool Download Links
msp430-gcc 4.6.6 Wndows MacOS Linux
msp430-elf-gcc 9.2.0.50 Wndows MacOS Linux
msp430-elf-gcc 8.3.0.16 Wndows MacOS Linux
arm-none-eabi-gcc 8.3.1-20190703 Wndows MacOS Linux
arm-none-eabi-gcc 6.3.1-20170620 Wndows MacOS Linux
dslite 9.3.0.1863 Wndows MacOS Linux
dslite 9.2.0.1793 Wndows MacOS Linux
dslite 8.2.0.1400 Wndows MacOS Linux
dslite 7.2.0.2096 Wndows MacOS Linux
mspdebug 0.24 Wndows MacOS Linux
ino2cpp 1.0.4 Wndows MacOS Linux
ino2cpp 1.0.6 Wndows MacOS Linux
ino2cpp 1.0.7 Wndows MacOS Linux
Additional Board Package Files

In addition to the board package files listed above, the following board packages are included in this repo

These have not been tested:

  • cc13xx-4.9.1.tar.bz2
  • cc3200-1.0.3.tar.bz2
  • cc3220emt-5.6.2.tar.bz2
  • msp432e-5.19.0.tar.bz2

These are included for historical purposes:

  • msp432r-5.29.0.tar.bz2
    • Used as a baseline to create verstions 5.29.1 and 5.29.2. It will not work correctly with Arduino as mentioned above.
  • msp432r-5.29.1-Andy4495_version.tar.bz2
    • Package inadvertently created to fix a build issue - see MSP432 Support above. Note that this has the same version number as a board package provided by Energia, and has "Andy4495_version" added to the file name.
  • msp432r-5.29.1-Energia_version.tar.bz2
    • Version provided by Energia, and is differentiated from the other 5.29.1 package with Energia_version added to the file name.

GitHub Workflow Action Definition Files

Located in the actions directory.

These files contain example yaml configuration files for arduino-compile-sketches actions for MSP and Tiva platforms.

You can generally use the latest version of the board package for the platform you are compiling. Configuration files for older platform versions are included in case there is a specific compatibility issue with a particular sketch or library.

Workflow action files should be placed in the .github/workflows directory in your repo.

  • compile_arduino_sketch_standard-MSP430-105.yml
    • Compile for MSP430G2 using the standard Energia platform index and board packages version 1.0.5 downloaded from energia.nu
  • compile_arduino_sketch_standard-MSP430-107.yml
    • Compile for MSP430G2 using the standard Energia platform index and board packages version 1.0.7 downloaded from energia.nu
  • compile_arduino_sketch_standard-TivaC-103.yml
    • Compile for Tiva TM4C123 using the standard Energia platform index and board packages version 1.0.3 downloaded from energia.nu
  • compile_arduino_sketch_standard-TivaC-104.yml
    • Compile for Tiva TM4C123 using the standard Energia platform index and board packages version 1.0.4 downloaded from energia.nu
  • compile_arduino_sketch_minimal-MSP430G2-105.yml
    • Compile for MSP430G2 with minimal package index file and board package 1.0.5 downloaded from this repo.
  • compile_arduino_sketch_minimal-MSP430G2-107.yml
    • Compile for MSP430G2 with minimal package index file and board package 1.0.7 downloaded from this repo.
  • compile_arduino_sketch_minimal-MSP430F5529-105.yml
    • Compile for MSP430F5529 with minimal package index file and board package 1.0.5 downloaded from this repo.
  • compile_arduino_sketch_minimal-MSP430F5529-107.yml
    • Compile for MSP430F5529 with minimal package index file and board package 1.0.7 downloaded from this repo.
  • compile_arduino_sketch_minimal-MSP432R.yml
    • Compile for MSP432P401 with minimal package index file and board package 5.29.4 downloaded from this repo.
  • compile_arduino_sketch_minimal-TM4C123-103.yml
    • Compile for TM4C123 with minimal package index file and tivac board package 1.0.3 downloaded from this repo.
  • compile_arduino_sketch_minimal-TM4C123-104.yml
    • Compile for TM4C123 with minimal package index file and tivac board package 1.0.4 downloaded from this repo.

References

License

The majority of the files in this repo are either a copy or a derivation of Energia platform cores, which are licensed under the GNU Lesser General Public License v2.1 per Energia. For consistency, the non-Energia derived software and files in this repository are also released released under LGPL v2.1. See the file LICENSE.txt in this repository.