3.2.9 DIAG_DSU
The DIAG_DSU module is designed to verify the correct functionality of the Device Service Unit (DSU) through a set of C function calls. DSU_CRCCalculate creates a checksum.
The DIAG_DSU software test API is mapped to the following safety mechanisms:
| Function | Diagnostic Mechanism | Use Case | Elasped Timer (μs) ~ |
|---|---|---|---|
| DIAG_DSU_CRCCalc() | DSU_CRC_CALCULATE | POST / OnDemand | 5574 |
| DIAG_DSU_CRCEnable() | DSU_CRC_ENABLE | POST / OnDemand | 4388 |
| DIAG_DSU_MBIST() | DSU_MBIST_READY | POST / OnDemand | 6588 |
| DIAG_DSU_SFRReset() | SFR_RESET_STATE | POST | 88 |
| DIAG_DSU_SFRWriteRead() | SFR_WRITE_READ | POST / OnDemand | 95 |
Configuring the Diagnostic
DIAG_DSU requires no additional configuration.
Run-time Pre-requisites
PAC_PeripheralProtectSetup( PAC_PERIPHERAL_DSU, PAC_PROTECTION_CLEAR) before all functions
DIAG_DSU_CRCEnable should be executed before DIAG_DSU_CRCCalc
Using the Diagnostic
#include "definitions.h"
DIAG_TEST_STATUS DIAG_DSU_SFRPost( void )
{
return DIAG_DSU_SFRReset(NULL, 0, false);
}
DIAG_TEST_STATUS DIAG_DSU_Post( void )
{
DIAG_TEST_STATUS result;
result = DIAG_DSU_CRCEnable();
if (result == DIAG_TEST_PASSED)
{
result = DIAG_DSU_CRCCalc();
if (result == DIAG_TEST_PASSED)
{
result = DIAG_DSU_MBISTReady();
}
}
return result;
}
void DIAG_DSU_Post_Pre()
{
// Check if all dependencies have been tested
PAC_PeripheralProtectSetup(PAC_PERIPHERAL_DSU, PAC_PROTECTION_CLEAR);
uint32_t crc = FLASH_CRC_SEED;
DSU_CRCCalculate(START_OF_FLASH, FLASH_SIZE, FLASH_CRC_SEED, (uint32_t *)&crc);
}
