Firmware User Manual (AE-step)
71
Revision 1.02
2019-04-24
TLE984x Firmware User Manual
NVM
“Command 89H – NVM: Protection Set / Clear” on Page 56
for details on how to set or clear the NVM
protection password
5.2
NVM Write
It is strongly recommended to the user that no flash operations which modify the content of the flash, like
write and erase, get interrupted at any time.
In order to write/modify data to a NVM page inside the user code or user data area, several user API functions
are provided. From a user point of view there is no need to differentiate between the two major user NVM areas
by using the API functions. The called user API functions are identifying by the given address the target user
NVM region.
For writing a NVM page two scenarios are considered:
1.Writing a new page (erased or unmapped)
2.Writing a used page
The handling of these two scenarios, differ slightly between user code area and user data area. All the
following described actions are performed by the user API functions, it does not describe user activities.
For writing a new code flash page the assembly buffer (AB) is opened. The AB is a small portion of SRAM inside
the NVM hardware module to buffer the content of a NVM page for write activities. The AB is filled with 0xFF,
the content of an erased page. The AB is updated with the data provided by the user along with the calling of
the user API function. Then the content of the AB is written to the erased page addressed by the address
provided by the user as parameter for the user API function.
For writing a used code flash area the AB is opened and the data inside the used page is copied into the
assembly buffer. The AB is updated with the data provided by the user along with the calling of the user API
function. The addressed NVM page is being erased afterwards the content of the AB is written to the erased
page.
For writing a new data flash page, the user API function checks the content of the MapRAM for the given
address. Since the page is not used, the MapRAM entry is marked unused. An internally maintained spare page
points to a randomly selected erased physical data flash page. The assembly buffer (AB) is opened for the
selected physical data flash page. The AB is updated with the data provided by the user along with the calling
of the user API function. Then the content of the AB is written to the page addresses by the spare page. The
link to the physical page is entered into the MapRAM and a new spare page is randomly selected.
For writing a used data flash page, the user API function checks the content of the MapRAM for the given
address. The AB is opened and the data of the used (still mapped) page is copied into the AB. The AB is updated
with the data provided by the user along with the calling of the user API function. Then the content of the AB
is written to the page addresses by the spare page. The link to the new physical page is entered into the
MapRAM. Now the old data flash page is being erased and a new spare page is randomly selected.
For all of these four scenarios the data just written is verified against the content of the AB. The user can select
whether a retry (erase-write) is performed in case the verify failed.
For the data flash along with the enabled retry feature also the Disturb Handling (DH) feature gets enabled.
The goal of the Disturb Handling is to compensate for retention losses of pages long time not updated by the
user. Retry and Disturb Handling are executed exclusively, either of the two can be executed with one user API
call but not both. In case no retry is performed and based on a pseudo-random number generator the DH is
called (in average on every 1000th write operation), a copying of a used page (not the one which was just