cancel
Showing results for 
Search instead for 
Did you mean: 

Removing FLASH write protection dynamically

CTapp.1
Senior

Is it possible to change the FLASH write protection at run time without reprogramming the option bytes?

The write protection registers are writeable after unlocking, but it appears as if changing the value has no effect on the actual write protection; it looks as if the new values have to be written back to the option bytes, but the new values are only activated after a system reset.

Does that mean it is not possible to update a page when the system is operational if that page is write protected (to stop stray writes from corrupting it)?

Using an ST32G484, if that makes a difference.

5 REPLIES 5

@CTapp.1 wrote:

Does that mean it is not possible to update a page when the system is operational if that page is write protected (to stop stray writes from corrupting it)?


(my emphasis)

If it were possible, that would compromise the protection!

TDK
Guru

Option bytes need loaded before they take effect. See the "Option bytes programming" section in the reference manual for the procedure. In particular, setting OPTSTART and OBL_LAUNCH.

The registers you are interfacing with are not the option bytes themselves, only the registers for accessing them.

If you feel a post has answered your question, please click "Accept as Solution".

Possibly very slightly if there is a command sequence needed to remove it temporarily.

The block is used to store parameters that only change infrequently but which are critical to normal operation. Other memory devices support "protect all", but allow that protection to be temporarily disabled (by guarded commands) to allow data like this to be updated.

My only option here is to never write protect the region, which does compromise its protection ;)

 

Thanks, I get that.

However, the documentation does not make it clear that modifying the WRP registers allows the option bytes to be updated, but it does not immediately change the protection that is enforced.

It says in order for the option bytes to take effect, they need to be loaded. How else would you interpret that? WRP is an option byte.

If you feel a post has answered your question, please click "Accept as Solution".