JZ2440(精致2440)开发板 和电脑直接连接(不经过路由器)

在启动kernel后,注意这个是在启动kernel后不是在Uboot下,未关闭防火墙,ping电脑无法ping通

# ping 192.168.88.225
PING 192.168.88.225 (192.168.88.225): 56 data bytes
ping: sendto: Network is unreachable

 ping不通是因为我的开发板设置的IP和路由器不在同一网段,并且网关也需要设置对

先查询当前的ip看是不是和路由器同一网段

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:60:6E:33:44:55  
          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:18 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:1440 (1.4 KiB)  TX bytes:0 (0.0 B)
          Interrupt:51 Base address:0xa000 

将开发板设置为和电脑同一网段,并设置默认网关

# ifconfig eth0 192.168.88.158

设置默认网关

# route add default gw 192.168.88.1

查看设置后的IP和默认网关是否正确

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:60:6E:33:44:55  
          inet addr:192.168.88.158  Bcast:192.168.88.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29 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:2336 (2.2 KiB)  TX bytes:0 (0.0 B)
          Interrupt:51 Base address:0xa000 

确保正确后,继续ping电脑

# ping 192.168.88.225
PING 192.168.88.225 (192.168.88.225): 56 data bytes

还是ping不通,根据上一篇博客的经验,开发板ping 不通电脑是防火墙问题,于是尝试关闭防火墙,关闭防火墙后在去ping电脑(关闭防火墙步骤:控制面板-_>系统和安全-->Windows 防火墙-->打开或关闭防火墙-->关闭window防火墙-->确定,注意家庭和公共网络两个地方都关闭)


# ping 192.168.88.225
PING 192.168.88.225 (192.168.88.225): 56 data bytes
64 bytes from 192.168.88.225: seq=0 ttl=128 time=0.883 ms
64 bytes from 192.168.88.225: seq=1 ttl=128 time=0.709 ms
64 bytes from 192.168.88.225: seq=2 ttl=128 time=0.734 ms

ping通了,我又继续做实验,将直连的网线换成交叉网线测试,

# ping 192.168.88.225
PING 192.168.88.225 (192.168.88.225): 56 data bytes
64 bytes from 192.168.88.225: seq=0 ttl=128 time=0.933 ms
64 bytes from 192.168.88.225: seq=1 ttl=128 time=0.705 ms
64 bytes from 192.168.88.225: seq=2 ttl=128 time=0.745 ms

同样可以ping通,说明这是自适应的。

这时候我在uboot下做测试,注意开发板需要和电脑在同一网段,另外就是需要关闭防火墙,(网线可以交叉可以直连)

OpenJTAG> ping 192.168.88.225
ERROR: resetting DM9000 -> not responding
dm9000 i/o: 0x20000000, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
could not establish link
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
host 192.168.88.225 is alive

还是ping通了,虽然可以ping通但不代表这可以用,后面还需要做测试。

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

这里是分割线,昨天(2019.04.27)写到这里,今天(2019.04.28)又继续做测试

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

在已经有uboot的情况下,将开发板设置为NOR启动方式,启动开发板,用secureCRT中的串口连接(不是ssh连接),倒计时前按空格,输入q退出菜单选项,进入uboot设置

OpenJTAG> help tftp       //查看tftp是使用方法

tftpboot [loadAddress] [bootfilename]      //使用为   tftp 下载地址  下载文件名

OpenJTAG> print               //查看环境变量等参数设置

bootcmd=nand read.jffs2 0x30007FC0 kernel; bootm 0x30007FC0

bootdelay=2

baudrate=115200

ethaddr=08:00:3e:26:0a:5b

netmask=255.255.255.0

mtdids=nand0=nandflash0

mtdparts=mtdparts=nandflash0:256k@0(bootloader),128k(params),2m(kernel),-(root)

serverip=192.168.1.102

ipaddr=192.168.1.2

filesize=0

bootargs=noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0

stdin=serial

stdout=serial

stderr=serial

partition=nand0,0

mtddevnum=0

mtddevname=bootloader

 

Environment size: 454/131068 bytes

OpenJTAG>set ipaddr 192.168.88.201                             //设置本机IP

OpenJTAG> set serverip 192.168.88.225                           //设置服务器IP

OpenJTAG> save                                                                       //保存设置参数

Saving Environment to NAND...

Erasing Nand...Writing to Nand... done

连接网线

开启tftpd32.exe客户端,并设置文件夹为F:\视频\韦东山光盘\百问网JZ2440v2主光盘\bin\hardware

注意,这里有个小技巧,就是你开启tftpd32.exe后发现一直找不到你自己的网段的IP,无法选择自己电脑的IP,

并且你看到自己的电脑的网络状态是断开的那种状态,但其实很你不用担心,虽然断开状态,但其实是可以通讯的,

想让tftpd32.exe产生有你电脑IP的tftp服务器,可以这么做,先关闭tftpd32.exe,然后开启你的开发板,用secureCRT连接开发板,在Uboot或者在启动内核后使用ping 192.168.88.225(你自己电脑的IP),这时候你电脑右下角的网络图标开始转圈,这时候开启tftpd32.exe,这样tftpd32.exe就有你电脑的IP了,也就可以开启你电脑IP的远程tftp服务器了

OpenJTAG> tftp 30000000 lcd.bin                                        //将lcd.bin通过tftp下载到开发板的30000000地址

ERROR: resetting DM9000 -> not responding

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.88.225; our IP address is 192.168.88.105

Filename 'lcd.bin'.

Load address: 0x30000000

Loading: checksum bad

checksum bad

checksum bad

checksum bad

checksum bad

checksum bad

####

done

Bytes transferred = 18312 (4788 hex)

OpenJTAG> mtd                                                                        //查看分区信息

device nand0 <nandflash0>, # parts = 4

 #: name                        size            offset          mask_flags

 0: bootloader          0x00040000      0x00000000      0

 1: params              0x00020000      0x00040000      0

 2: kernel              0x00200000      0x00060000      0

 3: root                0x0fda0000      0x00260000      0

 

active partition: nand0,0 - (bootloader) 0x00040000 @ 0x00000000

 

defaults:

mtdids  : nand0=nandflash0

mtdparts: mtdparts=nandflash0:256k@0(bootloader),128k(params),2m(kernel),-(root)

OpenJTAG> nand erase bootloader                                      //擦除bootloader分区

 

NAND erase: device 0 offset 0x0, size 0x40000

Erasing at 0x20000 -- 100% complete.

OK

OpenJTAG> nand write 30000000 bootloader //将刚刚从tftp下载下来的lcd.bin从3000000地址写入bootloader

 

NAND write: device 0 offset 0x0, size 0x40000

 262144 bytes written: OK                                           //提示写入OK

断电,将开发板设置为Nand flash启动,上电,输出打印信息,

OpenJTAG>

##### Test TFT LCD #####

[1] TFT240320 8Bit

[2] TFT240320 16Bit

Enter your selection: 1                                          //输入1或者2选择

Initializing GPIO ports..........

[TFT 64K COLOR(16bpp) LCD TEST]

1. Press any key to draw line

2. Press any key to draw circles

3. Press any key to fill the screem with one color

4. Press any key to fill the screem by temporary palette

5. Press any key to fill the screem by palette

6. Press any key stop the testing

 

##### Test TFT LCD #####

[1] TFT240320 8Bit

[2] TFT240320 16Bit

Enter your selection: 3

 

##### Test TFT LCD #####

[1] TFT240320 8Bit

[2] TFT240320 16Bit

Enter your selection: 1

Initializing GPIO ports..........

[TFT 64K COLOR(16bpp) LCD TEST]

1. Press any key to draw line

2. Press any key to draw circles

3. Press any key to fill the screem with one color

4. Press any key to fill the screem by temporary palette

5. Press any key to fill the screem by palette

6. Press any key stop the testing

测试成功,因此网线和开发板也可以通过直接连接的方式开发,目前测试是成功的,用此方法继续做内核烧录和uboot烧录也都成功了,笔者用的是window7旗舰版系统测试的,不知道直连方式以后有没有什么坑。

另外需要注意的是使用直连方式的话如果是使用的不是JZ2440或者说使用的不是官方提供的uboot.bin和内核需要注意的是网口不管是在Uboot还是什么模式下都需要一直使能网卡,这个卫东山老师做的uboot已经提供这样的支持,因此可行。

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

这里是分割线,今天(2019.05.01)做些补充

经过测试很多功能使用直连方式是可以用的但是会出现

Loading: checksum bad

checksum bad

checksum bad

checksum bad

checksum bad

checksum bad

这样的字眼,并且有时候不稳定,不过目前来看使用上还可以满足目前的开发,但是加个路由器(不必可以上网)使用起来更稳定更好用,可以看我的另外一篇博客,其实就是将电脑-----开发板  改成 电脑——路由器——开发板,同样的,路由器是不可以上网的

https://blog.csdn.net/lxj362343/article/details/89739593

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

参考韦东山老师的博客(应该是韦东山老师,博客排名很靠前)

https://blog.csdn.net/thisway_diy/article/details/88184822

猜你喜欢

转载自blog.csdn.net/lxj362343/article/details/89609036