4.4.4 Firmware and Sample Project

Microchip provides eNVM firmware drivers to use with the application development. The SmartFusion 2 eNVM firmware drivers can be downloaded from the Firmware Catalog. The eNVM firmware driver provides APIs to unlock and write to eNVM features. For the list of APIs and their descriptions, see the SmartFusion 2 eNVM Driver User Guide from Open Documentation.

The eNVM driver package includes sample projects to show the usage of eNVM. The sample projects are available for three different tool chains: IAR Embedded Work, Keil-MDK, and SoftConsole. The sample project can be generated by right-clicking the eNVM driver and selecting Generate..., as shown in the following figure.

Figure 4-30. Generating a Sample Project for eNVM

The following table lists the available APIs for eNVM in the eNVM firmware drivers

Table 4-10. Available APIs for eNVM
API Description
NVM_unlock Unlock the eNVM Block
NVM_write The function NVM_write() is used to program data in to the eNVM. This function treats the two eNVM blocks contiguously, hence 512 KB of memory can be accessed linearly. The starting address and ending address of the memory to be written need not be page aligned. This function supports programming data that spawns across multiple pages, and does not support writing or programming eNVM without input data. This function is a blocking function.

The NVM_write() function performs a verify operation on each page programmed to ensure that the NVM is programmed with the expected content.