ModusToolbox Safety Test Library
Loading...
Searching...
No Matches

General Description

Data Structures

struct  stl_smpu_entry_t
 Entry parameters for SelfTest_SMPU(), supplied by the application. More...

Data Structure Documentation

◆ stl_smpu_entry_t

struct stl_smpu_entry_t
Data Fields
volatile uint32_t * testAddress First word of a dedicated SMPU_TEST_BLOCK_BYTES block, aligned to SMPU_TEST_BLOCK_BYTES, in non-cacheable memory.

The block must hold no other data and no stack. Every access to the block from the active protection context is denied while the test runs.

uint32_t expectedValue Value stl_smpu_entry_t::testAddress must hold before the test runs, for example 0x5A5A5A5A.

The application must prime the scratch word with this value before every call to SelfTest_SMPU(): if the write is not denied, stl_smpu_entry_t::writeValue remains in the scratch word.

uint32_t writeValue Value the self-test attempts to write.

Must differ from stl_smpu_entry_t::expectedValue.

PROT_SMPU_SMPU_STRUCT_Type * smpuStruct Low SMPU slave struct to borrow for the test.

It must be disabled when SelfTest_SMPU() is called. Its configuration is overwritten and left disabled after the test. High structs (13/14/15) are boot-reserved/locked and must not be used.

When enabled SMPU structs overlap, the highest-numbered one decides the access. A higher-numbered enabled struct that allows the active protection context over the scratch block therefore overrides the test struct: the write succeeds and SelfTest_SMPU() returns ERROR_STATUS, which cannot be differentiated from an SMPU defect. Make sure no higher-numbered enabled struct overlaps the scratch block.

uint32_t allowedPc Protection context the SMPU region allows, 1-7.

Must be different from the active PC of the core calling SelfTest_SMPU() so the access at the active PC is denied. The active PC must be non-zero (PC0 is unrestrictable and cannot be denied).

FAULT_STRUCT_Type * faultStruct Application-provided fault structure used to observe the SMPU CPUSS_MPU_VIO SysFault (for example FAULT_STRUCT0).
cy_en_SysFault_source_t expectedFault Device/area-specific expected SysFault source for a denied write to the tested memory area (for example CPUSS_MPU_VIO_14 for SRAM on XMC7200).

The self-test polls the fault structure STATUS for this source.