22.3.9 Error Injection
- System X has its proprietary mechanism to inject and clear errors, typically through writing to Test Control bit(s) in a register in the system/peripheral. The ECC error channels are examples of this. The ERRCTRL.ESFTEST output from the ERRCTRL is OR’ed with the module’s error signal (error) to make the modified error signal (error*) so the ERRCTRL can test its internal circuitry.
- System Y has no mechanism for injecting errors. The ERRCTRL.ESFTEST output from the ERRCTRL is OR’ed with the module’s error signal (error) to make the modified error signal (error*) so the ERRCTRL can test its internal circuitry.
Error injection as a diagnostic measure can have severe side effects on the system, depending on the severity level of the injected error. If the error is configured with severity level CRITICAL, injecting an error will cause the MCU to reset, which may not be desirable or possible in the system. This can be mitigated by temporarily reconfiguring the error channel to a severity level that has less severe side effects, such as NOTIFICATION, when performing the error injection, as follows:
- Place the ERRCTRL into CONFIG mode by writing to the ERRCTRL State (STATE) bit field in the Control A (ERRCTRL.CTRLA) register.
- Reconfigure the error channel to inject error into by writing its Error Severity Level (ERRLVL) bit field in the Error Source Control (ERRCTRL.ESCx) register to a less severe setting, e.g., NOTIFICATION.
- Leave CONFIG mode and enter NORMAL mode by writing to the STATE bit field in ERRCTRL.CTRLA.
- Inject the error and observe the response in the ERRCTRL.
- Clear any error flags at the source and in the Error Status Flags (ESF) register.
- Place the ERRCTRL into CONFIG mode by writing to the STATE bit field in ERRCTRL.CTRLA.
- Reconfigure the error channel to its original severity level by writing the ERRLVL bit field in ERRCTRL.ESCx to its original setting.
- Leave CONFIG mode and enter NORMAL mode by writing to ERRCTRL.CTRLA.
If the time required to perform the fault injection is less than the Timeout Value (ERRCTRL.TIMEOUT) register, or the timeout mechanism is disabled, the ERRCTRL can be in a CONFIG state during the entire operation, i.e., steps 3 and 6 can be omitted.