Skip to content

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.

License

Notifications You must be signed in to change notification settings

Andy4495/TI_Platform_Cores_For_Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Arduino to Develop With Texas Instruments Processors

Check Markdown Links

Use Arduino as a replacement for Energia to develop on Texas Instruments LaunchPad products.

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 maintained, with the last version released in 2019. The good news is that the processor cores used by Energia are compatible with Arduino.

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 to the list (on a line of its own):

    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 and Examples

The Energia IDE includes several libraries and examples 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 and example sketch that you would when using the Energia IDE. Most of the libraries and examples included with the Energia application are either readily available with Arduino or are obsolete. However, some are particular to the platforms supported by Energia and are not directly available with Arduino, so I have published standalone libraries to allow them to be loaded into Arduino.

Stand-alone repositories for Energia libraries:

Energia example sketches packaged into libraries so that they can be loaded into the Arduino IDE:

Installing LaunchPad Drivers

Depending on your host machine and the specific board you are programming, you probably need to install drivers and/or configuration files in order to communicate with the LaunchPad. If you see a message along the lines of "Error connecting to the target", then a missing driver or configuration file is likely the cause.

MacOS or Windows

On MacOS or Windows, the drivers can be installed using either of the methods below:

  1. Install Code Composer Studio IDE from Texas Instruments.

    Code Compuser Studio is a free professional-level IDE for Texas Instruments processors. It is fully supported and regularly updated by Texas Instruments. However, it is a large download (> 1 GB), and installs many more packages than are needed if you are just using the Arduino IDE. You are essentially installing a full IDE that you won't be using, just to get the drivers.

    Even with this in mind, I use this method to install the drivers, because this way I know they are up-to-date and supported.

    Also note, per TI:

    Code Composer Studio is going through a major update. As part of this major update Code Composer Studio is transitioning from the Eclipse application framework to the much more modern Theia framework. Code Composer Studio Theia is now available for most devices and additional features are being added with each release. The final planned Eclipse-based release is expected to be CCS 12.8.

    I currently have installed the Eclipse-based version of CCS and have not tested the Theia-based version. However, I expect that the drivers installed by either version are the same.

  2. Or, follow the host platform and board-specific instructions from the Energia website - Windows or MacOS - to install just the drivers (without the full CCS IDE).

    The driver packages from the Energia website are no longer supported and will not be updated. They probably still work, but do not expect any support if you run into issues with them.

Linux

On Linux, no drivers are required for MSP430, MSP432, or Tiva LaunchPads. Just run the following steps from the Energia Linux Install Guide page to add the udev rules:

  1. Download the udev rules: TI udev rules

  2. Open a terminal and execute the following command:

    sudo mv 71-ti-permissions.rules /etc/udev/rules.d/
  3. If your Linux distribution supports the service command you can activate the new rules with sudo service udev restart. If your board is plugged in, unplug it and plug it back in.

  4. If your Linux distribution does not support the service command, or if you are still unable to upload to the LaunchPad, then restart your computer to activate the rules.

Board Packages and PlatformIO

Per GitHub user chemmex, it is possible to use these processor cores with PlatformIO. Some manual setup and configuration is required, which includes editing the platformio.ini file. For more details, refer to this issue comment and this PlatformIO discussion.

New Board Package Versions to Remove Python 2 Dependency

Python 2 has long since reached its end of life, and recent Linux distros no longer include it (Debian 12, Ubuntu 24.04, Mint 22, etc.). Unfortunately, the version of the DSLite tool used by the Energia-created board packages has a dependency on Python 2. Attempting to upload and Arduino sketch on these newer distros will create an error similar to the following (see issue #6):

/home/user/.arduino15/packages/energia/tools/dslite/9.3.0.1863/DebugServer/bin/DSLite: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

I have created a new DSLite tool package using the latest version of TI's UniFlash. I have also created MSP430, MSP432, and Tiva board packages and associated board manager JSON files to reference the updated board packages and DSLite tool. The new DSLite tool and board packages continue to be compatible with Windows, MacOS, and older Linux distros, in addition to now supporting the most recent distros that no longer include Python 2.

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.

Using the TI Cores with GitHub Actions

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).

If your GitHub action exits with a timeout error similar to this:

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

Then try replacing the index file with the corresponding "minimal" file from this repo. The "minimal" platform configurations should speed up the run times and reduce timeout errors when running the compile-arduino-sketches action.

MSP432 Support

GitHub user ndroid has created updated MSP432 board packages based on the Energia version 5.29.1 board package. These updated packages add support for the MSP432P4111 LaunchPad and fix several issues with the board package as described in the change log.

Later versions of Energia include support for multi-tasking for MSP432 boards based on TI-RTOS. The MSP432 board package for Arduino continues to support multi-tasking, which can be accessed by using the methods demonstrated in the Energia-MultiTasking examples or through the Galaxia library created by Rei Vilo.

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 (archived version) 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 cvjf 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 (json Folder)

Package index file to use as Arduino Board Manager URL

Use this URL in the Additional Boards Manager URLs field: https://raw.githubusercontent.com/Andy4495/TI_Platform_Cores_For_Arduino/main/json/package_energia_optimized_index.json

File Name MSP430 Version MSP432 Version Tiva Version Notes
package_energia_optimized_index.json 1.1.0 5.30.0 1.1.0 Recommended for Arduino IDE.
Package index files to use with GitHub Actions

These files include a single platform version and only the tools needed for compilation. This shortens the time needed to run an action, since only the files needed for compilation are installed in the action runner. Use the URL https://raw.githubusercontent.com/Andy4495/TI_Platform_Cores_For_Aduino/main/json/File-Name in the source-url field.

File Name MSP430 Version MSP432 Version Tiva Version Notes
package_energia_minimal_msp430_index.json 1.1.0 N/A N/A MSP430 boards only.
package_energia_minimal_msp432_index.json N/A 5.30.0 N/A MSP432 boards only.
package_energia_minimal_tiva_index.json N/A N/A 1.1.0 Tiva boards only.
Package index files kept for historical reference or specialized applications
File Name MSP430 Version MSP432 Version Tiva Version Notes
package_energia_index.json 1.0.5 5.23.1 1.0.3 Last official board manager URL published by Energia.
package_Energia23_index.json 1.0.6 5.25.2 1.0.3 Version installed by Energia23.
package_energia_latest_index.json 1.0.7 5.29.0 1.0.4 See Note 1 below.
package_msp430_elf_GCC_index.json 2.0.10 N/A N/A See Note 2 below.
package_msp432_index.json N/A 5.29.5 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 from the Energia repo (platform_index.json) does not conform to the Package Index Specification naming convention. 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. The file has been 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 (archived version) explains the differences and the file can be downloaded from this repo or directly 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 (except as noted).

  • msp430-1.0.5.tar.bz2
  • msp430-1.0.6.tar.bz2
  • msp430-1.0.7.tar.bz2
  • msp430-1.1.0.tar.bz2 (Updated from 1.0.7 by me to use dslite 12.8.0.3522)
  • msp430elf-2.0.7.tar.bz2
  • msp430elf-2.0.10.tar.bz2
  • msp432r-5.29.2.tar.bz2
  • msp432-5.29.5.tar.bz2 (Created by GitHub user ndroid)
  • msp432-5.30.0.tar.bz2 (Updated from 5.29.5 by me to use dslite 12.8.0.3522)
  • tivac-1.0.3.tar.bz2
  • tivac-1.0.4.tar.bz2
  • tivac-1.1.0.tar.bz2 (Updated from 1.0.4 by me to use dslite 12.8.0.3522)
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.1.0 msp430-gcc 4.6.6 12.8.0.3522 0.24 N/A
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.30.0 arm-none-eabi-gcc 8.3.1-20190703 12.8.0.3522 N/A 1.0.7
MSP432 5.29.5 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.1.0 arm-none-eabi-gcc 8.3.1-20190703 12.8.0.3522 N/A N/A
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 12.8.0.3522 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 untested board packages are included in this repo:

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

And 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.

Compile Sketches Using GitHub Workflows

The files in the actions directory contain examples for arduino-compile-sketches GitHub actions for MSP and Tiva platforms.

  • compile_arduino_sketch-MSP430G2.yml
  • compile_arduino_sketch-MSP430F5529.yml
  • compile_arduino_sketch-MSP432P401R.yml
  • compile_arduino_sketch-TM4C123.yml

References

License

The DSLite tool is licensed per the Texas Instruments Uniflash License. DSLite is available for download in the Assets area on the Releases page.

The majority of the remaining 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. The other 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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages