File Exchange

image thumbnail

Simulink (Embedded Coder) Target for TI LaunchPad

version (210 KB) by Mikhail
Thsi target support package allows you to deploy your algorithms on TI LaunchPad.


Updated 17 Aug 2015

From GitHub

View Version History

View license on GitHub

Simulink (Embedded Coder) Target for TI LaunchPad
TI LaunchPad ( is an easy-to-use, affordable (< 5 USD),
and scalable introduction to the world of microcontrollers and the MSP430 family.
Simulink ( is a leading environment
for multidomain simulation and Model-Based Design.
Embedded Coder ( allows you to
generate C code and deploy your algorithms to target hardware.


1) Windows/Linux: Have Code Composer Studio 5 installed (
Note: Currently Code Composer Studio 5 for Linux doesn't support LaunchPad
connection/debugging. Therefore, you will also need mspdebug ( on Linux to
download/debug after compiling with CCSv5 toolchain.
On Linux, you can use mspgcc toolchain instead of CCSv5. This package supports
both mspgcc and CCSv5 on Linux.

Make sure your toolchain is working (build and download some test project, check connection)
before you proceed!

2) a) Extract this package somewhere. Make sure there are no spaces/non-ascii characters in path (just in case).
b) Make sure you have a working/supported host compiler ( by running 'mex -setup' in MATLAB.
c) Within MATLAB, 'cd' to the directory containing launchpad_setup.m and run this script.
d) Swap TX/RX jumpers on TI LaunchPad (see the group of 5 jumpers on your board). This package uses HW UART (see inscription on the board). If you don't do this, Serial Read/Write blocks and PIL will not work.

3) You should be good to go.

What this package already has:
- Standalone execution on target (driven by ISR)
- Support for MSP430G2553 only
- Simulink library blocks for:
* Serial read/write (hardware UART - you must swap TX/RX jumpers on your LaunchPad)
* Built-in temperature sensor
* Push button
- Execution in PIL mode (hardware UART - you must swap TX/RX jumpers on your LaunchPad)
- PIL mode profiling

What this package would like to have:
- More Simulink blocks
- Support for other LaunchPad compatible MCUs
- More documentation

Cite As

Mikhail (2021). Simulink (Embedded Coder) Target for TI LaunchPad (, GitHub. Retrieved .

Comments and Ratings (8)

Kunal Khosla


I have a code that collects data from a previously executed code and I run a different program, that works on this data and finally produce results.
Is it possible? and I want to deploy the same onto the Tiva C Series 123G Evaluation Kit. Any help regarding this will be appreciated.

Kunal Khosla


Use the shipped demo model called tilp_pil_system, which is already set for PIL mode.

Have a look at the video:

You wouldn't understand the words in the video, but the visual is good enough to get you started.

The video show Model reference PIL approach as opposed to Top model PIL approach that you are trying to do.

Please refer to documentation for information about how to setup the model for Top model PIL.


Hello again,
The PIL mode doesn't work on my computer.
If I try it only via ccs -> i can debug the application. When I start "RUN" from Simulink (in PIL mode) I get an error: "Error evaluating 'InitFcn' callback of S-Function block (mask) 'launchpad_R2012b_wrapper/launchpad_R2012b'.

Caused by:
An error occurred while calling into the SIL or PIL target connectivity implementation.
Error(s) encountered while building model "launchpad_R2012b" ".

I startet Matlab2012b. Run "mex -setup", run launchpad_setup.m. Open demo "launchpad_R2012b.slx" mode PIL and press the run button.
Only download works fine -> but how I can debug the application on the target directly from Simulink?


Using PIL mode in Simulink or like you usually do with CCS debugger.


Ok build and download works. But how can I obtain values from the MSP430 (debug)?


By pressing the Build button, obviously. Please make yourself familiar with some basic concepts of Simulink and Embedded Coder before asking questions.


after opening the demo launchpad_R_2012b in matlab -> how can I download/debug the application on the launchpad target?


Denis Zhegalin

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!