Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
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.
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.