This page shall focus on the customer implementation of NVM (Non Volatile Memory) interface. The demo implementation is specifically designed for the TI reference design. However, it’s important to note that customization is required for the customer to adapt it to their specific needs. In other words, the customer must either create their own implementation or tailor the existing demo implementation to suit their requirements.
The application shall make use of the public functions related to the non-volatile memory interface from the header file nvm.h.
The application shall be able to specify the type of non-volatile memory used to store/retrieve the data, which is provided as an enumeration.
The application can write data to the non-volatile memory in two modes.
In the non blocking mode before calling the API NVM_APP_writeAsync it is necessary to call the APIs NVM_APP_init which shall start the write task NVM_APP_writeTask with the specified priority and a semaphore for it,
and NVM_APP_registerCallback to register the callback function to get the status of the async write process.
The callback function type shall be as specified below.
The write task NVM_APP_writeTask created for the non blocking NVM data write shall trigger the registered callback with the write status as a argument provided in the form of an enumeration specified below.
As a contradictory, the API NVM_APP_close kills the write task NVM_APP_writeTask and the semaphore which were being created by the API NVM_APP_init
The APIs NVM_APP_write and NVM_APP_writeAsync shall have same set of parameters.
The parameter type can be NVM_TYPE_EEPROM or NVM_TYPE_FLASH depending on the implementation.
The parameter id can be CONFIG_EEPROM0 or CONFIG_FLASH0 or similar depending on the sysconfig adaptations.
The parameter offset shall be the data offset to write the data block into the non-volatile memory. For example, as per the AM64x/AM243x EVM User's Guide, the first 259 bytes of addressable EEPROM memory are pre-programmed with board identification information. In this case the offset shall be at least 259.
The parameter length shall the length of the data block and pData shall be the pointer to the data block to be written into the non-volatile memory.
Note:The API NVM_APP_writeAsync does NOT copy the data to another buffer, therefore please ensure that the buffer is not destroyed after calling this API.
Below is the sample implementation of the API NVM_APP_write in a application.
Below is the sample implementation of the API NVM_APP_read in a application.
Below is the sample implementation of the API NVM_APP_writeAsync in a application.