Chinaunix首页 | 论坛 | 博客
  • 博客访问: 806637
  • 博文数量: 281
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2770
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-02 19:45
个人简介

邮箱:zhuimengcanyang@163.com 痴爱嵌入式技术的蜗牛

文章分类
文章存档

2020年(1)

2018年(1)

2017年(56)

2016年(72)

2015年(151)

分类: LINUX

2017-03-02 16:10:28

驱动开发搭建环境:

1. 串口打印环境(secureCRT 或者其他 工具,SSH传输功能)
    uboot启动内核打印信息。    
2. NFS或者TFTP功能,可以下载内核,进行调试
3. 搭建NFS文件系统,可以远程访问主机端文件,方便调试驱动
=========================================================


主要知识点:
1. 如何开机启动
2. 查看uboot环境参数,看内核启动信息
3. 配置开发板ip地址
4. 配置NFS,可以远程访问主机的工作目录,方便调试驱动。
------------------------------------------------------------



=================
0. 启动环境搭建:
    a. 串口连接
    b. 从nand启动,要短接J4
    c. 插上网线(不是必须的),可以看看能否ping通开发主机

==========================
1. 环境变量设置:真够多的。
bootcmd=run nand_boot
bootdelay=0
baudrate=115200
ipaddr=192.168.12.62
serverip=192.168.12.61
netmask=255.255.255.0
bootfile="uImage"
loadaddr=0x41600000
kernel=uImage
kernelsize=0x300000
rootfs=rootfs.ubifs
kerneladdr=0x00200000
nfsroot=/home/notroot/nfs/rootfs
bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp fec_mac=${ethaddr}
bootcmd_net=run bootargs_nfs; dhcp; bootm
bootcmd_mmc=run bootargs_mmc; mmc read 0 ${loadaddr} 100 3000; bootm
bootargs_nand=gpmi=g console=ttyAM0,115200n8 console=tty0 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs ip=192.168.12.180:192.168.12.48:192.68.12.1:255.255.255.0::eht0: fec_mac= ethact
                        bootargs_mmc=gpmi=g console=ttyAM0,115200n8 console=tty0 root=/dev/mmcblk0p3 rw ip=192.168.12.180:192.168.12.48:192.68.12.1:255.255.255.0::eht0: fec_mac= ethact console=tty0 root=/dev/mmcblk0p3 rw ip=192.168.12.180:192.168.12.48:192.168.12.1:255.255.255.0::eht0: fec_mac= console=tty0  
bootargs=gpmi=g console=ttyAM0,115200n8  ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs fec_mac= ethact mem=64M
kernel=uImage
upuboot=tftp $(loadaddr) $(serverip):imx28_ivt_uboot.sb;nand erase 0x0 0x100000; nand write $(loadaddr) 0x0 0x100000
upkernel=tftp $(loadaddr) $(serverip):$(kernel);nand erase  $(kerneladdr) $(kernelsize);nand write $(loadaddr) $(kerneladdr) $(kernelsize);
setenv kernelsize $(filesize); saveenv
uprootfs=mtdparts default;nand erase rootfs;ubi part rootfs;ubi create  rootfs;tftp $(loadaddr) $(rootfs);ubi write $(loadaddr) rootfs $(filesize)
tftp_boot=tftp $(loadaddr) $(serverip):uImage; bootm;

nand_boot=nand read.jffs2 $(loadaddr) $(kerneladdr) $(kernelsize);bootm $(loadaddr)
// nand_boot=nand read.jffs2 0x41600000 0x00200000 0x300000; bootm 0x41600000

setnandboot=setenv bootcmd 'run  nand_boot';saveenv
settftpboot=setenv bootcmd 'run  tftp_boot';saveenv
upsystem=run upkernel;run uprootfs;reset
ethaddr=02:00:92:b3:c4:a8
mem=64M
stdin=serial
stdout=serial
stderr=serial
ethact=FEC0
ver=U-Boot 2009.08 (10??? 14 2014 - 17:17:04)

UBOOT支持的命令:
MX28 U-Boot > help
?       - alias for 'help'
autoscr - DEPRECATED - use "source" command instead
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - mmcinfo -- display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
mxs_mmc - MXS specific MMC sub system
nand    - NAND sub-system
nboot   - boot from NAND device
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
version - print monitor version

2. 内核启动打印信息,也够多的。
MX28 U-Boot > nand read.jffs2 0x41600000 0x00200000 0x300000
NAND read: device 0 offset 0x200000, size 0x300000
 3145728 bytes read: OK
MX28 U-Boot > bootm 41600000
## Booting kernel from Legacy Image at 41600000 ...
   Image Name:   Linux-2.6.35.3-571-gcca29a0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2518660 Bytes =  2.4 MB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.35.3-571-gcca29a0 (zhangzhanwei@zlgmcu) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #1 PREEMPT Tue Oct 14 17:47:39 CST 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Freescale MX28EVK board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256

// uboot启动参数打印
Kernel command line: gpmi=g console=ttyAM0,115200n8  ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs fec_mac= ethact mem=64M

PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

// 内存大小
Memory: 64MB = 64MB total

Memory: 59452k/59452k available, 6084k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xfde00000 - 0xffe00000   (  32 MB)
    vmalloc : 0xc4800000 - 0xf0000000   ( 696 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0030000   ( 160 kB)
      .text : 0xc0030000 - 0xc04dd000   (4788 kB)
      .data : 0xc04de000 - 0xc051aaa0   ( 243 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:288
Console: colour dummy device 80x30
console [ttyAM0] enabled
Calibrating delay loop... 226.09 BogoMIPS (lpj=1130496)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
regulator: vddd: 800 <--> 1575 mV at 1500 mV fast normal
regulator: vdddbo: 800 <--> 1575 mV fast normal
regulator: vdda: 1500 <--> 2275 mV at 1800 mV fast normal
vddio = 3380000, val=10
regulator: vddio: 2880 <--> 3680 mV at 3380 mV fast normal
regulator: overall_current: fast normal
regulator: vbus5v:
regulator: mxs-duart-1: fast normal
regulator: mxs-bl-1: fast normal
regulator: mxs-i2c-1: fast normal
regulator: mmc_ssp-1: fast normal
regulator: mmc_ssp-2: fast normal
regulator: charger-1: fast normal
regulator: power-test-1: fast normal
regulator: cpufreq-1: fast normal
**kernel for EasyARM-i.MX283
i.MX IRAM pool: 124 KB@0xc4820000
Initializing GPMI pins
add device pwm chanel 4
add device pwm chanel 7
usb DR wakeup device is registered
IMX usb wakeup probe
audit: cannot initialize inotify handle
bio: create slab at 0
SCSI subsystem initialized
Freescale USB OTG Driver loaded, $Revision: 1.55 $
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource mxs clock source
Boot process: init
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Bus freq driver module loaded
IMX usb wakeup probe
usb h1 wakeup device is registered
mxs_cpu_init: cpufreq init finished
audit: initializing netlink socket (disabled)
type=2000 audit(0.600:1): initialized
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
JFFS2 version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
msgmni has been set to 116
alg: No test for stdrng (krng)
cryptodev: driver loaded.
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
baclight_device easy283-pwm.4 register succcessed
init_pwm ch 4
baclight_device easy283-pwm.7 register succcessed
init_pwm ch 7
set dclk 8000000 Hz,real lcd clk=8000000 Hz
Console: switching to colour frame buffer device 60x34
set dclk 8000000 Hz,real lcd clk=8000000 Hz
mxs-duart.0: ttyAM0 at MMIO 0x80074000 (irq = 47) is a DebugUART
mxs-auart.0: ttySP0 at MMIO 0x8006a000 (irq = 112) is a mxs-auart.0
Found APPUART 3.1.0
mxs-auart.1: ttySP1 at MMIO 0x8006c000 (irq = 113) is a mxs-auart.1
Found APPUART 3.1.0
mxs-auart.2: ttySP2 at MMIO 0x8006e000 (irq = 114) is a mxs-auart.2
Found APPUART 3.1.0
mxs-auart.3: ttySP3 at MMIO 0x80070000 (irq = 115) is a mxs-auart.3
Found APPUART 3.1.0
mxs-auart.4: ttySP4 at MMIO 0x80072000 (irq = 116) is a mxs-auart.4
Found APPUART 3.1.0
brd: module loaded
loop: module loaded
i.MX GPMI NFC
NFC: Version 1, 8-chip GPMI and BCH
Boot ROM: Version 1, Single-chip boot area, block mark swapping supported

// 检测到NAND
Scanning for NAND Flash chips...
NAND device: Manufacturer ID: 0xc2, Chip ID: 0xf1 (Macronix NAND 128MiB 3,3V 8-bit)
-----------------------------
NAND Flash Device Information
-----------------------------
Manufacturer      : Macronix (0xc2)
Device Code       : 0xf1
Cell Technology   : SLC
Chip Size         : 128 MiB
Pages per Block   : 64
Page Geometry     : 2048+64
ECC Strength      : 4 bits
ECC Size          : 512 B
Data Setup Time   : 5 ns
Data Hold Time    : 5 ns
Address Setup Time: 20 ns
GPMI Sample Delay : 6 ns
tREA              : Unknown
tRLOH             : Unknown
tRHOH             : Unknown
Description       : ZLGFlash
-----------------
Physical Geometry
-----------------
Chip Count             : 1
Page Data Size in Bytes: 2048 (0x800)
Page OOB Size in Bytes : 64
Block Size in Bytes    : 131072 (0x20000)
Block Size in Pages    : 64 (0x40)
Chip Size in Bytes     : 134217728 (0x8000000)
Chip Size in Pages     : 65536 (0x10000)
Chip Size in Blocks    : 1024 (0x400)
Medium Size in Bytes   : 134217728 (0x8000000)
------------
NFC Geometry
------------
ECC Algorithm          : BCH
ECC Strength           : 8
Page Size in Bytes     : 2112
Metadata Size in Bytes : 10
ECC Chunk Size in Bytes: 512
ECC Chunk Count        : 4
Payload Size in Bytes  : 2048
Auxiliary Size in Bytes: 16
Auxiliary Status Offset: 12
Block Mark Byte Offset : 1999
Block Mark Bit Offset  : 0
-----------------
Boot ROM Geometry
-----------------
Boot Area Count            : 1
Boot Area Size in Bytes    : 20971520 (0x1400000)
Stride Size in Pages       : 64
Search Area Stride Exponent: 2
Scanning device for bad blocks
Bad eraseblock 317 at 0x0000027a0000
Bad eraseblock 605 at 0x000004ba0000
Boot area protection is enabled.

// NAND分区信息
Creating 2 MTD partitions on "gpmi-nfc-main":
0x000000000000-0x000001400000 : "gpmi-nfc-0-boot"
0x000001400000-0x000008000000 : "gpmi-nfc-general-use"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "gpmi-nfc-general-use"
UBI: MTD device size:            108 MiB
UBI: number of good PEBs:        862
UBI: number of bad PEBs:         2
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             62
UBI: total number of reserved PEBs: 800
UBI: number of PEBs reserved for bad PEB handling: 8
UBI: max/mean erase counter: 2/1
UBI: image sequence number: 0
UBI: background thread "ubi_bgt0d" started, PID 1033
 ubiblka: unknown partition table
mxs-spi mxs-spi.0: Max possible speed 24000 = 24000000/2 kHz
mxs-spi mxs-spi.0: at 0x80016000 mapped to 0xF0016000, irq=85, bus 1, PIO ver_major 4
Freescale FlexCAN Driver
FEC Ethernet Driver
fec_enet_mii_bus: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci: irq 93, io base 0x80080000
fsl-ehci fsl-ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 2
fsl-ehci fsl-ehci.0: irq 92, io base 0x80090000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
ARC USBOTG Device Controller driver (1 August 2005)
input: MXS touchscreen as /devices/virtual/input/input0
MXS RTC driver v1.0 hardware v2.3.0
mxs-rtc mxs-rtc.0: rtc core: registered mxs-rtc as rtc0
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
Linux video capture interface: v2.00
mxs-pxp mxs-pxp.0: initialized
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
mxs watchdog: initialized, heartbeat 19 sec
cpuidle: using governor ladder
cpuidle: using governor menu
mxs-mmc: MXS SSP Controller MMC Interface driver
__mxs_reset_block(f0010000): timeout when resetting
mxs-mmc mxs-mmc.0: mmc0: MXS SSP MMC DMAIRQ 82 ERRIRQ 96
dcp dcp.0: DCP crypto enabled.!
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
lib80211: common routines for IEEE802.11 drivers
mxs-rtc mxs-rtc.0: setting system clock to 1970-01-01 00:10:01 UTC (601)
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   98787328 bytes (96472 KiB, 94 MiB, 778 LEBs)
UBIFS: journal size:       4952064 bytes (4836 KiB, 4 MiB, 39 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  4665969 bytes (4556 KiB)

// 挂接ubi文件系统
VFS: Mounted root (ubifs filesystem) on device 0:14.
Freeing init memory: 160K
starting pid 1137, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
/
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
Setting the hostname to EasyARM-iMX283
Mounting filesystems
start 283 test

// 执行初始化进程/etc/rc.d/rc_gpu.S
starting pid 1201, tty '': '/etc/rc.d/rc_gpu.S'
starting pid 1207, tty '': '/sbin/getty -L ttyAM0 115200 vt100'

arm-none-linux-gnueabi-gcc (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) 4.6.2 20110630 (prerelease)
root filesystem built on Tue, 05 Feb 2013 11:11:58 +0800
Freescale Semiconductor, Inc.

// 加载触摸屏驱动
EasyARM-iMX283 login: /dev/input/event0 may be touch screen
open /dev/input/event1 No such device
open /dev/input/event2 No such device
open /dev/input/event3 No such device
[QWS_MOUSE_PROTO=Tslib:/dev/input/event0]
[QWS_KEYBOARD=]
xres 480, yres 272, width -1, height -1, 16bpp
set width -1, height -1
Boot process: boot process end!
// 到这里,启动结束

arm-none-linux-gnueabi-gcc (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) 4.6.2 20110630 (prerelease)
root filesystem built on Tue, 05 Feb 2013 11:11:58 +0800
Freescale Semiconductor, Inc.

// 输入用户名和密码登录系统,都是"root"
EasyARM-iMX283 login:


EasyARM-iMX283 login: root
Password:
login[2145]: root login on 'ttyAM0'

// 启动busybox的shell
BusyBox v1.20.2 () built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@EasyARM-iMX283 ~#
root@EasyARM-iMX283 ~# ls
Settings           g_file_storage.ko  qt_hellow          usb_storage_up
bcmdhd.ko          hello              qt_hellow_zh
beep.ko            i2c_ds2460_test    start_qt
beep_test          lradc.ko           up_wifi_module
root@EasyARM-iMX283 ~# cd /
root@EasyARM-iMX283 /# ls
Settings  etc       media     proc      sys       usr
bin       home      mnt       root      system    var
dev       lib       opt       sbin      tmp
root@EasyARM-iMX283 /#



3. 网卡配置:
root@EasyARM-iMX283 ~# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          
          
输入命令:ifconfig eth0 192.168.1.17

root@EasyARM-iMX283 ~# ifconfig eth0 192.168.1.17
eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:05, irq=-1)
root@EasyARM-iMX283 ~# ifcPHY: 0:05 - Link is Up - 100/Full
ifconfig
eth0      Link encap:Ethernet  HWaddr 02:00:92:B3:C4:A8  
          inet addr:192.168.1.17  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Base address:0x8000

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          
4. NFS挂接主机上的目录,进行文件的共享,方便测试驱动等。
    其中Linux开发主机(也就是虚拟机)的IP地址为:192.168.1.20, 这里用的ZLG配置好的主机
    输入命令:
        mount -t nfs -o nolock,vers=2 192.168.1.20:/nfsroot /mnt

4.1 先ping一下主机,看能否ping通
    root@EasyARM-iMX283 /# ping 192.168.1.20
    PING 192.168.1.20 (192.168.1.20): 56 data bytes
    64 bytes from 192.168.1.20: seq=0 ttl=64 time=5.156 ms
    64 bytes from 192.168.1.20: seq=1 ttl=64 time=1.031 ms


4.2 在输入命令,进行挂接
    mount -t nfs -o nolock,vers=2 192.168.1.20:/nfsroot /mnt

    root@EasyARM-iMX283 /# mount -t nfs -o nolock,vers=2 192.168.1.20:/nfsroot /mnt
    root@EasyARM-iMX283 /# cd /mnt
    root@EasyARM-iMX283 /mnt# ls
    hellow    hellow.c
    root@EasyARM-iMX283 /mnt#
    

    
5. 调试驱动程序
利用TFTP下载内核到SDRAM中:
    tftp 41600000 uImage; bootm 41600000  

IP地址设置:
linux开发主机的IP地址:192.168.1.20
windows宿主机的IP地址:192.168.1.100
开发板的IP地址为:     192.168.1.17

NFS方式下载内核:更加方便
    
    nfs 41600000 192.168.1.20:/nfsroot/uImage_noled; bootm 41600000
    
RTC:
    nfs 41600000 192.168.1.20:/nfsroot/uImage_pcf8563; bootm 41600000

EEPROM:
    nfs 41600000 192.168.1.20:/nfsroot/uImage_eeprom; bootm 41600000
    
SPI:
    nfs 41600000 192.168.1.20:/nfsroot/uImage_spi; bootm 41600000
这里NFS烧写后面有问题:
MX28 U-Boot > nfs 41600000 192.168.1.20:/nfsroot/uImage; bootm 41600000
Using FEC0 device
File transfer via NFS from server 192.168.1.20; our IP address is 192.168.1.17
Filename '/nfsroot/uImage'.
Load address: 0x41600000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ####################################################*** ERROR: Cannot umount
        
记得在我的blog中有这个问题的记录。
参考博客:【UBOOT中nfs烧写出错 T T *** ERROR: Cannot umount

====================
开机QT脚本启动程序:
/etc/rc.d/init.d/start_userapp

阅读(1923) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~