Skip to Main Content Skip to Search
Product Documentation

Example: Build Generated Code on a BeagleBoard Running Linux

Overview

This example shows you how to generate code on a Windows host, and then build it remotely on a BeagleBoard running Linux.

Configure the Windows Host

Download and install the following PuTTY utilities from http://www.chiark.greenend.org.uk/~sgtatham/putty/download:

Configure the BeagleBoard

Install the GNU-compiler toolchain on the BeagleBoard. Open a terminal session with the Linux command line on the BeagleBoard.

For example, on a board running the Angstrom Linux distribution, enter the following commands:

root@beagleboard:~# opkg install binutils 
root@beagleboard:~# opkg install gcc 
root@beagleboard:~# opkg install gcc-symlinks 
root@beagleboard:~# opkg install cpp-symlinks
root@beagleboard:~# opkg install libstdc++-dev 
root@beagleboard:~# opkg install make-dev

Configure MATLAB

Configure MATLAB to generate code.

  1. Enter xmakefilesetup at the MATLAB command line. In the XMakefile Configuration dialog, set template to gmake and configuration to gcc_target.

  2. Open the Target Preferences block in your model. Set IDE/Toolchain to Eclipse, set Board to BeagleBoard ARM, and set Operating System to Linux.

  3. In your model, open Simulation > Configuration Settings. Under Code Generation, select the IDE Link pane. Set Build format to Makefile, and set Build Action to Create_makefile.

  4. Generate the code by pressing Ctrl B.

  5. Use the load method to load the buildInfo.mat file from the project directory to the BeagleBoard. For example, at the MATLAB command prompt enter:

    s =load('sumdiff_codegen_eclipseide\buildInfo.mat')
  6. Use remoteBuild function to build the code on the BeagleBoard. For example, enter:

    remoteBuild(s.buildInfo, '/home/root', '144.212.110.193', 'root', 'password', 'C:\utils\putty')

The GNU compiler toolchain automatically builds and runs the software on the BeagleBoard.

For more information, see remoteBuild.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS