Execute the Flash API code from RAM or a Flash Bank not selected for EEPROM Emulation (some functions must be run from RAM).
Configure the API for the correct CPU frequency of operation
Follow the Flash API checklist to integrate the API into an application
Configure the PLL as needed and pass the configured CPUCLK value to Fapi_initializeAPI() function. Note that the flash API library does not support flash erase/program operations when the system frequency is less than or equal to 20 MHz.
Configure BANKMUXSEL and FLASHCTLSEM registers as needed
Configure waitstates as per the device-specific data manual before calling Flash API functions. The Flash API issues and errors if the waitstate configured by the application is not appropriate for the operating frequency of the application.
Do not execute Flash API from the same Flash Bank that is selected for emulation
Do not configure interrupt service routines (ISRs) that result in read/fetch access from the Flash bank on which an erase/program operation is in progress. Flash API functions, user application functions that call Flash API functions, and any ISRs, must be executed from RAM or the flash bank on which there is no active erase/program operation in progress.
Do not access the Flash bank or OTP on which the Flash erase/program operation is in progress
ECC should not be programmed for link-pointer locations. The API skips programming the ECC when the start address provided for the program operation is any of the three link-pointer addresses. Care should be taken to maintain a separate structure/section for link-pointer locations in the application. Do not mix these fields with other DCSM OTP settings. If other fields are mixed with link-pointers, API skips programming ECC for the non-link-pointer locations as well. This causes ECC errors in the application.