Configuring the System Crash Monitor for Multiple
Crashes
The System Crash Monitor (SCM) uses a limited-size flash driver. If you
want to save multiple crashes on the same flash partition, extra information
about the location and size of the flash blocks must be supplied to the system
at build time. This is done in the scmonitor.cpp
file.
#ifdef NO_MULTICRASHINFO
iMultiCrashInfo = NULL;
#else
iMultiCrashInfo = new SCMMultiCrashInfo();
TUint numberBlocks = KCrashLogSize / KCrashLogBlockSize;
for(TUint32 cnt = 0; cnt < numberBlocks; cnt++)
{
iMultiCrashInfo->AddBlock(
new SCMCrashBlockEntry(
cnt,
cnt * KCrashLogBlockSize,
KCrashLogBlockSize));
}
iDataSave->SetMultiCrashInfo(iMultiCrashInfo);
#endif
To allow multiple crashes, SCMonitor::iMultiCrashInfo
must
be initialised with the SCMConfiguration
object which holds a list
of memory blocks available on the flash.
The following parameters are passed to the constructor of
SCMCrashBlockEntry
:
-
Block number: Unique integer value.
-
Block Offset: Offset in bytes to the start of the flash block.
-
Block Size: The size of the flash block in bytes.
Set these parameter values from the variant flash driver values.
If SCMonitor::iMultiCrashInfo
is null, it results in saving
a single crash. Processing the subsequent crashes overwrites the existing
crashes. Attempts to save more crashes results in the first crash being
overwritten. To disable any multi-crash information configuration, the
NO_MULTICRASHINFO
macro can be defined in the variant's mmp file.