Functions | |
| uint8_t | SelfTest_PC (void) |
| This function performs the test of the PC register. | |
| uint8_t | SelfTest_CPU_Registers (void) |
| This function performs the checkerboard test for all CPU registers except the PC register. | |
| uint8_t | SelfTest_CPU_Registers_Fast (uint8_t *lastTestedStep) |
| Checks one register per call (SP, R8-R12, LR, R0-R7), using both checkerboard patterns. | |
| uint8_t | SelfTest_PROGRAM_FLOW (void) |
| This function tests the program flow. | |
| uint8_t SelfTest_PC | ( | void | ) |
This function performs the test of the PC register.
The function calls SelfTest_PC5555() and SelfTest_PCAAAA(), which are placed at addresses in Flash that match the 0x5555... and 0xAAAA... pattern most closely. These functions must return unique values to SelfTestA, SelfTestB, and SelfTestC variables if PC is working correctly.
| uint8_t SelfTest_CPU_Registers | ( | void | ) |
This function performs the checkerboard test for all CPU registers except the PC register.
| uint8_t SelfTest_CPU_Registers_Fast | ( | uint8_t * | lastTestedStep | ) |
Checks one register per call (SP, R8-R12, LR, R0-R7), using both checkerboard patterns.
It then checks PRIMASK and CONTROL.SPSEL; with DSP, APSR is last. Initialize *lastTestedStep to 0xFFu before the first call. Each phase stores its step (0-17 with DSP, 0-16 otherwise) on PASS or FAIL. After a FAIL, stop testing and enter a safe state; another call would advance to the next step. NULL pointers and invalid step values return FAIL without changing the state. The PRIMASK test briefly enables maskable interrupts. Supported by GCC_ARM, ARM and IAR. Each phase's unique success signature is checked before reporting PASS. For targets whose linker copies .cy_ramfunc to RAM, define STL_CPU_FAST_RUN_FROM_RAM in the assembler build to run this test from RAM. For a target whose linker copies .cy_itcm to ITCM, define STL_CPU_FAST_RUN_FROM_ITCM instead. These options are mutually exclusive.
| lastTestedStep | Pointer to the caller-owned last attempted step. Must refer to writable storage and initially contain 0xFFu. |
| uint8_t SelfTest_PROGRAM_FLOW | ( | void | ) |
This function tests the program flow.
For every critical execution code block, this function adds to or subtracts from complementary counters before the block execution and immediately after execution. This procedure allows verification of whether the code block is correctly called from the main program flow and to check if the block is correctly executed. Provided there are the same numbers of exit and entry points, the counter pair will always be complementary after each tested block.