4.3. Write-Protection

The Versatile PB926EJ-S board provides a configuration register, SYS_FLASH, which controls the write-protect pin on the flash devices, and the default state is with write-protection enabled. To allow erasing and writing to the flash device the flashSelect() method disables write-protection:

M32(SYS_FLASH) = M32(SYS_FLASH) | 1;

To prevent accidental modification of the flash device contents after flash operations are complete, the flashDeselect() method re-enables write-protection:

M32(SYS_FLASH) = M32(SYS_FLASH) & 0xFFFFFFFE;

This code in flashSelect() and flashDeselect() for writing to SYS_FLASH is the only part of the flash algorithm that is specific to the ARM Versatile PB926EJ-S board.

Copyright © 2007. All rights reserved.DAI0190A
Non-Confidential