Post Go back to editing

Can't write value to flash(ADuCM331)

Can't write value at 0x7FC location again in ADuCM331.

At first, 0x7FC location can be written with 0x00000000, 0x00000000. And the value can be cheked by the debug.

And nexttime, I try to rewrite value 0xffffffff, 0x16400000 at 0x7FC location. but the value is still 0x00000000, 0x00000000.

abstracted code is like below. How can I fix this problem??

================

Code

================

const unsigned int iPage0CS[2] __at(0x07f8) = {0xffffffff,0x16400000};

~~~

 FLASH_Word_Write(0x000007F8,0x00000000, 0x00000000);

~~~

FLASH_Word_Write(0x000007F8,0x00000000, 0x00000000);
FLASH_Word_Write(0x000007F8,0xffffffff, 0x16400000);    <- this does not work.

~~~

Parents
  • Hi Yeo,

    Any flash location (64-bit word) can only be written once. An overwrite if necessary should only be done with zeros only, otherwise it is very likely that ECC error conditions are generated.

    in the code: const unsigned int iPage0CS[2] __at(0x07f8) = {0xffffffff,0x16400000};
    will write the default key to location 0x07f8;

    the code: FLASH_Word_Write(0x000007F8,0x00000000, 0x00000000); will overwrite location 0x07f8 with zeros.

    To clear, location 0x07f8 a page erase pf flash page 0 needs to be done.

    regards
    Holger

Reply
  • Hi Yeo,

    Any flash location (64-bit word) can only be written once. An overwrite if necessary should only be done with zeros only, otherwise it is very likely that ECC error conditions are generated.

    in the code: const unsigned int iPage0CS[2] __at(0x07f8) = {0xffffffff,0x16400000};
    will write the default key to location 0x07f8;

    the code: FLASH_Word_Write(0x000007F8,0x00000000, 0x00000000); will overwrite location 0x07f8 with zeros.

    To clear, location 0x07f8 a page erase pf flash page 0 needs to be done.

    regards
    Holger

Children
No Data