|
05 12 |
fw_printenv-control u-boot enviroment variables under linux作者: Joey 日期: 2009-05-12 16:35 |
u-boot可以設定的環境變數,例如tftp server ip, eth ip…等,如果要在進入linux後還能隨意操縱這些enviroment variable,就必需藉由fw_printenv這個小程式,這支小程式能顯示和設定u-boot的環境變數
因為小弟的板子是nand flash,所以我下載目前最新的u-boot,並試著用make env指令把fw_printenv編出來(最新板的fw_printenv可以自動切換nand與nor flash的操作方式)
接下來就要設定fw_env.config檔案並把它擺在/etc下,因為小弟u-boot的env offset被設定成如下
#define CFG_ENV_OFFSET 0x020000
#define CFG_NAND_BASE 0x4E000000
#define CMD_SAVEENV
#define CFG_NAND_LEGACY
#define CFG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
#define SECTORSIZE 512
所以fw_env.config必需被設定如下
# NAND example
# MTD device name offset env. size Flash sector size Number of sectors
/dev/mtd0 0x020000 0x10000 0x4000 512
這樣一來以後改u-boot environment variable就不用特地進u-boot修改了…
執行畫面大致如下圖

| 我使用fw_printenv怎么报-bash: /sbin/fw_printenv: No such file or directory的错误勒?请指教一下 |
| 給你點線索 1. library missing 2. none executable binary |
訂閱
上一篇
返回
下一篇
標籤:


rpcapd與netcat-測試嵌入式系統的好工具 (2009-04-09 17:06)
udev-強大的device node管理系統 (2009-02-02 20:35)
Framebuffer兩三事-Test On QT2410 (2009-01-12 16:29)
UIO-Linux user space I/O driver (2008-12-15 14:50)
GDB-刺入bug心臟的寶劍 (2008-10-15 16:11)
Telnet daemon-RS232以外的選擇 (2008-10-03 18:57)
在嵌入式系統切換file system-以squashfs和jffs2為例 (2008-10-01 19:44)
Linux kernel module-進入系統核心的鑰匙 (2008-09-12 14:03)
SQLite-麻雀雖小五臟俱全 (2008-09-05 14:46)