[U-Boot-Users] Redundant environment and saveenv

Ara Avanesyan araav at hylink.am
Tue Apr 26 14:08:47 CEST 2005


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





More information about the U-Boot mailing list