开发板学习摘要

Linux下USB转串口连接Mini2440开发板 

http://www.cnblogs.com/donna/archive/2009/02/08/1386259.html

查看网卡信息:ifconfig eth0/1/2   查看系统有没有按照网卡驱动:dmesg |grep eth0/1/2

ifconfig eth0 192.168.11.13 netmask 255.255.255.0

ifconfig lo 127.0.0.1

route add -net 127.0.0.0 netmask 255.255.255.0 lo 这样就可以ping通127.0.0.1

删除命令:route del -net 192.168.11.0 netmask 255.255.255.0 

加默认网关:route add default gw 192.168.11.1

/etc/profile文件里面写入了自己设定的一些alias,
格式如alias ll="ls -l"之类的。

 linux下mount u盘:

mkdir  /mnt/usb2   mount -t vfat /dev/sdb1 /mnt/usb1

韦东山视频第二期需要密码

将dm9000c arm-linux-gcc-3.4.5-glibc-2.3.6.tar linux-2.6.22.6.tar linux-2.6.22.6_jz2440.patch拷贝到centos,编译内核文件。

设置环境变量 export PATH=“PATH:/root/XXXX” 在/etc/profile加上export PATH="$PATH:/root/embeb/gcc-3.4.5-glibc-2.3.6/bin",/root/.bashrc

check toolchai: arm-linux-gcc -v

centos is 64 bit, how to compile?

yum install glibc.i686 在yum命令后面加入忽略参数:--setopt=protected_multilib=false

Makefile:419: *** mixed implicit and normal rules. Stop means make是3.82的,不识别之前旧的3.81的make可以识别的那个混合语法;

http://ftp.gnu.org/gnu/make/这里可以下载到make各个版本,高版本的make编译过程中出现了好多问题。

在linux原码中make oldconfig/make menuconfig, 然后再make。

down 3.82 to 3.81, download make sourcecode from GNU, then build: ./configure->make check->make->make install

搞了半天还是不行,转虚拟机,使用和教程上一样的环境。

dm9dev9000c.c:1644: error: `IRQ_EINT7' undeclared (first use in this function) 最后#include <asm-arm/arch-s3c2410/irqs.h>里面定义了IRQ_EINT7。

将内核文件拷贝到U盘,插入开发版,然后insmod。

version magic '2.6.22.6 mod_unload ARMv5 ' should be '2.6.22.6 mod' 这里估计要重新编译内核。

以上几步都很关键。之前忘记了cp config_ok .config这一步。

linux-2.6.30.4,我现在用的是2.6.22.6

asm/arch/regs-gpio.h: No such file or directory

asm/hardware.h : No such file or directory

原因, 早期版本的头文件, 该版本已经换地儿了.

解决方法:(这些都没有用到,因为我用的版本就是2.6.22.6)

在主目录下find -name xxxx.h 

比如find -name hardware.h

Linux2.6.30.4/arch/arm/mach-s3c2410/include/mach/hardware.h

这就说明应该包含mach/hardware.h

于是改为

#include <mach/regs-gpio.h>
#include <mach/hardware.h>

问题解决.

重新编译之后,使用uboot的tftp功能烧写kernel:

kernel烧写:

uboot> setenv ipaddr 192.168.11.10 

uboot> setenv serverip 192.168.11.3 

tftp 30000000 uImage 

nand erase kernel
nand write.jffs2 30000000 kernel

fs:
tftp 30000000 fs_qtopia.yaffs2
nand erase root
nand write.yaffs 30000000 260000 2f76b40

目前网卡驱动能顺利加载insmod *.ko,但是ping不通。

如何打patch:patch -pX < .patch,x表示拿掉几个斜线/的意思,也就是在第几层打patch

how to check lib version: rpm -qi glibc yum list | grep glibc.

 

第二天:

现在将源文件中的debug打开,看输出log来定位问题。

lsmod可以查看加载了哪些模块

后来使用ifconfig eth1 up,而不是eth0,出现ifconfig: SIOCSIFFLAGS: Resource temporarily unavailable

root cause:这块板子我们应该配置eth1,而不是eth0,如果之前配置过eth0,那么需要先ifconfig eth0 down,然后再ifconfig eth1 up。

 

下一步就是要让开发版能共享U盘,也就是说在局域网内的其他设备比如电脑 手机 平板能访问到U盘,可以在开发版上设置http server,然后再其他设备上通过浏览器访问。

首先将u pan开机时挂载好:

if [ -e "/dev/sda1" ]; then
  echo "OK, sda1"
  mount /dev/sda1 /mnt/upan
elif [ -e "/dev/sdb1" ]; then
  echo "OK, sdb1"
  mount /dev/sdb1 /mnt/upan
fi

第一种方法用tftp来实现:但是开发板的文件系统非常简单,都不能使用apt-get。

第二种方法使用vstftpd。

第三种方法使用samba,先实现linux和windows之前文件共享,但是 面临一个问题,就是将samba移植到嵌入式开发板中,可能有一些交叉编译的配置文件要改。

编译samba顺序:./autogen.sh生成configure,然后run ./configure and make。samba的版本是3.0.6

arm-linux-gcc -v查看交叉编译器版本

运行./configure --host=arm-linux --without-syslog时出现

checking that the C compiler understands -Werror... ./configure: line 4346: syntax error near unexpected token ';' 解决方法是将类似的两个分好注释掉。

然后又出现cannot run test program while cross compiling,后来使用./configure --host=i686 --target=arm-linux问题解决了。

使用make CC=arm-hisi-linux-gcc LD=arm-hisi-linux-gcc时出现in file included from dynconfig.c:21: include /includes.h:455:31:valgrind/memcheck.h: no such file or directory

./configure --host=i686 --target=arm-linux有问题,

--target only applies when you are compiling toolchains. When you are doing normal cross-compilation of a library or binary you use

--build=the architecture of the build machine
--host=the architecture that you want the file to run on

所以应该是./configure --host=arm-linux

转载于:https://www.cnblogs.com/qiaolong/p/4837712.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值