Difference between revisions of "Configuring EMAC OE 4.0 SDK"

From wiki.emacinc.com
Jump to: navigation, search
m (Mgloff moved page Configuring EMAC OE SDK to Configuring EMAC OE 4.0 SDK: 4.0 related information)
Line 1: Line 1:
{{todo|Fix and finish; default password is not emac_inc_90210|Michael Gloff|project=oe 4,oe 5,mg}}
+
{{todo|Fix and finish|Michael Gloff|project=oe 4,Revise, mg}}
  
{{EMAC OE SDK Conventions}}
+
==SDK Configuration Script==
  
When Eclipse generates a Makefile to use for building a project, the generated Makefile includes a file named global.properties before it performs any other steps. This file is located in the projects directory, which is the root directory for Eclipse projects. The projects directory is located within the EMAC SDK directory provided by the EMAC SDK package (or installed on the LDC).
+
Before compiling source code on the development machine for the target machine, the toolchain libraries for the target machine must be specified.
 
+
<cl>
The <code>global.properties</code> file provides information needed to build projects and upload them to the target machine (the board supplied by EMAC). The following information is provided by this file:
+
1. Open a terminal window
 
 
{| class="wikitable"
 
|-
 
! Configuration variable !! Description
 
|-
 
| <code>SDKBASE</code> || The base directory for the SDK .
 
|-
 
| <code>CC</code>, <code>CXX</code> || Exectuable binaries to use for compiling for the C and C++ compiler, respectively.
 
|-
 
| <code>LD_LIBRARY_PATH</code> || The path the linker should use to search for shared library files.
 
|-
 
| <code>CFLAGS</code> || The flags passed to the compiler to specify target processor architecture, debugging flags, etc.
 
|-
 
| <code>OFLAGS</code> || The flags passed to the compiler to specify optimization options to use.
 
|-
 
| <code>TARGET_IP</code> || The IP Address of the target machine (needed for uploading the compiled binary to the target machine).
 
|-
 
| <code>LOGIN</code> || The user name to use for logging into the target machine.
 
|-
 
| <code>PASSWORD</code> || The password to use for logging into the target machine.*
 
|-
 
| <code>WPUT</code> ||  The location of the <code>wput</code> command, along with options to pass to <code>wput</code>.
 
|}
 
 
 
'''*NOTE''' The password is stored in plain text in this file. However, read permission is required to view this password. In most development environments, this should not be an issue. If development is taking place in a shared environment (such as a University lab) and secrecy of this password is required, simply ensure that only trusted users have read permission for this file.
 
 
 
{{mbox | type = warning | text = Configuring permissions on files is a common source of problems for people new to doing so under Linux. EMAC does not recommend altering the default settings (which should be secure in most environments) unless absolutely necessary. EMAC will only be able to provide very limited support should these settings be manually configured. The standard Linux commands, <code>chmod</code>, <code>chgrp</code>, and <code>chown</code> are typically used to configure these permissions. Please see the documentation for these commands using the man command, or find a reference with your favorite search engine. '''Caveat''': This will require any user wishing to build this software to have such permission, since programs run by a user can only read files the user is permitted to use.}}
 
 
 
The <code>global.properties</code> file is actually a type of virtual file, called a softlink. This softlink acts as a pointer which points to another file. The file it points to is chosen when the CPU architecture is chosen. To see why it works this way, see the above information about the flags specified for the processor architecture, and note that different library and compiler paths may be required to support different hardware. The softlink is updated when the hardware to use for the development project is selected.
 
 
 
{{mbox | type = notice | text = Should problems relating to this part of the build system show up during the development process, these files or softlinks may have been accidentally modified. Inspecting these files and softlinks, and/or rerunning the hardware selection script, may provide the fix for the problems. The <code>ln</code> command with the <code>-s</code> option (see <code>man ln</code>) is the command used to create softlinks.}}
 
 
 
==Configuration Steps==
 
 
 
The following configuration steps are necessary to begin using the EMAC OE SDK.
 
 
 
Before cross-compiling source code on the development machine for the target machine:
 
 
 
* A set up script linking <code>global.properties</code> to an architecture-specific <code>global.properties</code> file must be run.
 
* The <code>TARGET_IP</code> variable in the global.properties file must be changed to the IP address or hostname belonging to the target board.
 
  
{{mbox | type = notice | text = These configurations assume that the [[Installing_EMAC_OE_SDK]] is installed.}}
+
* Navigate to the SDK directory.
 
 
==SDK Set Up Script==
 
 
 
Before compiling source code for the target machine, toolchain libraries for the target machine must be specified by running <code>setmachine.sh</code>.
 
 
 
===Procedure===
 
<cl>
 
1. Navigate to the SDK directory.
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/
 
developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Run the script using the command shown below to produce a menu as shown in Figure 1 with options for the target machine for which the source will be compiled.
+
* Run the script using the command shown below to produce a menu as shown in Figure 1.
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
developer@ldc:~$ ./setmachine.sh
 
developer@ldc:~$ ./setmachine.sh
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
* Select the appropriate target machine type
 
</cl>
 
</cl>
 +
<br />
  
[[File:Emac_oe_sdk_setup-2.png]]
+
:::::[[File:Emac_oe_sdk_setup-2.png]]
  
 
==Remote Upload Set-up==
 
==Remote Upload Set-up==
  
In the <code>global.properties</code> file there is a variable, <code>IP</code> which must be set to the target board IP address as shown in Listing 1 below. This step is necessary to ensure that the Make target, <code>'upload'</code> will work as expected.
+
The global.properties file contains the fields necessary to contact and connect to the target board as well as the architecture specific build paths.
 
 
===Procedure===
 
 
 
 
<cl>
 
<cl>
1. Navigate to the projects directory within the SDK.
+
1. Obtain the target machine's current IP address by issuing the following command from a shell on the target system:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/projects
+
root@emac-oe:~# /sbin/ifconfig eth0 | grep inet
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* The <code>global.properties</code> file should be listed in the current directory. The relevant lines from <code>global.properties</code> are shown in Listing 1 below.
+
* Navigate to the projects directory within the SDK.
'''Listing 1. <code>global.properties</code> snippet'''
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
TARGET_IP=
+
developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/projects
LOGIN=root
 
PASSWORD=emac_inc_90210
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* Change the value of <code>TARGET_IP</code> to the target system's IP address.
+
* Open the global.properties file with a text editor such as vi.
This can be found using the following command from a shell on the target system:
+
 
<syntaxhighlight lang="bash">
+
* The global.properties parameters are shown in Table 1 below.
root@emac-oe:~# /sbin/ifconfig eth0 | grep inet
+
 
</syntaxhighlight>
+
{| class="wikitable"
 +
|-
 +
! Configuration variable !! Description
 +
|-
 +
| SDKBASE|| The base directory for the SDK.
 +
|-
 +
| CC, CXX || Exectuable binaries to use for compiling for the C and C++ compiler, respectively.
 +
|-
 +
| LD_LIBRARY_PATH || The path the linker should use to search for shared library files.
 +
|-
 +
| CFLAGS || The flags passed to the compiler to specify target processor architecture, debugging flags, etc.
 +
|-
 +
| OFLAGS || The flags passed to the compiler to specify optimization options to use.
 +
|-
 +
| TARGET_IP || The IP Address of the target machine (needed for uploading the compiled binary to the target machine).
 +
|-
 +
| LOGIN || The user name to use for logging into the target machine.
 +
|-
 +
| PASSWORD || The password to use for logging into the target machine.*
 +
|-
 +
| WPUT ||  The location of the <code>wput</code> command, along with options to pass to <code>wput</code>.
 +
|}
 +
 
 +
 
 
For more information on how to connect to the remote system, see the [[ EMAC_OE_Getting_Started_Guide#Initial_Connections | initial connections ]] of the [[EMAC OE Getting Started Guide]].
 
For more information on how to connect to the remote system, see the [[ EMAC_OE_Getting_Started_Guide#Initial_Connections | initial connections ]] of the [[EMAC OE Getting Started Guide]].
  
* Change the value of <code>PASSWORD</code> to whatever value was set in the [[ EMAC_OE_Getting_Started_Guide#System_Login | system login ]] of the [[EMAC OE Getting Started Guide]]. Listing 1 shows the default user name and password.
 
 
</cl>
 
</cl>
 +
 +
{{mbox | type = warning | text = The password is stored in plain text in this file. If development is taking place in a shared environment (such as a University lab) and secrecy of this password is required, simply ensure that only trusted users have read permission for this file. See Linux manual pages documentation for the chmod, chgrp, and chown commands. The user building the software will need read access to any file associated with the build.}}
 +
 +
==See Also==
 +
 +
* [[EMAC OE Getting Started Guide]]
 +
* [[Installing EMAC OE 4.0 SDK]]
  
 
[[Category:EMAC OE SDK]]
 
[[Category:EMAC OE SDK]]

Revision as of 18:56, 16 October 2013

TODO: {{#todo:Fix and finish|Michael Gloff|oe 4,Revise, mg}}

SDK Configuration Script

Before compiling source code on the development machine for the target machine, the toolchain libraries for the target machine must be specified.

  1. Open a terminal window

  2. Navigate to the SDK directory.

    developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/
    
  3. Run the script using the command shown below to produce a menu as shown in Figure 1.

    developer@ldc:~$ ./setmachine.sh
    
  4. Select the appropriate target machine type


Emac oe sdk setup-2.png

Remote Upload Set-up

The global.properties file contains the fields necessary to contact and connect to the target board as well as the architecture specific build paths.

  1. Obtain the target machine's current IP address by issuing the following command from a shell on the target system:

    root@emac-oe:~# /sbin/ifconfig eth0 | grep inet
    
  2. Navigate to the projects directory within the SDK.

    developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/projects
    
  3. Open the global.properties file with a text editor such as vi.

  4. The global.properties parameters are shown in Table 1 below.

    Configuration variable Description
    SDKBASE The base directory for the SDK.
    CC, CXX Exectuable binaries to use for compiling for the C and C++ compiler, respectively.
    LD_LIBRARY_PATH The path the linker should use to search for shared library files.
    CFLAGS The flags passed to the compiler to specify target processor architecture, debugging flags, etc.
    OFLAGS The flags passed to the compiler to specify optimization options to use.
    TARGET_IP The IP Address of the target machine (needed for uploading the compiled binary to the target machine).
    LOGIN The user name to use for logging into the target machine.
    PASSWORD The password to use for logging into the target machine.*
    WPUT The location of the wput command, along with options to pass to wput.


    For more information on how to connect to the remote system, see the initial connections of the EMAC OE Getting Started Guide.


See Also