Configuring EMAC OE 4.0 SDK
|Table 1: Conventions|
||The directory to which the SDK archive will be downloaded.|
||The directory to which the SDK will be extracted.|
||XX - the SDK major version|
YY - the SDK minor version
ZZ - the SDK current revision
|target_program||The program executable created to run on the target device.|
|Prompt and commands to be run on a development machine that will run compliation tasks.|
|Prompt and commands to be run on a target machine.|
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).
global.properties 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:
||The base directory for the SDK .|
||Exectuable binaries to use for compiling for the C and C++ compiler, respectively.|
||The path the linker should use to search for shared library files.|
||The flags passed to the compiler to specify target processor architecture, debugging flags, etc.|
||The flags passed to the compiler to specify optimization options to use.|
||The IP Address of the target machine (needed for uploading the compiled binary to the target machine).|
||The user name to use for logging into the target machine.|
||The password to use for logging into the target machine.*|
||The location of the |
*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.
|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, |
global.properties 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.
|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 |
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
global.propertiesto an architecture-specific
global.propertiesfile must be run.
TARGET_IPvariable in the global.properties file must be changed to the IP address or hostname belonging to the target board.
|These configurations assume that the Installing_EMAC_OE_SDK is installed.|
SDK Set Up Script
Before compiling source code for the target machine, toolchain libraries for the target machine must be specified by running
Navigate to the SDK directory.
developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/
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.
Remote Upload Set-up
global.properties file there is a variable,
IP 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,
'upload' will work as expected.
Navigate to the projects directory within the SDK.
developer@ldc:~$ cd /path/to/sdk/EMAC-OE-arm-linux-gnueabi-SDK_XX.YY/projects
global.propertiesfile should be listed in the current directory. The relevant lines from
global.propertiesare shown in Listing 1 below. Listing 1.
TARGET_IP= LOGIN=root PASSWORD=emac_inc_90210
Change the value of
TARGET_IPto the target system's IP address. This can be found using the following command from a shell on the target system:
root@emac-oe:~# /sbin/ifconfig eth0 | grep inet