[U-Boot-Users] Redundant environment and saveenv

hi all,
I have enabled a redundant environment and my two environments reside in two different sectors in flash. Everything works perfectly, except seems there is a problem in saveenv command: in file common/env_flash.c line 205: if ((rc = flash_write(env_ptr->data, (ulong)&(flash_addr_new->data), sizeof(env_ptr->data))) || (rc = flash_write((char *)&(env_ptr-crc), (ulong)&(flash_addr_new->crc), sizeof(env_ptr->crc))) || (rc = flash_write(&flag, (ulong)&(flash_addr->flags), sizeof(flash_addr->flags))) || (rc = flash_write(&new_flag, (ulong)&(flash_addr_new->flags), sizeof(flash_addr_new->flags))))
it writes a char to (ulong)&(flash_addr->flags), but this sector was never erased. am i missing something here?
flash is STM M29W040, connected with 8 bit bus.
Thanks, Ara

In message 00bc01c54a58$b347c5d0$1000000a@araavanesyan you wrote:
I have enabled a redundant environment and my two environments reside in two different sectors in flash. Everything works perfectly, except seems there is a problem in saveenv command:
Which type of problem?
it writes a char to (ulong)&(flash_addr->flags), but this sector was never erased.
Yes, this is intentional. It's marking the old environment sector as obsolete.
am i missing something here?
I don't know. Where exactly is your problem? You don;t have to erase flash to be able to write to it.
Best regards,
Wolfgang Denk
participants (2)
-
Ara Avanesyan
-
Wolfgang Denk