blob: 830f906eeca37fc8a7cb78249c5726a5d5fefae5 [file] [log] [blame]
<!DOCTYPE HTML>
<!--
Copyright (c) 2010 - 2019 TU Wien ACIN, fortiss GmbH
2019 Johannes Kepler University Linz
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Carolyn Oates, Alois Zoitl, Monika Wenger, Jose Cabral
- initial API and implementation and/or initial documentation
Bianca Wiesmayr
- adapting, restructuring and extending the installation tutorial
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Building 4diac FORTE for Lego Mindstorms</title>
<link rel="stylesheet" type="text/css" href="../help.css">
</head>
<body>
<h1 id="topOfPage">Building 4diac FORTE for Lego Mindstorms</h1>
<p><a href="http://www.lego.com/" target="_blank">LEGO</a> is a trademark name and Mindstorms NXT is a registered trademark from the company LEGO.
This tutorial uses <a href="http://ecos.sourceware.org/" target="_blank">eCos</a> real time operating system (RTOS) and 4diac FORTE on the ARM7 processor of the LEGO Mindstorms NXT Brick.
The system of the <a href="../../html/4diacIDE/use4diacLocally.html">Blink Tutorial</a> can used with Lego Mindstorms (LMS) as a first test example. If you do not already use Eclipse with Cygwin please consider to get it, as it is described <a href="../../html/installation/cygwin.html">here</a>.</p>
<ol>
<li>For Cygwin, consider the <a href="http://ecos.sourceware.org/cygwin.html" target="_blank">eCos installation instructions.</a></li>
<li>Install the <a href="http://ecos.sourceware.org/getstart.html" target="_blank">GNU ARM toolchain</a></li>
<li>Within the FORTE source create the directories <span class="folderLocation">bin/lego</span> and copy the eCos <span class="folderLocation">include</span> and <span class="folderLocation">lib</span> directories into it.</li>
<li>Open CMake-GUI, for source directory enter the FORTE project directory, for build directory, enter the previously created directory <span class="folderLocation">.../bin/lego</span> and press the <span class="button4diac">Configure</span> button.</li>
<li>From the dropdown choose: <span class="specificText">UNIX Makefiles</span> and select <span class="specificText">Specify options for cross-compiling</span> then press the <span class="button4diac">Next</span> button</li>
<li>Specify options for cross-compiling:
<ul>
<li>Operation System: eCos</li>
<li>Compilers for C: <span class="specificText">arm-elf-gcc</span> (need to include path if not installed under cygwin)</li>
<li>Compilers for C++: <span class="specificText">arm-elf-g++</span> (need to include path if not installed under cygwin)</li>
<li>insert the path to the target <span class="folderLocation">.../bin/lego</span></li>
</ul>
<div class="code">INCLUDE(CMakeForceCompiler)
# this one is important
SET(CMAKE_SYSTEM_NAME eCos)
# specify the cross compiler
CMAKE_FORCE_C_COMPILER(arm-elf-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(arm-elf-g++ GNU)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH C:/.../FORTE/bin/lms)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</div>
<img src="../../html/installation/img/CMake_eCos.PNG" alt="CMake for eCos"/>
</li>
<li>press the <span class="button4diac">Configure</span> button, check the following options an press the <span class="button4diac">Generate</span> button
<div class="code">FORTE_ARCHITECTURE_LMS #check
FORTE_COM_ETH #uncheck
FORTE_MODULE_xxx #check as needed
FORTE_USE_64BIT_DATATYPES #uncheck since not available in LMS
FORTE_USE_LREAL_DATATYPE #uncheck since not available in LMS
FORTE_USE_REAL_DATATYPE #uncheck since not available in LMS</div></li>
<li> in Eclipse make all (Note: under cygwin in <span class="folderLocation">lms/bin</span> directory <span class="specificText">make</span> forte also works)</li>
<li>Generate <span class="fileLocation">forte.bin</span> separately or as part of flashing bat file <span class="specificText">arm-elf-objcopy --gap-fill 0xFF -O binary forte.elf forte.bin</span> notice now <span class="specificText">.elf</span> before no extension</li>
<li>Ready to flash and test on LMS </li>
</ol>
<h1 id="whereToGoFromHere">Where to go from here?</h1>
<p>Now that you installed the required tools, it's time to start using them. Take a look at the following page:</p>
<p><a href="../../html/4diacIDE/overview.html">Step by step tutorial</a></p>
<p>If you want to compile FORTE for another platform or want to know more about that, here's a quick link back:</p>
<p><a href="../../html/installation/install.html">Install 4DIAC</a></p>
<p>If you want to go back to the Start Here page, we leave you here a fast access</p>
<p><a href="../../html/startHere/startHere.html">Start Here page</a></p>
<p class="goToTop">Or <a href="#topOfPage">Go to top</a></p>
</body>
</html>