(韦)dnw无法使用,uboot+ 通过tftp ,nfs 下载之nand flash

来源:互联网 发布:搜狗输入法云计算代理 编辑:程序博客网 时间:2024/05/16 08:47
片内SRAM运行程序:
原理:通过nor flash 启动开发板后 +dnw 下载程序到nand flash 然后开发板重启,nand flash启动 观察效果

部分电脑dnw不能运行,不过还可以通过tftp nfs 来下载 不过原理一样 都是先下之内存,然后写之nand flash (聪明的你,还会发现dnw usb下载有个内存地址可设置)
说明:
linux        192.168.1.200
win          192.168.1.100
mini2440   192.168.1.201

通过tftp方式(网线插上)
首先linux  [root@localhost ti]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0B:B7:52  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0b:b752/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3685728 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5538158 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1126873419 (1.0 GiB)  TX bytes:4264312441 (3.9 GiB)
          Interrupt:193 Base address:0x2024 
我借助linux的tftp服务器(windows上的也可以的)
开启tftp服务后:
[root@localhost ti]# netstat -a |grep tftp
udp        0      0 *:tftp                      *:*        
我已将裸机例子的gpio的leds.bin cp 之tftp服务的目录下

[root@localhost leds]# ls /tftpboot/leds.bin -l
-rwxr-xr-x 1 root root 136 10-24 21:38 /tftpboot/leds.bin

开发板启动后uboot界面:

##### 100ask Bootloader for OpenJTAG #####
[n] Download u-boot to Nand Flash
[o] Download u-boot to Nor Flash
[k] Download Linux kernel uImage
[j] Download root_jffs2 image
[y] Download root_yaffs image
[d] Download to SDRAM & Run
[z] Download zImage into RAM
[g] Boot linux from RAM
[f] Format the Nand Flash
[s] Set the boot parameters
[b] Boot the system
[r] Reboot u-boot
[q] Quit from menu
Enter your selection: 
按q进入

Environment size: 317/131068 bytes
OpenJTAG> setenv serverip 192.168.1.200
OpenJTAG> setenv ipaddr 192.168.1.201
OpenJTAG> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
OpenJTAG> ping 192.168.1.200
dm9000 i/o: 0x20000000, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
could not establish link
host 192.168.1.200 is alive
已通(别网线没插,一直在ping)

OpenJTAG> tftp 30000000 leds.bin
dm9000 i/o: 0x20000000, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
could not establish link
TFTP from server 192.168.1.200; our IP address is 192.168.1.201
Filename 'leds.bin'.
Load address: 0x30000000
Loading: #
done
Bytes transferred = 136 (88 hex)
下载完毕,(别tftp服务没开启,一直在下载)

OpenJTAG> nand write 30000000 0 40000
 
NAND write: device 0 offset 0x0, size 0x40000
 262144 bytes written: OK

写nand flash

开发板重启,nand flash启动

2 nfs方式 
开启nfs服务
[root@localhost speaker_on]# netstat -a |grep nfs
tcp        0      0 *:nfs                       *:*                         LISTEN      
udp        0      0 *:nfs                       *:*                               
nfs 配置

   more /etc/exports                          

/                       *(rw,sync,no_root_squash)


uboot启动后
OpenJTAG> nfs 30000000 192.168.1.200:/speaker_on.bin
下载之内存,后面就跟tftp一样了





原创粉丝点击