zoukankan      html  css  js  c++  java
  • 创建Uboot 环境变量 bin 文件

     

    As we know, the bootloader stores its configuration into an area of the flash called the environment. The environment is basically stored as a sequence of null-terminated strings, with a little header containing a checksum at the beginning. Using the “printenv”, “setenv” and “saveenv” commands in U-Boot, while this environment can easily be manipulated. It is sometimes desirable to be able to generate a binary image of an environment that can be directly flashed next to the bootloader, kernel and root filesystem into the device’s flash memory.

    In order to modify the U-Boot environment variables from user space, the program called “mkenvimage” is needed, this program can be generated from the U-Boot sources, follow the instructions in the tools/env/README file.

    make env

    This will get the program “mkenvimage”, the program is executed in host computer, not the target board. The text file “uboot-env.txt” describing the environment is needed like:

    git-bash
    bootargs=console=ttyS0,115200
    bootcmd=tftp 22000000 Image
    [...]


    Then use mkenvimage as follows:

    ./mkenvimage -s 0x40000 -o uboot-env.bin uboot-env.txt

    The -s option allows to specify the size of the image to create. It must match the size of the flash area reserved for the U-Boot environment.

    Before using the new uboot-env.bin, the old bin file should be restored by the following commands:

    dd if=/dev/mtd7 of=uboot-env.bin

    Then, flashing the new bin file in /dev/mtd7 by the following commands:

    flash_eraseall /dev/mtd7
    flashcp uboot-env.bin /dev/mtd7


    Or, the Lauterbach Debugger is also a good tool to flash the Hyper-Flash.

  • 相关阅读:
    Swift 对AFN框架的封装
    iOS开发中静态库制作 之.a静态库制作及使用篇
    iOS 地图定位及大头针的基本使用
    swt中改变树的字体及颜色的实现
    为什么很多程序员选择跳槽?
    用SWT做圆形控件
    JAVA简单编码规则
    swt中改变表格字体大小及颜色的实现
    使用JAVA的反射机制反射带有数组参数的私有方法
    我的GIT使用经历
  • 原文地址:https://www.cnblogs.com/hutiann/p/11431185.html
Copyright © 2011-2022 走看看