ModusToolbox Safety Test Library
Loading...
Searching...
No Matches
PRIMASK (PRIMASK register STL module)

General Description

The PRIMASK register test detects stuck-at faults in the PM bit (bit 0) of the PRIMASK register, which masks all exceptions with configurable priority.

PM is the only implemented bit of PRIMASK, so the test checks both of its legal values.

More Information

The test performs the following major tasks:

 1) Checks that it is called from Handler mode or privileged Thread mode, and saves
    the PRIMASK value.
 2) Writes PM = 0, reads PRIMASK back, and checks that PM = 0.
 3) Writes PM = 1, reads PRIMASK back, and checks that PM = 1.
 4) Writes the saved PRIMASK value back, and checks it.

The test is available on all Cortex-M cores.

Warning
The test changes the interrupt mask while it runs. Maskable interrupts are enabled for the time between the PM = 0 write and the next PM = 1 write. If PRIMASK was 1 when the function was called, an interrupt can occur in this window. If PRIMASK was 0, interrupts are masked between the PM = 1 write and the restore, so their latency can increase. NMI and HardFault aren't affected by PRIMASK.

API Reference

 Functions