ModusToolbox Safety Test Library
Loading...
Searching...
No Matches

General Description

Functions

uint8_t SelfTests_StartUp_ConfigReg (void)
 This function call checks the configuration registers by comparing the value stored in nonvolatile storage with the current configuration registers value.
cy_en_flashdrv_status_t SelfTests_Save_StartUp_ConfigReg (void)
 This function stores the configuration registers to nonvolatile storage.

Function Documentation

◆ SelfTests_StartUp_ConfigReg()

uint8_t SelfTests_StartUp_ConfigReg ( void )

This function call checks the configuration registers by comparing the value stored in nonvolatile storage with the current configuration registers value.

If the values are different, the function returns a fail.

Note
In CFG_REGS_TO_FLASH_MODE, call SelfTests_Save_StartUp_ConfigReg once to create the stored baseline before using this check. In CFG_REGS_CRC_MODE, the first successful call stores the CRC baseline and returns CRC_SAVED_STATUS; subsequent calls perform the comparison.
Returns
OK_STATUS (0) - Test passed in CFG_REGS_TO_FLASH_MODE.
ERROR_STATUS (1) - Test failed or nonvolatile storage access failed.
CRC_SAVED_STATUS (2) - CRC was stored successfully in CFG_REGS_CRC_MODE.
PASS_COMPLETE_STATUS (3) - CRC matched the stored CRC in CFG_REGS_CRC_MODE.

◆ SelfTests_Save_StartUp_ConfigReg()

cy_en_flashdrv_status_t SelfTests_Save_StartUp_ConfigReg ( void )

This function stores the configuration registers to nonvolatile storage.

Used only if STARTUP_CFG_REGS_MODE == CFG_REGS_TO_FLASH_MODE.
This function must be called once after the initial PSOC power up and initialization before entering the main program. Do not call it periodically or after runtime configuration changes that should be detected by the startup-register self-test, because it overwrites the nonvolatile baseline used by SelfTests_StartUp_ConfigReg.

Returns
Flash backend: CY_FLASH_DRV_SUCCESS - Writing to Flash is successful.
Flash backend: Other cy_en_flashdrv_status_t values - Writing to Flash is not successful. Refer to the Flash Driver PDL documentation for error codes.