5 Software Application Assumptions of Use
Related to Safety
The global variables of the flash
API will be initialized only when Fapi_initializeAPI() is executed. Hence, this
function must be executed once before using any of the other flash API
functions. There is no need to call this function more than once. However, this
function must be called whenever the user application updates the system
frequency or the flash wait state configuration at runtime (which is rare).
Before executing
Fapi_initializeAPI(), the user application must ensure that the PLL is
configured correctly for the desired output frequency. Note that
SysCtl_setClock() provided in the driverlib achieves this by using the DCC
module. SysCtl_isPLLValid() called by SysCtl_setClock() uses the DCC module to
ensure that the PLL output is in the expected range. For more details of the DCC
module, see the device-specific technical reference manual.
If the user application requires
protection of the flash register space from any corruption due to reasons like
runaway code, it can be accomplished by using the ERAD module. For ERAD usage
details, see the device-specific technical reference manual.
When using Fapi_BlankCheck() for
the flash main array address range, it is suggested to check the corresponding
ECC array address range as well. ECC address range for each sector is given in
the Memory Map table in the device-specific data sheet.
User application software must
enable ECC evaluation for the flash read/fetch path using the ECC_ENABLE
register as needed. Flash API does not enable/disable this register. Note that
the ECC_ENABLE is enabled by default at power up. Hence, the user application
software defines the NMI ISR and flash single bit error ISR to be able to
respond for the single and uncorrectable flash errors. For more details on the
FLASH_ECC_REGS registers, see the device-specific technical reference
manual.
If the user application’s safety
standards require it to read the entire flash memory range periodically to
ensure that the data is intact, the user application may do so and calculate
checksum/CRC for the entire flash memory range. VCU CRC module can be used to
accomplish this. For more details on the VCU CRC module, see the device-specific
technical reference manual.
If the user application’s safety
standards require it to read the flash register space periodically to ensure
that the register configuration is intact, application may do so and calculate
checksum/CRC for the flash register memory range.
If the user application’s safety
standards require it to verify (using CPU read) the flash content after program
and erase operations, it can do so by using Fapi_doVerify() and
Fapi_doBlankCheck(), respectively.
Flash API does not
configure/service the watchdog. The user application can configure the watchdog
and service it as needed (either serially in between the flash API function
calls or using a CPU timer ISR).
If the flash API code in RAM or
flash gets overwritten due to improper application design (for example, stack
overflow), ITRAPs (illegal instruction trap) may occur when the CPU tries to
execute the flash API functions. Hence, the user application defines ITRAP ISR
to respond such events.