2019独角兽企业重金招聘Python工程师标准>>>

搞了一整天的U-boot,现在终于可以使用tftp下载内核镜像了,现在终于成功了,呵呵!先前在移植网卡驱动的时候可以在U-boot中PING通我的主机,没有任何问题,可就是使用tftp服务不能下载,通过在网上搜索,也没有找到一个很好的解决方案。网上说的首先要配置好tftp服务器,我的Ubuntu操作系统,通过安装tftp服务,并经过测试,没有问题了。主机上的防火墙也已经关闭。有时,小点的文件可以成功的下载,而大点的文件就会出现下面的错误。

[U-Boot@mini2440]#tftp 30008000 u-boot.bin 
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode 
MAC: 08:00:3e:26:0a:5b 
operating at 100M full duplex mode 
Using dm9000 device 
TFTP from server 10.27.10.48; our IP address is 10.27.10.23 
Filename 'u-boot.bin'. 
Load address: 0x30008000 
Loading: T T T T #T T T T T T T ##T T T T T T T T T T T ##T T T T T #T T T T ###
done 
Bytes transferred = 154764 (25c8c hex) //文件不到200KB还是出现断断续续的 
[U-Boot@mini2440]#tftp 30008000 zImage  //文件达到2MB就没有出现成功过
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode 
MAC: 08:00:3e:26:0a:5b 
operating at 100M full duplex mode 
Using dm9000 device 
TFTP from server 10.27.10.48; our IP address is 10.27.10.23 
Filename 'zImage'. 
Load address: 0x30008000 
Loading: T T T T T T T T T T T T T T #T T T T T T T T T T T T ##T T T T T T T T#
         ###T T #T T T T T 
Retry count exceeded; starting again 
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode 
MAC: 08:00:3e:26:0a:5b 
operating at 100M full duplex mode 
Using dm9000 device 
TFTP from server 10.27.10.48; our IP address is 10.27.10.23 
Filename 'zImage'. 
Load address: 0x30008000 
Loading: T T T T T T T T T T #T T T T T T T T T #T T T T T T T T #T T T T T T ##
         ###T #T T T T T T T T #T #T #######T ###T ##T ###T ##T ###T T T ##T ###
         ###T T #T T T T T T ##T T ##T T ###T ## 
Retry count exceeded; starting again 
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode 
MAC: 08:00:3e:26:0a:5b 
operating at 100M full duplex mode 
Using dm9000 device 
TFTP from server 10.27.10.48; our IP address is 10.27.10.23 
Filename 'zImage'. 
Load address: 0x30008000 
Loading: T T T T T #T T T T T T T T #T T T T T T T T T T T T #T T T T T T T T T#
         ####T T T T #T T T T T T T ###T ##T ###T ##T T ###T #####T T T ##T T ##
         ##T T #T T T T T T T T T #####T T ##T ##T ##T T ###T ##T T ###T ##T T 
         T T ##T 
Retry count exceeded; starting again 
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode 
MAC: 08:00:3e:26:0a:5b 
operating at 100M full duplex mode 
Using dm9000 device 
TFTP from server 10.27.10.48; our IP address is 10.27.10.23 
Filename 'zImage'. 
Load address: 0x30008000 
Loading: T T T T T #T T T T T T T T T T T ###T T T T T T T T T ##T T T  T #
   ####T T T T T T ##T T T T ###T ##T T T ##T ####T ##T #T ###T ###T ##T #
  ##T ##T T T T T T #T T T T ##T T ###T ##T ###T ###T ##T T ##T T ##T T ### 
Retry count exceeded; starting again //会一直循环下去,无休无止的

从网上不断的搜索,还有的说是lowlevel_init.S文件中的BANK没有设置对,不过我也检查一下我的BANK的设置,我的DM9000在BANK4上面,下面是我的lowlevel_init.S文件的部分配置,位宽是16Bit的。

#define BWSCON    0x48000000
/* BWSCON */
#define DW8            (0x0)
#define DW16            (0x1)
#define DW32            (0x2)
#define WAIT            (0x1<<2)
#define UBLB            (0x1<<3)

#define B1_BWSCON        (DW32)
#define B2_BWSCON        (DW16)
//#define B3_BWSCON        (DW16 + WAIT + UBLB)
#define B3_BWSCON        (DW16+UBLB)
#define B4_BWSCON        (DW16 + UBLB)
#define B5_BWSCON        (DW16)
#define B6_BWSCON        (DW32)
#define B7_BWSCON        (DW32)

再次修改了修改drivers/net/dm9000x.c文件中phy_read()函数和phy_write函数

phy_write(int reg, u16 value)

    int i;
    /* Fill the phyxcer register into REG_0C */
    DM9000_iow(DM9000_EPAR, DM9000_PHY | reg);

/* Fill the written data into REG_0D & REG_0E */
    DM9000_iow(DM9000_EPDRL, (value & 0xff));
    DM9000_iow(DM9000_EPDRH, ((value >> 8) & 0xff));
    DM9000_iow(DM9000_EPCR, 0xa);    /* Issue phyxcer write command */
    //udelay(500);            /* Wait write complete */

i=0;
    while(DM9000_ior(DM9000_EPCR) & 0x01)
    {
        udelay(100);
        i++;                //替换 udelay(500)
        if(i==1000)
        {
            printf("DM9000 access error\n");
            return 0;
        }
    }
    DM9000_iow(DM9000_EPCR, 0x0);    /* Clear phyxcer write command */
    DM9000_DBG("phy_write(reg:0x%x, value:0x%x)\n", reg, value);
}

static u16
phy_read(int reg)
{
    u16 val;
         int i;
    /* Fill the phyxcer register into REG_0C */
    DM9000_iow(DM9000_EPAR, DM9000_PHY | reg);
    DM9000_iow(DM9000_EPCR, 0xc);    /* Issue phyxcer read command */ i=0;
    //udelay(100);            /* Wait read complete */

while(DM9000_ior(DM9000_EPCR) & 0x01)
    {
        udelay(100);
        i++;                //替换udelay(100)
        if(i==1000)
            {
                printf("DM9000 access error\n");
                return 0;
            }
    }
    DM9000_iow(DM9000_EPCR, 0x0);    /* Clear phyxcer read command */
    val = (DM9000_ior(DM9000_EPDRH) << 8) | DM9000_ior(DM9000_EPDRL);

/* The read data keeps on REG_0D & REG_0E */
    DM9000_DBG("phy_read(0x%x): 0x%x\n", reg, val);
    return val;
}

注释掉dm9000_halt 的函数体

static void dm9000_halt(struct eth_device *netdev)
{
    //DM9000_DBG("%s\n", __func__);

/* RESET devie */
    //phy_write(0, 0x8000);    /* PHY RESET */

//DM9000_iow(DM9000_GPR, 0x01);    /* Power-Down PHY */

//DM9000_iow(DM9000_IMR, 0x80);    /* Disable all interrupt */

//DM9000_iow(DM9000_RCR, 0x00);    /* Disable RX */

}

还要继续修改,修改文件/net/net.c中的内容
在104行附近

//# define ARP_TIMEOUT        5000UL    /* Milliseconds before trying ARP again */
将上面的一句替换成下面这句
# define ARP_TIMEOUT        (CONFIG_SYS_HZ/1000*5000UL)

在573行附近

#ifndef CONFIG_NET_MULTI
    //NetSetTimeout (10000UL, startAgainTimeout);
将上面的一句替换成下面这句
    NetSetTimeout (10000UL*CONFIG_SYS_HZ/1000, startAgainTimeout);
    NetSetHandler (startAgainHandler);

在585行附近

if (NetDevExists && !once) {
            //NetSetTimeout (10000UL, startAgainTimeout);
将上面的一句替换成下面这句
            NetSetTimeout (10000UL*CONFIG_SYS_HZ/1000, startAgainTimeout);

在757行附近

//NetSetTimeout (10000UL, PingTimeout);
将上面的一句替换成下面这句
    NetSetTimeout (10000UL*CONFIG_SYS_HZ/1000, PingTimeout);

在781行附近

//#define CDP_TIMEOUT            250UL    /* one packet every 250ms */
将上面的一句替换成下面这句
#define CDP_TIMEOUT            (250UL*CONFIG_SYS_HZ/1000)

上面这些都改完以后还是不能使用tftp下载。还是会断断续续的。在网上继续搜索,又找到一个地方需要修改的。看的一个网友是这样分析的

一、问题原因分析:

1、下载与我操作系统版本(fedora 10)一致的tftp server源代码tftp-hpa-0.48.tar.bz2,编译通过后,替换系统的tftpd程序,通过在源代码中添加调试信息,发现是由于 Uboot 端 tftp 程序传过来的Timeout参数不符合服务器端定义引起的:

Nov 11 10:46:12 HardWare in.tftpd[18275]: client timeout = 7810 , server timeout = 1-255 tftp客户端传过来的timeout是7810,而服务器端定义的范围在1-255秒之间,不是服务器的问题,而是uboot中tftp参数设置的问题。

继续修改/net/tftp.c文件中的下面这句

#define TIMEOUT   60000UL //5000UL   /* Millisecs to timeout for lost pkt */

一开始改变的太小,改成10000UL,直接把后面的UL去掉还是不行,不过改完这里就真的可以了,我都不敢相信这是真的。不过确实是真的,就是这里TIMEOUT的问题,我的板子是通过交换机和主机相连的。
  TIMEOUT 的值是跟据板子配置文件中的 CONFIG_SYS_HZ 值计算出来的,我的配置文件时从 Uboot目录 include/configs/mini2410.h 复制过来的,值为 1562500,算出来后就等于7810.也就是上面分析的tftp的超时的值。
下面就是成功后的下载界面:

[U-Boot@mini2440]#tftp 30000000 zImage 
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode 
MAC: 08:00:3e:26:0a:5b 
operating at 100M full duplex mode 
Using dm9000 device 
TFTP from server 10.27.10.48; our IP address is 10.27.10.23 
Filename 'zImage'. 
Load address: 0x30000000 
Loading: ################################################################# 
         ################################################################# 
         ################################################################# 
         ################################################################# 
         ################################################################# 
         ################################################################# 
         ################### 
done 
Bytes transferred = 2092932 (1fef84 hex)

转载于:https://my.oschina.net/hanshubo/blog/604597

u-boot移植:解决 Retry count exceeded; starting again相关推荐

  1. Retry count exceeded; starting again 解决方法

    搞了一整天的U-boot,现在终于可以使用tftp下载内核镜像了,现在终于成功了,呵呵!先前在移植网卡驱动的时候可以在U-boot中PING通我的主机,没有任何问题,可就是使用tftp服务不能下载,通 ...

  2. tftp服务器连接开发板下载内核提示:retry count exceeded; starting again

    今天,进Ubuntu连开发板调试程序,不能够连接开发板下载内核了,各种重启也没用,最后百度发现此帖子,一语惊醒梦中人,原来我在windows中把无线网卡禁用了,进入win打开无线功能,再进Ubuntu ...

  3. 电脑开机黑屏提示:ERROR 0199:System Security-Security password retry count exceeded(by 星空武哥)

     电脑开机黑屏提示:ERROR 0199:System Security-Security password retry count exceeded. 昨天有个人来我们的办公室,说电脑有问题.我 ...

  4. 笔记本开机黑屏提示:ERROR 0199:System Security-Security password retry count exceeded

    环境: 电脑:联想E14 系统:Windows 10 专业版 64位 问题描述: 笔记本电脑开机黑屏提示:ERROR 0199:System Security-Security password re ...

  5. uboot网络操作解决:ARPRetry count exceeded; starting again ping failed; host 192.168.86.128 is not alive

    uboot网络操作解决:ARPRetry count exceeded; starting again ping failed; host 192.168.86.128 is not alive 最近 ...

  6. Spring Boot实战解决高并发数据入库: Redis 缓存+MySQL 批量入库

    前言 最近在做阅读类的业务,需要记录用户的PV,UV: 项目状况:前期尝试业务阶段: 特点: 快速实现(不需要做太重,满足初期推广运营即可) 快速投入市场去运营 收集用户的原始数据,三要素: 谁 在什 ...

  7. Spring Boot 2 (七):Spring Boot 如何解决项目启动时初始化资源

    Spring Boot 2 (七):Spring Boot 如何解决项目启动时初始化资源 在项目启动的时候需要做一些初始化的操作,比如初始化线程池,提前加载好加密证书等.今天就给大家介绍一个 Spri ...

  8. Start booting from USB device boot failed 解决办法(老机器问题)

    Start booting from USB device boot failed 解决办法 问题: 一般情况下,我们设置电脑BIOS USB 第一启动方式最重要的两步: 1.Removable De ...

  9. Oracle sqlldr导入之“MAXIMUM ERROR COUNT EXCEEDED”

    昨天看到一个同事在通过PL/SQL Developer工具把文本数据往oracle表;有两个文本:一个有30万条记录:一个7万多条记录. 在导入到过程中:出现错误记录还需要点击确认.不过使用黑科技(屏 ...

最新文章

  1. python连接excel存放数据_有了这篇python操作Excel学习笔记,以后储存数据 办公很轻松!...
  2. 洛谷P1006 传纸条 (棋盘dp)
  3. vue打包后element-ui部分样式(图标)异常问题
  4. 假笨说-我是如何走上JVM这条贼船的
  5. 【机器学习】机器学习处理不均衡分类
  6. swift开发:试玩 Apple 网站的 playground
  7. web linux进程管理,详解Supervisor安装与配置(Linux/Unix进程管理工具)
  8. tomcat 无端口号访问
  9. cms php vue 开源_2020最受欢迎的企业网站CMS建站系统排行榜
  10. URLClassLoader使用方法及事例程序
  11. 2018云+未来峰会圆桌面对面:以网络安全之能,造国之重器
  12. java连接mysql数据库实现图书馆管理系统
  13. 软件工程 - 个人博客系统 - 可行性分析与需求分析文档
  14. 计算机之父ppt,24计算机之父童年的故事.ppt
  15. 有哪些「饥饿营销」的失败案例?
  16. 高翔视觉slam十四讲习题(1)
  17. mac命令行压缩解压rar文件
  18. CTF线下赛AWD攻防准备
  19. 笔记本电脑能连接WiFi但浏览器无法打开网页的解决办法
  20. memory_max_target/memory_target设置过大报ORA-00845错误

热门文章

  1. StringBuider 在什么条件下、如何使用效率更高?
  2. 数据分析师在岗3年小结!
  3. 50万高奖金!2022年第一场赛事来了
  4. 一文梳理2019年腾讯广告算法大赛冠军方案
  5. 万引大佬自曝这样被MIT拒掉:“系里不喜欢你”,找校长对峙后悟了
  6. 15岁天才创办4chan匿名网站,如今因股权分配不均,与谷歌不欢而散!
  7. 为什么「反向传播」一定要在生物学上有对应?
  8. 奥巴马竟被「去马赛克 AI」洗白,CVPR 新研究惹上种族歧视大麻烦,LeCun 也被卷入其中...
  9. 延毕率逐年上升!我国博士研究生累计招生已近150万!
  10. 燃爆,100个Python实战小项目汇总!