U-Boot移植(14)解决saveenv不能保存环境变量

1、没修改之前,u-boot.bin烧入板中,在dnw终端显示操作如下:

U-Boot 1.1.6 (Nov 25 2009 - 22:15:51)
DRAM:  64 MB Flash:  1 MB NAND:  64 MiB *** Warning - bad CRC, using default environment
In:    serial Out:   serial Err:   serial UPLLVal [M:28h,P:1h,S:2h] MPLLVal [M:5ch,P:4h,S:0h] CLKDIVN:3h
+---------------------------------------------+ | S3C2440A USB Downloader ver R0.03 2004 Jan  | +---------------------------------------------+ USB: IN_ENDPOINT:1 OUT_ENDPOINT:3 FORMAT: <ADDR(DATA):4>+<SIZE(n+10):4>+<DATA:n>+<CS:2> NOTE: Power off/on or press the reset button for 1 sec       in order to get a valid USB device address.
Hit any key to stop autoboot:  0 Booting Linux ...
NAND read: device 0 offset 0x0, size 0x200000
reading NAND page at offset 0x0 failed Could not read entire image due to bad blocks 2097152 bytes read: ERROR ## Booting image at 32000000 ... Bad Magic Number
##### 100ask Bootloader for OpenJTAG ##### Download u-boot [k] Download Linux kernel [j] Download JFFS2 image [y] Download YAFFS image [d] Download to SDRAM & Run Boot the system [f] Format the Nand Flash [s] Set the boot parameters

­­­ Reboot u-boot [q] Quit from menu Enter your selection:

在上面输入q后,再输入saveenv、reset保存不了变量。。。。

可能是没把新的环境变量保存到nandflash,由于我的ylp2410没有norflash。所以不修改100ask24x0.h,就是默认把它保存到norflash中,这个也是在事后修改程序后才发觉的。修改100ask24x0.h如下:

#ifndef __CONFIG_H #define __CONFIG_H
/* * High Level Configuration Options * (easy to change) */

 #define CONFIG_ARM920T          1       /* This is an ARM920T Core      */

#define CONFIG_S3C2410          1       /* in a SAMSUNG S3C2410 SoC     */

#define CONFIG_SMDK2410         1       /* on a SAMSUNG SMDK2410 Board  */

/* input clock of PLL */

#define CONFIG_SYS_CLK_FREQ     12000000/* the SMDK2410 has 12MHz input clock */
#define USE_920T_MMU            1
#define CONFIG_USB_DEVICE   1
#ifdef CONFIG_USB_DEVICE

#define CONFIG_USE_IRQ          1

#endif
#define CONFIG_JFFS2_CMDLINE 1

#define CONFIG_JFFS2_NAND    1
#define MTDIDS_DEFAULT "nand0=nandflash0"

#define MTDPARTS_DEFAULT "mtdparts=nandflash0:2m@0(kernel)," \                            

 "8m(jffs2)," \                            

"-(yaffs)"

/*

* Size of malloc() pool

 */

 #define CFG_MALLOC_LEN          (CFG_ENV_SIZE + 128*1024)

#define CFG_GBL_DATA_SIZE       128     /* size in bytes reserved for initial data */
/* * Hardware drivers */

#if 0

#define CONFIG_DRIVER_CS8900    1     

  /* we have a CS8900 on-board */

 #define CS8900_BASE             0x19000300

#define CS8900_BUS16            1

/* the Linux driver does accesses as shorts */

#endif
#if !defined(CONFIG_DRIVER_CS8900)

#define CONFIG_DRIVER_DM9000            1

#define CONFIG_DM9000_USE_16BIT         1

#define CONFIG_DM9000_BASE                      0x20000000

#define DM9000_IO                                       0x20000000 

#define DM9000_DATA                                     0x20000004

#endif
/* * select serial console configuration */

#define CONFIG_SERIAL1          1       /* we use SERIAL 1 on SMDK2410 */
/************************************************************ * RTC ************************************************************/

#define CONFIG_RTC_S3C24X0      1
/* allow to overwrite serial and ethaddr */

#define CONFIG_ENV_OVERWRITE
#define CONFIG_BAUDRATE         115200
/* for tag(s) to transfer message to kernel, www.100ask.net */

#define CONFIG_SETUP_MEMORY_TAGS    1

#define CONFIG_CMDLINE_TAG          1
/*********************************************************** * Command definition ***********************************************************/

#define CONFIG_COMMANDS \                        

 ((CONFIG_CMD_DFL | \                        

CFG_CMD_CACHE    | \                    

/* Start: by www.100ask.net */ \                        

/* CFG_CMD_PING     | */ \                        

 CFG_CMD_JFFS2    | \                        

CFG_CMD_NAND     | \                    

/* End: by www.100ask.net */ \                        

 /*CFG_CMD_EEPROM |*/ \                        

/*CFG_CMD_I2C    |*/ \                        

 /*CFG_CMD_USB    |*/ \               

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值