Showing results for 
Search instead for 
Did you mean: 

Nor Flash

New Contributor II

Hi Team,

In our project we are using the SPI based NOR flash chip as a slave, whose ordering part number is S25FL256SAGMFI000.

As per the datasheet, we can see that there is dynamic sector protection schemes available for each sector(independent to the size of sector). To implement this scheme, we would like to understand the flow to make this protection scheme enable. I am slightly confuse what the DYBAR returns, is it the sector number associated with the protection which it returns or anything else? and if it is the sector number then why only 8-bits are allotted to it; in fact the sector numbers are more considering the 32 4Kb and 510 64Kb sectors.

We are stuck and unable to achieve our ultimate goal which is to -> write some data to the desired sector(4kb or 64kb or both) and then enables the protection for it (in the boot software), so that later though application wanted to modify that sector it will not allow. and then once the protection is enabled how to read the data from that protected sector?

Request you to please suggest some inputs which we have to implement to achieve this protection schemes.


Shivam Kakad

1 Solution

Hi Shivam,

Every sector in the main flash array has a volatile dynamic protection bit (DYB) associated with it. When the bit is 0, the sector is protected from program and erase operations. When the bit is 1, the sector is in unprotected state. Even though it is called the dynamic protection 'bit', however, this bit is written to/read from the flash in the form of a one byte data, and DYBAR is the Dynamic Protection Bit Access Register which holds this one byte of data.

Therefore, if the value of DYB Access Register associated with a particular sector is 0x00 it means that the particular register is protected from program and erase operations. And, when the value of DYB Access Register associated with a particular sector is 0xFF then it means that the particular sector is not protected against program or erase operations.


The value of the DYB Access Register associated with any particular register can be read using the DYB Read (0xE0) command.


The DYB Write (0xE1) command can be used to write the desired value to the DYB Access Register.


Please note that this is just a volatile protection scheme.

The process of reading data from a sector always remains same, irrespective of whether it is protected or unprotected. The protection scheme only protects the sector against program and erase. The method used for reading shall remain same.

Let us know if you have more questions.

Thank you and Regards.

View solution in original post

3 Replies