MSP430 + CLion. Part 2: Upload and Debug

In part 1 I've described the setting of CLion to compile C-programs for msp430 MCUs. Now it's time to look at the next part of developing embedded systems: deployment of the program to a target chip and debugging the program.

TI probes and communication protocols

Texas Instruments, as well as third companies, propose a lot of debug probes. Leaving aside the task of their review, I will deal with protocols (or probe families): eZ430 and eZ-FET.

The eZ430 protocol is used in cheap probes and is based on an MSP430F1612 and a TUSB3410 pair of chips. Unfortunately, it's not supported by TI CCS running on Linux. But well known MSPDEBUG utility supports eZ430 (as rf2500 protocol) and so the simple and not costly launchpads may be used for uploading programs and even for debugging them. I may say that not once I used stand-alone MSPDEBUG as a hard-debugging tool - and with a pleasure! As a probe, I use MSP-EXP430FR5739 board re-programmed to eZ430 a long time ago.

The eZ-FET probes are the next generation, as it seems. I have a new MSP-EXP430FR5969 probe, it is supported by CCS and solves the task of uploading and debugging programs in CCS.

But we have set the task of switching to CLion IDE - and we will switch!

To choose the probe as late as possible, I created such Configurations:

Build All

eZ-FET upload

eZ430 upload

Now the Build All compiles the project and Run for eZ-configurations performs the loading of the program on the MCU Flash or FRAM memory. The scripts used are very simple, but such a structure allows easily to add any new probe and the set of commands to be invoked.

All scripts may be downloaded from the repo.

File -> Settings -> Build, Execution, Deployment -> Toolchains: we add a new toolchain

The new (above Building) setting is Debugger: we use the one form MSP430-GCC toolchain (64 bit). My tries to use the MSPDEBUG and CLion Bundled debugger were rather unsuccessful. So the debugging that I've managed to implement, is only with the eZ-FET probe.

To launch GDB proxy (aka agent, aka server) there is a Bash Configuration:

Of course, gdb_agent_console may be launched from the stand-alone Terminal.

After the server is launched, Debug in GDB Configuration:

That's all!

Note: there is a CLion information: Debugging in Clion by Dmitry Nesteruk

Blog entry information

Last update

More entries in General

More entries from drvlas

Share this entry