This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0L1228: Data in Flash after Erasing.

Part Number: MSPM0L1228

Tool/software:

Hi,

My customer has a question about data in Flash after Erasing.

What is read immediately after sector Erase without Program ?

Is the values before Erase read ?

 

There is the following note at the chapter 6.3.4 ERASE Command in the MSPM0L TRM.

  

 

In the customer's use case, Program->SectorErase is periodically performed.

Since the MCU power may be turned off while instructing the Flash controller to perform SectorErase, they’re considering that the flash is read when the MCU power is turned on, and if it is all “1”, they would judge that SectorErase was performed before the power is turned off.

However, if all “1”s are not guaranteed before the program as noted in the Note, is it possible to program all “1”s once and then read them?

Also, what happens if they program all “1” (0xFFFF_FFFF) to the area where the value "0x12345678_12345678" was programmed without Sector Erase before power off (does the value change?)?

Thanks and regards,
Hideaki 

  • Hi,

    1. Usually the data read after erase will be 0xFF. But we do not promise it unless you program the flash again.

    2. I am not fully understanding the rest questions. After a sector be programmed, you cannot program it twice unless you run an erase first. 

    Best regards,

    Cash Hao 

  • Hi Cash Hao,

    Thank you for your reply.

    After a sector be programmed, you cannot program it twice unless you run an erase first. 

     

    Could you explain in detail the above ?

    If they program a sector without running an erase first, is data not changed ?

     

    According to the datasheet below, they can program per word line 83 times maximum before sector erase.

    Is this correct ?

      

    Thanks and regards,

    Hideaki

  • Hi,

    The write operations per word line before sector erase. After a sector erase, you can write per word line below 83 times for different word address inside this sector. 

    It does not mean you can write the whole sector and then write again without erase it. 

    Best regards,

    Cash Hao

  • Hi Cash,

    Thank you for your answer.

    The customer wants to know an answer to the following question. Could you help to answer this ?

    After a sector be programmed, you cannot program it twice unless you run an erase first. 

     

    Could you explain in detail the above ?

    If they program a sector without running an erase first, is data not changed ?

    Thanks and regards,

    Hideaki

  • Hi Cash,

    One more question. How can they confirm whether Erase has been completed ?

    In their sysem, the MCU power may be turned off while instructing the Flash controller to perform SectorErase. So, they don't think that it is possible to confirm it by checking a register.

    Thanks and regards,
    Hideaki

  • Hi,

    If they program a sector without running an erase first, is data not changed ?

    I would say yes. The data will not change on the 2nd write.

    Best regards,

    Cash Hao

  • Hi,

    In their sysem, the MCU power may be turned off while instructing the Flash controller to perform SectorErase. So, they don't think that it is possible to confirm it by checking a register.

    First, it is not recommended to power off the MCU during any Flash process. A proper way is for the MCU to confirm the erase is done then cut its power off by itself. 

    Customer can consider add a big cap on the VDD supply. And let the MCU finish the erase process through the cap. 

    Best regards,

    Cash Hao

  • Hi Cash,

      

    Thank you for your answer, but sorry, let me confirm again below.

    After a sector be programmed, you cannot program it twice unless you run an erase first. 
    After a sector erase, you can write per word line below 83 times for different word address inside this sector. 

     

    Could you explain again what the above means ? Especially, what is "different word address inside this sector" ?

      

      

    There is the note (3) for NW(MAX) in the datasheet, like below.

      

    According to this description, if additional writes to the same word line are required, a sector erase is required once the maximum number of write operations per word line is reached.

    It seems that after a sector erase, they can write per word line below 83 times for the same word address inside this sector.

    Is this correct ? 

    Regards,

    Hideaki

  • Hi,

    No, the description is blur here. 

    I have run some test here, below is the results.

    You can write the same word line for multiply times. But each bit of the flash can only be changed from 1 to 0. It can not change from 0 to 1 in a write process. So, even though you write the same address twice without an erase, the data stored in the flash could be neither the first written data nor the second written data. If customer needs to write the same address twice, it is required an erase process between the writes. 

    Best regards,

    Cash Hao

  • Hi Cash Hao,

     

    I'm confused...

    So, even though you write the same address twice without an erase, the data stored in the flash could be neither the first written data nor the second written data. If customer needs to write the same address twice, it is required an erase process between the writes. 

     

    You mentioned twice, but the datasheet describes as follows.

    Maximum number of write operations (83) allowed per word line before the word line must be erased. If additional writes to the same word
    line are required, a sector erase is required once the maximum number of write operations (83) per word line is reached.

    Could you explain what "83" means ? 

    Regards,

    Hideaki

  • Hi,

    I do not know how to explain it in a better way. 

    The 83 means exactly what it says in the datasheet. 

    'So, even though you write the same address twice without an erase, the data stored in the flash could be neither the first written data nor the second written data. If customer needs to write the same address twice, AND wants to get the correct data stored in the flash, it is required an erase process between the writes. 

    Best regards,

    Cash Hao

  • Hi Cash Hao,

    Thank you for your explanation. I found the following description in the TRM. I understand the Max Program Operations (83).

    Maximum Program Operations per Word Line Before Erase
    The device data sheet specifies a maximum limit on the number of program operations per word line before
    erasure of the sector containing the word line is required. Exceeding this maximum can result in data corruption
    within the word line.
    If 16-bit or greater program operations are performed, and no 16-bit location is programmed more than once
    before a sector is erased, the maximum limit will never be reached and thus does not need to be
    considered.
    If 8-bit (byte) program operations are performed, the maximum program limit per word line must be considered
    and not exceeded. Program operations performed on ECC locations, if done independently from other program
    operations, count towards the number of writes before an erase is required.

    Thanks and regards,

    Hideaki