设为首页收藏本站
查看: 24239|回复: 3

[Atmel工控板] Atmel Linux启动u-boot-debug.bin和ubootEnvtFileNandFlash.bin文件说明

[复制链接]

231

主题

64

回帖

2145

积分

管理员

积分
2145
玉米糊 发表于 2014-6-26 11:42:48 | 显示全部楼层 |阅读模式
u-boot-debug.bin
u-boot-debug.bin 是 u-boot.bin 的另外一个版本,它开启了u-boot 3秒倒计时,并在u-boot部分初始化网络等调试功能,目前仅 MYD-SAM9X5 区分了u-boot.bin 和 u-boot-debug.bin 两个文件,烧写时通过修改.tcl文件来指定两个文件中的一个:
[mw_shl_code=bash,true]
set ubootFile   "u-boot.bin"    #将u-boot.bin 改为 u-boot-debug.bin 可烧写带调试功能的 u-boot
[/mw_shl_code]

ubootEnvtFileNandFlash.bin
ubootEnvtFileNandFlash.bin 文件是 uboot 运行环境的配置脚本文件,一般由.tcl文件生成,如下是SAM9G45的TCL文件生成 ubootEnvtFileNandFlash.bin 脚本内容:
[mw_shl_code=bash,true]################################################################################
#  proc uboot_env: Convert u-boot variables in a string ready to be flashed
#                  in the region reserved for environment variables
################################################################################
proc set_uboot_env {nameOfLstOfVar} {
    upvar $nameOfLstOfVar lstOfVar

    # sector size is the size defined in u-boot CFG_ENV_SIZE
    set sectorSize [expr 0x20000 - 5]

    set strEnv [join $lstOfVar "\0"]
    while {[string length $strEnv] < $sectorSize} {
        append strEnv "\0"
    }
    # \0 between crc and strEnv is the flag value for redundant environment
    set strCrc [binary format i [::vfs::crc $strEnv]]
    return "$strCrc\0$strEnv"
}

lappend u_boot_variables \
    "ethaddr=3a:1f:34:08:54:54" \
    "bootdelay=3" \
    "baudrate=115200" \
    "stdin=serial" \
    "stdout=serial" \
    "stderr=serial" \
    "ipaddr=192.168.2.15" \
    "serverip=192.168.2.110" \
    "bootargs=mem=128M console=ttyS0,115200 mtdparts=atmel_nand:5M(bootstrap/uboot/kernel)ro,64M(rootfs),-(data) root=/dev/mtdblock1 rw   rootfstype=jffs2" \
    "bootcmd=nand read.i $kernelLoadAddr $kernelUbootAddr $kernelSize; bootm $kernelLoadAddr"

puts "-I- === Load the u-boot environment variables ==="
set fh [open "$ubootEnvFile" w]
fconfigure $fh -translation binary
puts -nonewline $fh [set_uboot_env u_boot_variables]
close $fh
send_file {NandFlash} "$ubootEnvFile" $ubootEnvAddr 0
[/mw_shl_code]
SAM9X5 和 SAMA5D3X 的 tcl文件中没有该部分代码,出厂时已经直接提供,如果修改 u-boot 运行变量,可以参考如上 9G45 的tcl文件部分。最后,
附上MYS-SAM9G45 tcl镜像文件: at91sam9g45ekes_demo_linux_nandflash.tcl (4.29 KB, 下载次数: 12456)


回复

使用道具 举报

5

主题

13

回帖

1028

积分

版主

积分
1028
jakebo 发表于 2014-6-26 18:33:14 | 显示全部楼层
好东西啊啊啊
回复 支持 反对

使用道具 举报

0

主题

3

回帖

17

积分

新手上路

积分
17
dqitt 发表于 2014-11-9 15:34:43 | 显示全部楼层
值得收藏...











bjcars.net












北京搬家公司
回复 支持 反对

使用道具 举报

0

主题

2

回帖

13

积分

新手上路

积分
13
短网址生成器 发表于 2014-11-30 16:18:47 | 显示全部楼层
以后需再关注,现在先帮你顶一下












世界最大月付虚拟空间产品提供商,祝您购买愉快!
http://www.4008844442.net/
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 11:44 , Processed in 0.068104 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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