设为首页收藏本站
查看: 10236|回复: 0

SAMA5D3X使用tftp烧写内核镜像

[复制链接]

25

主题

9

回帖

280

积分

中级会员

积分
280
Willian.Mo 发表于 2015-8-4 11:29:36 | 显示全部楼层 |阅读模式
本帖最后由 Willian.Mo 于 2015-8-4 12:01 编辑

介绍:
        在linux内核开发过程中,需要将linux内核烧写到开发板上,为了方便调试我们可以使用tftp下载内核镜像。tftp烧写的基本原理是:首先通过tftp命令将linux内核下载到RAM中,然后可以通过nand write等命令将内存中的内核写到nand flash存储器中,下次启动就可以直接从nand flash读取镜像到内存中。在PC-开发板的开发环境中,PC主机充当的是tftp的服务器,开发板充当的是tftp的客户端。为了建立tftp协议的连接,要求PC机的IP地址和开发板的IP地址需要在同一网段


1.搭建tftp服务器参考这里:
http://bbs.myir-tech.com/forum.php?mod=viewthread&tid=6158&highlight=tftp

2.设置开发板MAC地址、IP地址和tftp服务器地址:
[mw_shl_code=bash,true]U-Boot> setenv ethaddr 3a:1f:34:08:54:54
U-Boot> setenv ipaddr 192.168.1.123     
U-Boot> setenv serverip 192.168.1.100(PC机的IP地址)[/mw_shl_code]
3.烧写 sama5d3xek.dtb( x 由核心板 CPU 决定) 到地址 0x180000 处:
[mw_shl_code=bash,true]U-Boot> tftp 0x22000000 sama5d31ek.dtb
Load address: 0x22000000
Loading: ##
done
Bytes transferred = 21064 (5248 hex)

U-Boot> nand erase 0x180000 0x5248
U-Boot> nand write 0x22000000 0x180000 0x5248[/mw_shl_code]
4.烧写 linux 内核 uImage 到地址 0x200000 处:
[mw_shl_code=bash,true]U-Boot> tftp 0x22000000 uImage
Loading: #################################################################
         #################################################################
         #################################################################
         ####
done
Bytes transferred = 2919504 (2c8c50 hex)

U-Boot> nand erase 0x200000 0x2c8c50
U-Boot> nand write 0x22000000 0x200000 0x2c8c50[/mw_shl_code]
回复

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-4-30 13:45 , Processed in 0.046185 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表