﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-xiaoguozi's Blog-随笔分类-ARM</title><link>http://www.cppblog.com/guojingjia2006/category/14477.html</link><description>Happy coding</description><language>zh-cn</language><lastBuildDate>Thu, 26 Aug 2010 21:59:00 GMT</lastBuildDate><pubDate>Thu, 26 Aug 2010 21:59:00 GMT</pubDate><ttl>60</ttl><item><title>tq2440板子上的第一个运行程序</title><link>http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123055.html</link><dc:creator>小果子</dc:creator><author>小果子</author><pubDate>Wed, 11 Aug 2010 05:03:00 GMT</pubDate><guid>http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123055.html</guid><wfw:comment>http://www.cppblog.com/guojingjia2006/comments/123055.html</wfw:comment><comments>http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123055.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guojingjia2006/comments/commentRss/123055.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guojingjia2006/services/trackbacks/123055.html</trackback:ping><description><![CDATA[拿到板子3天了，之间看了tq2440的使用手册，和linux下的编译视频,感觉挺好的，于是开始了自己的第一个arm板上的程序,聊天程序<br><br>运行效果：<br><img alt=""  src="http://www.cppblog.com/images/cppblog_com/guojingjia2006/arm.jpg" height="460" width="819"><br><br>左边是tq2440板子的终端，右边是win7下的控制台，arm上的linux作为服务器，win7客户端.自己前几天写的一个windows-linux跨平台的socket终于跑起来了。:)<br><br>下面说下自己从搭建到运行的整个流程：<br>1.先跑裸机程序吧，我就跑了那个test的，nor flash模式下直接把tq2440_test.bin烧写进去，那个bin我没找到，所以自己编译了。裸机程序玩完后，就可以玩linux或wince了。<br>2.完后烧写linux系统，因为tq光盘里附带了embedSky的编译完整的linux bin.所以推荐先用这个，按使用手册来做,烧写在nor模式下进行，完成后，切换到nand 模式，进入系统。<br>3.之后，我不知道怎么在板子的linux上跑自己的程序，完了我看了光盘的linux资源下的linux编译视频，推荐先看这几个，他教你怎么在linux上编译uboot,内核==,编译出来的当然在板子上运行的，所以首先你的搭建好交叉编译环境,embedSky 附带了一个交叉编译器的，可以直接用他的，在linux移植手册中有介绍编译自己的交叉编译器的，先用这个吧。编译好后，配置完系统环境变量，就有了arm-linux-gcc,arm-linux-g++了。<br>4.eclipse下配置编译选项，在项目属性里将gcc,g++,link的command前面加上arm-linux,这样编译出来的程序就能在arm上跑了。<br>5.编译完后，怎么弄到板子上呢。我也比较困惑，因为自己也没弄过，所以还得看手册，现在我知道有两种方式可以，第一个就是开发板上有usb的接口，你将自己编译完的程序弄到usb里，完了将usb挂载到linux的某个目录下，拷贝到运行目录就行了，tq2440的默认的目录是在/sbin下的，第二种就是用nfs方式，先在pc linux端装nfs服务，完了可以用网络方式将pc端的nfs设立的共享文件夹挂载到板子上的linux。之后就可以直接运行了。<br><br>上面就是自己的从完全不懂得到能跑自己的程序的一个流程。努力，继续自己的嵌入式之旅。<br><br><br><img src ="http://www.cppblog.com/guojingjia2006/aggbug/123055.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guojingjia2006/" target="_blank">小果子</a> 2010-08-11 13:03 <a href="http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123055.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>nfs ---  开发板挂载ubuntu 10.04 目录</title><link>http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123031.html</link><dc:creator>小果子</dc:creator><author>小果子</author><pubDate>Wed, 11 Aug 2010 02:16:00 GMT</pubDate><guid>http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123031.html</guid><wfw:comment>http://www.cppblog.com/guojingjia2006/comments/123031.html</wfw:comment><comments>http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123031.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guojingjia2006/comments/commentRss/123031.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guojingjia2006/services/trackbacks/123031.html</trackback:ping><description><![CDATA[<div id="content">
<p>1&nbsp; NFS安装</p>
<p>nfs原理是通过网络，将远程主机共享的文件系统，挂载到本机。<a href="http://www.linuxidc.com/topicnews.aspx?tid=2" title="Ubuntu">Ubuntu</a> 10.04上默认是没有安装NFS服务器的，首先要安装NFS服务程序：</p>
<p>#&nbsp; sudo apt-get install nfs-kernel-server</p>
<p>(安装nfs-kernel-server时，apt会自动安装nfs-common和portmap） 这样，宿主机就相当于NFS Server。<!--iwms_ad_begin--></p>
<table align="center" border="0" width="97%">
    <tbody>
        <tr>
            <td colspan="3">
            <div align="center">
            <script src="http://www.linuxidc.com/system/system60.js" type="text/javascript" language="javaScript"></script>
            </div>
            <br></td>
        </tr>
    </tbody>
</table>
<!--iwms_ad_end-->
<p>2&nbsp;&nbsp; 宿主机NFS的配置</p>
<p>2.1&nbsp; 修改配置文件/etc/exports</p>
<p>在终端下用#&nbsp; vim&nbsp; /etc/exports打开exports文件。</p>
<p>如果你没有配置过这个文件的话此文件应该是空的。在开始部分写入</p>
<p>/home&nbsp;&nbsp; *(rw,sync,no_root_squash)</p>
<p>/home&nbsp; -- 与客户机共享的目录；</p>
<p>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- 表示允许任意用户使用，也可以使用具体IP；</p>
<p>(rw,sync,no_root_squash)&nbsp; -- rw，挂载此目录的客户机对此目录有读写权利；</p>
<p>sync，&#8230;&#8230;；</p>
<p>no_root_squash，挂载此目录的客户机享有主机root的权利；</p>
<p>我是将主机的根目录设置为共享目录&nbsp; /&nbsp; *(rw,sync,no_root_squash)</p>
<p>OK，保存，退出。</p>
<p>修改完成之后输入：#&nbsp; exportfs &#8211;rv来使配置文件生效</p>
<p>2.2&nbsp;&nbsp; 配置宿主机的IP</p>
<p>配置宿主机的IP，在命令行中输入 # ifconfig&nbsp;&nbsp; 来查看本机的IP地址。如果没有设置，可以用命令 # ifconfig eth0
192.168.0.18 来设置IP。其中的IP地址可以根据具体情况来设定。设定完成后在通过ifconfig来再次查看是否已经设定成功。</p>
<p>2.3&nbsp;&nbsp; 启动宿主机NFS服务</p>
<p>安装完NFS服务后就可以通过 #&nbsp; /etc/init.d/nfs-kernel-server
restart（/etc/init.d/nfs-kernel-server
start）来重新开启网络文件系统服务，以便后面的开发板挂载。也可以通过#&nbsp; /etc/init.d/nfs-kernel-server
stop来停止。</p>
<p>3&nbsp;&nbsp; 目标板的挂载操作</p>
<p>给你的目标机上电，目标板上的Linux操作系统起来以后，在PC机上<a href="http://www.linuxidc.com/topicnews.aspx?tid=2" title="Ubuntu">Ubuntu</a>操作系统上打开minicom，通过串口向目标板发送shell命令。</p>
<p>像主机操作一样，首先检查目标板（客户机）的IP是否与宿主机的IP再同一个地址段上，否则用上面用过的命令进行检查和设置本地IP。</p>
<p>设置完IP之后可以ping一下检查网卡、网线是否连接正确。</p>
<p>既在minicom中输入# ping 192.168.0.18&nbsp; （主机IP地址）连接成功会不断的打印信息。</p>
<p>接下来就是在开发板上进行挂载mount</p>
<p><strong><span style="font-size: 100%; color: #ff0000;"><tt><tt class="COMMAND"><font color="#000000"><span style="background-color: #ffffff;">mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.0.121:/<font color="#ff0000">主机nfs目录</font> /<font color="#ff0000">挂载路径</font></span></font></tt></tt></span></strong></p>
<p><strong><span style="font-size: 100%; color: #ff0000;"><tt><tt class="COMMAND"><font color="#000000"><span style="background-color: #ffffff;"><font color="#ff0000"><br></font></span></font></tt></tt></span></strong></p>
<p>其中：后是客户机挂载的共享目录； /mnt是开发板的挂载目录</p>
<p>OK，挂在完成。</p>
<p>通过</p>
<p># cd&nbsp; /mnt</p>
<p># ls</p>
<p>可以发现主机的根目录被挂载进了开发板mnt目录中。</p>
<p>如果你想取消挂在可以使用命令# umount&nbsp; /mnt就可以了。</p>
<p><br></p>
<p>-------------------------------------------</p>
<p><br></p>
<p>nfs:server is not responding,still trying    原因与解决方案</p>
<p><br></p>
<p><strong><span style="font-size: 100%; color: #ff0000;"><tt><tt class="COMMAND"><font color="#000000"><span style="background-color: #ffffff;">mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.0.121:/<font color="#ff0000">主机nfs目录</font> /<font color="#ff0000">挂载路径</font></span></font></tt></tt></span></strong></p>
<p><br>
<strong><span style="font-size: 100%; color: #ff0000;"><tt><tt class="COMMAND"><font color="#000000"><span style="background-color: #ffffff;"></span></font></tt></tt></span></strong></p>
<p><strong><span style="font-size: 100%; color: #ff0000;"><tt><tt class="COMMAND"><font color="#000000"><span style="background-color: #ffffff;"><font color="#ff0000">tcp挂载，不然很可能出现服务不响应，nfs默认是udp传输。。（这个把我郁闷了一天）</font></span></font></tt></tt></span></strong></p>
</div><img src ="http://www.cppblog.com/guojingjia2006/aggbug/123031.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guojingjia2006/" target="_blank">小果子</a> 2010-08-11 10:16 <a href="http://www.cppblog.com/guojingjia2006/archive/2010/08/11/123031.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>系列之----tq2440 板子 的印象</title><link>http://www.cppblog.com/guojingjia2006/archive/2010/08/09/122846.html</link><dc:creator>小果子</dc:creator><author>小果子</author><pubDate>Mon, 09 Aug 2010 13:27:00 GMT</pubDate><guid>http://www.cppblog.com/guojingjia2006/archive/2010/08/09/122846.html</guid><wfw:comment>http://www.cppblog.com/guojingjia2006/comments/122846.html</wfw:comment><comments>http://www.cppblog.com/guojingjia2006/archive/2010/08/09/122846.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guojingjia2006/comments/commentRss/122846.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guojingjia2006/services/trackbacks/122846.html</trackback:ping><description><![CDATA[<table width="100%" border="0">
    <tbody>
        <tr>
            <td>今天刚拿到tq2440的板子，给我的第一印象就是&#8220;小&#8221;，比我想象的小多了，淘宝看那么大的一张照片，拿到手里的是这么小的一个家伙，不过虽然小，还是&#8220;忍忍&#8221;吧。= =,选择买他的原因也是网上关于s3c2440的资料比较多,所以作为学习还是不错的<br></td>
            <td><br></td>
        </tr>
        <tr>
            <td style="vertical-align: top;">拿到板子后，清点了下资料，没什么问题，这里不得不说，资料确实丰富，14张DVD,不过内容怎么样，待定，不过至少使用手册还是不错的。讲的比较详细。所以花了3，4个小时，基本知道大概流程，于是开始玩板子。<br></td>
            <td style="vertical-align: top;"><br></td>
        </tr>
        <tr>
            <td>这里说下自己的一点体会和理解：<br>其实，以前只在实验室玩过的板子，那时还是已经全部弄好，不必自己弄uboot,烧系统，今天这个活的自己干，虽然以前没玩过，不过看了开发手册后，大概也明白了整个过程。<br>大致说下自己的理解：nor flash和nand flash两个存储区，（他们区别网上自己找啊,很多的），nor flash是事先存放了一个uboot(没的话可以有几张方式烧写的，我板子里已经有了，所以次过程跳过),所以事先进入nor flash,载入uboot后，可以控制自己的uboot跟新和nand flash烧写，就怎么简单，完了就可以跑裸机程序了，当然不想跑的话可以直接移植linux或装wince,不过装完以后，如果还想跑裸机程序的，那nand flash烧写的系统必须重新烧写，不过好像有个选项可以控制烧写nand flash 程序载入位置的，不过我也没试过，所以没不确定。所以今天我就把裸机的几个看了下，其中有个TQ2440_TEST的测试程序，自己按步骤操作，编译完以后TQ2440_TEST.bin，通过usb烧写到nand flash中执行，测试的功能有多项，键盘按钮，触摸屏==，所以推荐尝试，其他的几个裸机程序都是在他的基础上修改和完善的，有兴趣的可以试下。= =，不过还是推荐研究下他的源码，花点耐心还是能看懂的。还有就是烧写前装下usb驱动，我win7的，正常，其他的没怎么了，还有就是用usb传输的时候,串口选择小心点，我之前因为用软件虚拟了几个串口，导致烧写不进去，后来删了就正常了。<br><br>先说到这了。只为自己学习留下痕迹。<br></td>
            <td></td>
        </tr>
    </tbody>
</table>
<br><img src ="http://www.cppblog.com/guojingjia2006/aggbug/122846.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guojingjia2006/" target="_blank">小果子</a> 2010-08-09 21:27 <a href="http://www.cppblog.com/guojingjia2006/archive/2010/08/09/122846.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>