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

General Description

Functions

uint8_t SelfTest_PRIMASK (void)
 This function tests the PM bit of the PRIMASK register with the values 0 and 1, and attempts to restore the original PRIMASK value.

Function Documentation

◆ SelfTest_PRIMASK()

uint8_t SelfTest_PRIMASK ( void )

This function tests the PM bit of the PRIMASK register with the values 0 and 1, and attempts to restore the original PRIMASK value.

The function writes the original PRIMASK value back also when a check fails, and checks it. It returns ERROR_STATUS if any check fails, including when a stuck PM prevents the original value from being restored.

Note
Call this function from Handler mode or from privileged Thread mode. A write to PRIMASK from unprivileged Thread mode is ignored, so in this case the function returns ERROR_INCORRECT_USAGE_STATUS without changing PRIMASK.
This test runs only in blocking mode.
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Test failed, or the original PRIMASK value wasn't restored
ERROR_INCORRECT_USAGE_STATUS (4) - Called from unprivileged Thread mode