Skip to contentSkip to conversation

HELP! can't save environment variables

U-Boot-Users Joe Culler 2 participants 4 messages Mar 17, 2006

lore
Share & tools
lore

Joe Culler

author
#0 lore raw

Hello there,

I ported u-boot to my customized s3c2410 board. My board uses NOR flash SST39xF1601(2MB). Everything seems to be ok except it can't save environment variables using saveenv command. Would you tell me how to solve that issue? Thanks.

I defined smdk2410.h about flash as belows:

#define CFG_ENV_ADDR            (CFG_FLASH_BASE + 0x020000))
#define CFG_ENV_IS_IN_FLASH     1
#define CFG_ENV_SIZE            0x20000 /* Total Size of Environment Sector */
#define CFG_MAX_FLASH_BANKS     1       /* max number of memory banks */
#define PHYS_FLASH_SIZE         0x00200000 /* 2MB */
#define CFG_MAX_FLASH_SECT      (32)    /* max number of sectors on one chip */

I also enable CFG_CMD_ENV and CFG_CMD_FLASH for CONFIG_COMMANDS. I noticed if I defined CFG_MONITOR_BASE = CFG_FLASH_BASE, then a message *** Warning - bad CRC, using default environment won't be displayed on screen.

Best regards,
Joe.

#1 lore raw
Quoted 4 lines · In message <[email protected]> you…

I ported u-boot to my customized s3c2410 board. My board uses NOR flash SST39xF1601(2MB). Everything seems to be ok except it can't save environment variables using saveenv command.

Then your flash configuration does not match your hardware.

Quoted 1 line

Would you tell me how to solve that issue? Thanks.

Fix your configuration.

Quoted 1 line

I defined smdk2410.h about flash as belows:

This is not enough to make any statements, especially sinc we know nothing about your hardware.

Quoted 1 line

#define CFG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */

One formal comment: Your comment is wrong here. What you #define is the toal size of the environment, not the size of an environment sector. These *might* be the identical, but would be pure chance.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Give a man a fish, and you feed him for a day. Teach a man  to  fish,
and he'll invite himself over for dinner.             - Calvin Keegan
author
#2 lore raw
Quoted 11 lines · Wolfgang Denk
Quoted 4 lines · In message you

I ported u-boot to my customized s3c2410 board. My board uses NOR flash SST39xF1601(2MB). Everything seems to be ok except it can't save environment variables using saveenv command.

Then your flash configuration does not match your hardware.

Quoted 1 line

Would you tell me how to solve that issue? Thanks.

Fix your configuration.

Thank you for your quick reply. As you mentioned, you mean I should modify
board/smdk2410/flash.c for my s3c2410 customized board? I guess my
include/configs/smdk2410.h with no problem...

Thanks again,
Joe.

#3 lore raw
Quoted 6 lines · In message <[email protected]> you…
Quoted 2 lines

Fix your configuration.

Thank you for your quick reply. As you mentioned, you mean I should modify
board/smdk2410/flash.c for my s3c2410 customized board? I guess my
include/configs/smdk2410.h with no problem...

You misunderstand. I wrote "fix your configuration", which means config settings in your baord config file. It seems they do not match your code and/or your hardware.

And do NOT, I repeat DO NOT mess with include/configs/smdk2410.h or board/smdk2410/flash.c because these are for the SMDK2410 board and NOT for your hardware. Play by the rules and create your own board configuration. Add only things you completely understand.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Computers are not intelligent.  They only think they are.