cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to a particular NVM address erases whole sector

pho3nix
Associate III

Hi, 

We are trying to write some key values directly into a particular address of NVM from STM32Cubeprogrammer, but rest of the sector are also getting erased. Is there any way to prevent it? Tested with Cubeprogrammer CLI also, but facing the same issue.

4 REPLIES 4

By "NVM", do you mean Flash?

If so, that is the expected behaviour - you can only write to erased Flash.

pho3nix
Associate III

Yes, I mean flash. 

 

Is there any other way to do it? So that other flash contents remain as it is. Only a particular selected area gets erased and written. 

No.

As noted, that is the nature of Flash.

You'd have to do it in 3 steps:

  1. Read out the existing content;
  2. Erase the sector;
  3. Write the new content.

 

If you explain what you're actually trying to achieve, people may be able to suggest other ways to achieve that goal...

(you haven't said what chip you're using)

Pavel A.
Evangelist III

Recently ST released M95 EEPROMs, very suitable for this purpose. Please consider.