x210 ARM linuxQt4.8写入程序

X210版子

1.登录所配置好的虚拟机 gigi rootroot
**2.**root登录重新设置root密码
sudo passwd root root密码与gigi一样的密码
root账号登录 su root
**3.**startx开启图形用户界面
**4.**ifconfig 有eth0 eth1 lo
5.确认目录 /tftpboot tftp共享目录
/nfs_uplooking
/home/gigi/Desktop 有测试文件
6.清理编译的文件 bulid cleanall
选择交叉编译环境arm
重新生成
可以file 查看生成的arm可执行程序
test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
之前编译成功的linux下的可执行程序
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x539f92af725d3802469574189e1b8fb77fc67c54, not stripped

7.连接secureCRT com口查看输出

8.开机 回车进入uboot

print
set ipaddr 192.168.1.20 //开发板ip设置
set serverip 192.168.1.10//设置serverip
set gatewayip 192.168.1.1 //设置getway
set netmask 255.255.255.0

打错了的话 set 错误 (空)舍业不填就设置取消了这个。
其实在重新摄入正确的也并没有多大关系

print //重新查看数据是否更改
ping 192.168.1.10 插上网线看是否能ping通

!!!!!!打这<<一行>>命令
set bootcmd ‘tftp 30008000 zImage; bootm 30008000’
//bootcmd zImage
// nfsroot 主机ip:/挂载目录
setenv bootargs root=/dev/nfs nfsroot=192.168.1.10:/nfs_uplooking ip=192.168.1.20:192.168.1.10:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC2,115200
//保存
save

9.重启 自动下载。有好多#号
卡到starting kernel 停住内核有问题
最后让按回车继续,就可以了。

根ls进入的linux /nfs_uplooking 目录
写好的程序放到该目录
./test -qws

上边新版本的直接就可以了。
旧版本的更改如下:

替换新版的zImage 在/tftpboot/ 目录下
cp -f ./zImage /tftpboot/
vim /home/gigi/x210bsp/tslib/plugins/input-raw.c

54行 - 63行注释 213行注释

make clean
make
make

10.控制硬件
led 在系统中(串口直接看的)
/sys/devices/platform/x210-led
echo 1 > led1 led1亮
echo 0 > led1 led1灭

LED

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
int fd;
fd = open("/sys/devices/platform/x210-led/led1",O_RDWR);
if(fd < 0)
{
printf("open error");
return -1;
}
write(fd,"1",1)
close(fd);
}

编译
arm-linux-gcc led.c

蜂鸣器
app_buzzer.c

ioctl 是一种特殊的read write操作硬件的时候就用ioctl
文件描述符 命令 命令参数(可无)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值