S12Z Protection Override

Document created by Radek Sestak Employee on Jun 1, 2017Last modified by Radek Sestak Employee on Jan 16, 2020
Version 4Show Document
  • View in full screen mode

This example:
1. write unprotected P-Flash area
2. protect target P-Flash area
3. tries to write protected P-Flash area
4. call Protection Override command for temporary modify P-Flash protection
5. write into temporary unprotected P-Flash area
6. restore original P-Flash protection scheme

The part of P-Flash memory used in this example for writing tests (0xFF8000..0xFF8FFFUL) is excluded from linker using. Please look at prm linker file for more details.


The flash_array constant with Protection Override Comparison Key is not directly referenced in the code, therefore we must enter the constant name into ENTRIES section in prm linker file for avoiding stripping it out as unused.

Please look at P-Flash Protection Register (FPROT) chapter in the reference manual for more details about P-Flash protection.

The key for Protection Override should be rather received from external source and used as PFLASH_Protection_Override() parameter. The correct Protection Override key is here hard-coded (err = PFLASH_Protection_Override(0xCAFE, 0xF...) for example code simplifying.


I hope it helps you.


1 person found this helpful