Documentation

Crash Info

Retrieve information about a target computer CPU exception

Description

Creates an object that reads a crash file from target computer

Some target computers contain hardware that can retain information in memory from before a software restart. If these computers also contain a hard drive, they can save crash data after a fatal error.

Caution

After a fatal error, do not restart the computer manually by using the boot or power switch. A manual restart prevents the computer from saving the crash data.

Twenty seconds after a fatal error, the target computer restarts itself and saves the crash data on the target computer hard drive. When the computer is running again, you can call the SimulinkRealTime.crashInfo function from the development computer to retrieve the crash data.

Properties

expand all

This property is read-only.

Structure with the following customer-relevant fields:

  • MATLABRelease — Version of MATLAB®

  • HasException1 if the CPU had an exception, otherwise 0

  • ModelName — Name of real-time application

  • MdlExecutionTime — Stop time of model

The remaining fields are for MathWorks® internal use only.

This property is read-only.

Structure with the following customer-relevant fields:

  • Found1 if the crash point was found, otherwise 0

  • Message — Message describing location, one of:

    • Found in model code

    • Failed to locate crash point in model code

    • Crash point is outside reachable address space

  • File — Name of crash source file

  • Line — Line number in source file

  • Function — Name of function that causes crash

The remaining field is for MathWorks internal use only.

The line number comes from the value that the program instruction pointer had when the kernel exception handler caught the fatal exception. The crash can come from a previous instruction and therefore from a previous line of code.

Structure with the following customer-relevant fields:

  • TargetTimeAtCrash — Time of crash, according to target computer clock

  • CurrentTargetTime — Time of call to get crash information, according to target computer clock

  • CurrentHostTime — Time of call to get crash information, according to development computer clock

Specifies the model build folder. If the current folder is not the build folder, you can set buildDir to a specific value. The object uses the build folder to locate the model files.

Object Functions

SimulinkRealTime.crashInfo.displayDisplay crash information
SimulinkRealTime.crashInfo.updateUpdate crash information object

Examples

expand all

Create a crashInfo object, get its properties, display crash information.

Wait for the target computer to restart itself and display the error message.

Error: Target computer halted with an exception and restarted
automatically. To get information about the exception, call
SimulinkRealTime.crashInfo from MATLAB.

Create a crashInfo object.

cinfo_object = SimulinkRealTime.crashInfo('TargetPC1')
Crash information object saved as C:\Users\AppData\Local\...
    Temp\SLRTCrashInfo_2016_28_20_56_00_33.mat

--------------- Crash report ------------------
Crash time:        28-Jun-2016 20:56:00. Current target ...
    computer time: 28-Jun-2016 20:58:00
Model:             testmodel
Crash address:     2003B643
Model base:        20030000
File:              c:\pdbparsing\test_sfun.c, line 106
Function:          mdlOutputs
Message:           Found in model code

For technical support, send the SLRTCrashInfo*.mat file to MathWorks Support (www.mathworks.com/support).

Introduced in R2016b

Was this topic helpful?