Proper Debugging for Energia Sketches

Moving a sketch from Energia to Code Composer Studio

Energia is a tool that brings the Arduino and Wiring framework to Texas Instruments’ MSP430 microcontrollers and the MSP430 Launchpad development board. This allows for easy development in an Arduino-like environment while targeting a different microcontroller family.

One problem with Energia and Arduino is the difficulty of debugging. Usually, we’re stuck putting a Serial.println(); and watching the serial port to trace what our program is doing. Other options include blinking LEDs, or using external displays.

Code Composer Studio, TI’s official development tool, allows for line-by-line debugging of applications. You can set breakpoints, watch the value of variables, and step through an application one instruction at a time.

The good news is that the latest version of Code Composer Studio supports importing Energia sketches. Once imported, you can step through the code and easily debug your application. This is a huge help to people developing more complex software using Energia, such as libraries.

TI gives us an overview of the new feature in a video after the break.

[Thanks to Adrian for the tip!]

Comments

  1. AnarKIT says:

    Long story short, TI implements new libraries in their main product, so now you can use the traditional tools with your energia code.

    Why am I not surprised to see this?

    One of the big issues with the release of the launchpad was that they seemed to be targeting the Arduino market, but with none of the software tools that actually made Arduino popular. Seems now they’ve waited for someone to develop them and then took it back into their own product.

    What I’d really like to see is mspdebug support incorporated into energia, Now that would be a good story to see here.

    • WorthyAdversary says:

      Damn it! Sorry mod I did not mean to report this…

      TI should never have tried to dumb everything down for the Arduino market – certainly one key demographic for the launchpads I suspect. TI/ST are far more advanced chips (peripherals) than Atmel/Microchip and Arduino style ‘C’ seriously detracts from their capability. Just tried Arduino for the first time – nothing short of pathetic- couldn’t even set PWM to any duty/freq, it was changeable by prescaler and a few big intermediary duty/freq steps (I don’t think I am mistakin’?)- TI could not get away with that – not to mention absolutely no debugging (prior to this of course)/. Real C is so much better and much more worth while… Really don’t understand the support for Arduino, there is more than enough support/tutorials out there to just start with C on TI or ST hardware.

      Incidentally, CCS is an example downside of open source software (as it’s licensed now)… TI added a little bit of bloatware and then sells eclipse for an exorbitant amount.

      • Hélio says:

        Nowadays people want everything easy which is why Arduino, Energia is used a lot, I never used arduino and I will not start using. still makes me confused how people program microcontrollers without debug.

        • NotArduino says:

          Moore’s Law has been the enabler allowing mediocre programmers to abstract away details like memory management, cache optimization, even interprocess communication etc. In the embedded world, it’s crept in to hide memory mapped registers and interrupt handlers. In the same way python developers feel like real programmers, Arduino makes artists feel like real embedded developers, though they are both playing in the same kindergarten class.

          Energia is not used as much as you think it would be; in on 43oh.com forums you will find extremely talented hobbyists who do not touch it.

          • Tiago Dias says:

            “In the same way python developers feel like real programmers”

            There’s No true Scotsman, am I right?

      • AnarKIT says:

        I should have known better than to voice suport for arduino like things in any way here.. I fail to understand the hate people foster for arduino. Its a software lib on top of the basic tools everyone uses on microcomtrollers. Use as much or as little as you want. I’m a hardware designer and I lovebarduino causenit lets me lash up test benches quickly and cheaply without having to delve into the minutia of the specific chip I’m on as deeply.

    • NotArduino says:

      TI was not originally targeting the Arduino market; they were targeting industry professionals first, then hobbyists. When Energia came out years later, it was done by a few TI employees and Rei Vilo. Only the MSP430G2553 really had anywhere near the RAM and flash capability for your typical Arduino sketch. Compile an Energia sketch, include a few libraries and you will see what I am talking about.

      It was only with the release of the MSP430G29XX and the F5529 launchpad that running bloated Energia code was feasible. And Energia is only bloated because they second handed Arduino/Wiring.

      IIRC mspdebug has been supported by Energia since the beginning, at least on Linux.

  2. davity says:

    Amazing that TI give built-in support for Energia on their CCS, well done TI!

  3. Andrew says:

    Oh, for God’s sake! Just ditch both and use emacs!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,028 other followers