cancel
Showing results for 
Search instead for 
Did you mean: 

writing EEPROM DATA area

wolfgang239955_stm1_st
Associate II
Posted on January 18, 2011 at 13:44

writing EEPROM DATA area

4 REPLIES 4
brazov22
Associate II
Posted on May 17, 2011 at 15:11

Hi,

you can write 128 bytes locations without setting FLASH_CR2.PRG, in this case you are using byte write operation and in this case non touched cells are not erased just because you don't issue a byte write operation on them. If you want to use block write operation then you need to set FLASH_CR2.PRG, in this case you can't skip cells, but if you want these cells mantain the previous value, you need to read them and program then in the block with the old value. Have a look on this discussion and on the attachment on that discussion:

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM8/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM8/Error 42004 when writing to data flash&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009786738307FCB24DB76B09BF0FB5BB81&currentviews=74]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM8/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM8%2fError%2042004%20when%20writing%20to%20data%20flash&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009786738307FCB24DB76B09BF0FB5BB81&currentviews=74

brazov2

wolfgang239955_stm1_st
Associate II
Posted on May 17, 2011 at 15:11

Hi brazov2,

thanks for your help.

Is it correct, that I need not to take care about the timing, when I write the values to the EEPROM DATA area? As it seems to me, it works fine, as long as I do not leave the block.

More important than the time I need for writing is, to keep far away from the limit of 300K write cycles ;o)

Will you agree, that to write e.g. 7 bytes to (one block of) the DATA EEPROM it takes about 7x4ms and I can write these 7 values to its addresses in one go?

Best Regards,

   WoRo

brazov22
Associate II
Posted on May 17, 2011 at 15:11

Hi,

yes, when writing on DATA eeprom you benefit of RWW feature, so while writing you can continue to execute code from PROGRAM eeprom, but if you use byte write and you wirte one byte after the other, the CPU is stalled when a byte write is on going and it tries to execute another byte write. About the question the answer is yes, 7 bytes write take around 7x4ms, unless you use block write that takes about 4 ms for 128 byte write in one shot.

brazov2

wolfgang239955_stm1_st
Associate II
Posted on May 17, 2011 at 15:11

Hi brazov2,

thanks again. Still a lot of questions.

For the moment I only need information about writing to DATA EEPROM with RWW.

Where can I get further detailed information especially about the timing?

What are you meaning with ''the CPU is stalled''? Does execution stop???

Let me try to give an example: I'm writing 7 bytes in one to the addresses 4001-403C-403D-403E-403F-4009-400A.

What happens in detail? Can I read the contens of 400A immediatly after writing if I am using the RWW feature?

What really happens, when I'm writing to two different blocks in one, e.g. writing a long int to 407E-407F-4080-4081?

TIA and Best Regards,

    WoRo