
Hi Rahanesh,
[...]
sflash.c is flash driver code . I showed you the print message of
savenev to note that it is erasing 0xad030000 - 0xad03ffff. That means environment variables are placed in the mentioned sector(0xad030000
- 0xad03ffff). Actual address of environment variables is 0xad03f000,
which is last 4Kb of 64KB sector.
Well yes, you showed us, that the code that you use actually violates the otherwise used principle, that the environment is inside its own erase block. So the code actually *needs* to use some buffering of the contents not to be destroyed. I see this for the first time to be honest and I would not be surprised, if fw_setenv does *not* do such a thing by itself. So it looks like it boils down for you to find out whether the Linux MTD driver plays such tricks. I don't think so and your results indicate the same.
If this is the case what should be the DEVICE_OFFSET? ENV_SIZE?
The parameters actually do not look incorrect, but as I said, they violate the implicit assumption that the underlying MTD erase block can be erase without damaging anything.
Using the latest u-boot will be quite time consuming. Please help!!!
Adding more exclamation marks will not improve your chances of getting *free* help. Using latest code (or code that anybody besides you knows) however will.
Best wishes Detlev