xilflash
Vitis Drivers API Documentation
xilflash_protection_example.c File Reference

Overview

This file contains a design example using the Generic Flash Library.

This example tests the Lock and UnLock features of the Flash Device.

A block is Locked and an attempt is made to erase a Page in that block. This should return an error. The block is then unlocked and an attempt is made to erase a page in that block which should succeed. A page of data is written, read back and compared with the data written for correctness.

Note
This example has been tested with an Intel CFI compliant Flash device. This example has not been tested with an AMD CFI compliant Flash device. The AMD CFI compliant Flash devices require the user to apply a 12V DC voltage on the RP pin while performing the Lock and Unlock operations. Change the value of XFL_TO_ASYNCMODE to 1, inorder to operate the Micron Flash in async mode,if it was set to sync mode.
  MODIFICATION HISTORY:
  Ver   Who  Date     Changes


1.01a mta 10/09/07 First release 1.01a sdm 02/24/09 Updated the notes with information about using the example with AMD CFI compliant Flash devices 2.00a ktn 12/04/09 Updated to use the HAL processor APIs/macros 3.00a sdm 03/03/11 Updated to pass BaseAddress and Flash Width to _Initialize API, as required by the new version of the library 4.2 nsk 01/29/16 Added Support to change Flash to Async Mode, if it was set to sync mode. Modified FLASH_BASE_ADDRESS to canonical name. 4.7 akm 07/23/19 Initialized Status variable to XST_FAILURE. 4.10 akm 07/14/23 Added support for system device-tree flow. *

Functions

int FlashProtectionExample (void)
 This function verifies the locking and unlocking features of the Flash device. More...
 
int main (void)
 Main function to execute the Flash protection example. More...
 

Function Documentation

int FlashProtectionExample ( void  )

This function verifies the locking and unlocking features of the Flash device.

Parameters
None
Returns
XST_SUCCESS if successful else XST_FAILURE.
Note
None.

References XFlash_Erase(), XFlash_Initialize(), XFlash_Lock(), XFlash_Read(), XFlash_Reset(), XFlash_Unlock(), and XFlash_Write().

Referenced by main().

int main ( void  )

Main function to execute the Flash protection example.

Parameters
None
Returns
XST_SUCCESS if successful else XST_FAILURE.
Note
None.

References FlashProtectionExample().