您的位置:首页 > 编程语言 > Java开发

在windows环境下,使用Eclipse和gcc-Linaro工具链,对BeagleBone进行交叉编译和远程部署

2015-12-27 14:24 746 查看
from: http://beaglebone.globalmultimedia.in/
该文章详细解释了在windows 7中如何设置 gcc交叉编译器的C/C++工具链和Eclipse IDE,并且展示了怎么与BeagleBone板一起使用。

步骤1:设置Eclipse

下载并解压缩适用于你平台(32位或者64位)的Eclipse;Download Eclipse

Eclipse不需要安装;它可以按照你的意愿,放置在任意的驱动器或者文件夹中。

解锁Eclipse应用,单击以启动Eclipse;将工作区设置到“F:/workspace”中,“F"是驱动器名称;可以选择其它任意的驱动器或者文件夹名称;

在Eclipse启动之后,”Help > Installation Details“后面跟随这展开的树视图,显示了支持的GCC C/C++交叉编译器。

步骤2:设置交叉编译器

交叉编译的工具链可以从后面的链接下载https://releases.linaro.org/latest/components/toolchain/binaries/

从提供的选项列表中选择 "gcc-linaro-arm-linux-gnueabihf-X.X-XXXX.XX_win32.zip";

当写这篇文章的时候,它是:https://releases.linaro.org/latest/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_win32.zip

Linaro Changes 2014-11 Folder 2015-02 Folder

将该内容解压缩到“F:/gcc-linaro/”,F是选择的驱动器。

从以下链接中下载并提取“make.exe";复制到“F:/gcc-linaro/bin"文件夹中。

Download make.exe

从链接 http://softlayer-sng.dl.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-dep.zip 中提取“libiconv2.dll"、"libintl3.dll",并复制到相同的文件夹 “F:/gcc-linaro/bin”中。

现在完成了基本的安装工作。

步骤3:建立一个新的C工程

在Project Explorer窗口上右击,并选择New->C Project

输入该工程名称,例如 ‘Brahma’;

选择Hello World ANSI C Project;

勾选复选框,以便于只显示支持的工具链;

单击 Next;

在Author处输入你的名称 - 例如: ‘Aham Brahmasmi’;

单击 Next;

单击Advance Settings,显示"Properties for Brahma"。

展开“C/C++ Build",选择“Environment”,单击“PATH”并添加“F:/gcc-linaro/bin;...",不要删除其它值。

展开C/C++ 大纲;

选择“Pre-processor Paths, Macros etc.”;

在Providers页,选择“CDT Cross GCC Built-in Compiler Settings”;

You may notice that the project explorer shows the name of the Project with an error mark and the Problems window displays Errors (2 items).

You need not worry about the errors as the settings are yet incomplete. The errors would reset automatically after all the settings are completed.

Keep clicking Move up until it reaches the top, as first option

Click OK (You may also Click Appy prior to this)

Click Next. Notice that any additional configurations can be added later also.

将cross compiler Prefix设置为“arm-linux-gnueabihf-“;注意,末尾的连接符号 ’-’ 是必需的。

Browse and select the bin path where you extracted the linaro Compiler tools and placed GNU make

现在该部分的工作已经完成,所有的错误也都消失了。

步骤4:构建该工程

右击该工程并选择Build Project;

The Project ‘Debug’ Configuration get built producing the binaries.

"Build Configurations > Set Active > Release"

And it's done.

步骤5:在Eclipse上建立远程系统浏览器

选择所有可用的站点,并且等待列表框被填写。

选择“Mobile and Device Development"下面的选项,接受许可协议并安装。

单击Yes按钮并重启Eclipse;

步骤6:连接到远程系统

Allow Access for Eclipse to use the network. After Eclipse Restarts “Window > Show View > Other”

Select Remote System and click ok.

选择Remote System,单击ok。

单击“Define a Remote connection”;

选择“SSH only”并单击Next;

设置该连接并结束;

步骤7:连接

Default IP address “192.168.7.2” of Beglebone Black connected to the Windows System is to be entered in the Editable Combo Box for Host Name.

Expand the Sftp Files Tree and Note "My Home" and "Root"

Expanding My Home brings up Login Window. Default UserID for Beaglebone Black is “root” and leave blank for Password.

步骤8:上载

将“Release”目录下的“Brahma”拖动到“root”(“My Home”)目录下。

步骤9:加载终端

步骤10:检查并执行

在Terminal中输入“dir”,并检查你的可执行文件;在设置完可执行标志后,命令“./Brahma” 将执行该程序。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: