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

General Description

Data Structures

struct  stl_ppu_entry_t
 Entry parameters for SelfTest_PPU(), supplied by the application. More...

Data Structure Documentation

◆ stl_ppu_entry_t

struct stl_ppu_entry_t
Data Fields
volatile uint32_t * testReg Address of a peripheral register that the CM0+-configured PPU policy denies to the protection context of the calling core.

The self-test attempts to write this register and expects the access to be denied. Must not be a register the test path itself depends on (for example the logging UART or stl_ppu_entry_t::faultStruct).

Because the write lands on the peripheral if the PPU is defective, the register must be harmless to write:

  • a plain read/write configuration register without write side effects (not write-1-to-clear, set/clear/invert, FIFO, command, or trigger registers), and
  • not a register that controls pins or a peripheral in use (for example GPIO_PRTx->OUT of a port driving external hardware). Prefer a register of an unused or disabled peripheral instance.

The register must be mapped for the calling core as shareable, bufferable Device memory: the default memory map (MPU disabled, or not covered by an enabled region with the default map as background), or an MPU region with the same attributes (TEX=0, C=0, B=1, ARM_MPU_ACCESS_DEVICE(1)). Do not map it Strongly-ordered (ARM_MPU_ACCESS_ORDERED): the denied write may then raise a BusFault, which escalates to HardFault. The MPU must also permit write access at the calling privilege level (and read access when stl_ppu_entry_t::checkIntegrity is true); otherwise a MemManage fault occurs before the PPU evaluates the access.

uint32_t writeValue Value the self-test attempts to write to stl_ppu_entry_t::testReg.

The write is expected to be denied, so the register content must not change. Denial detection (fault source and address) does not depend on this value.

When stl_ppu_entry_t::checkIntegrity is true, writeValue must differ from stl_ppu_entry_t::expectedValue in the implemented writable bits of testReg, otherwise a write leaking through the PPU cannot be detected. Equal values are rejected with ERROR_BAD_PARAM.

FAULT_STRUCT_Type * faultStruct Fault structure that captures the peripheral-protection violation.

The self-test reconfigures it and leaves it released on exit; the application must configure it again afterwards if it uses it (see SelfTest_PPU).

cy_en_SysFault_source_t expectedFault Expected SysFault source for the denied access: the CY_SYSFAULT_MS_PPU_* value for the calling core's master interface (device specific, for example CY_SYSFAULT_MS_PPU_1 for CM7_0 on XMC7200).

Must be below CY_SYSFAULT_NO_FAULT.

bool checkIntegrity Set true to verify data integrity: stl_ppu_entry_t::testReg must stay readable at the calling core's protection context (write denied, read allowed).

The self-test then reads the register before and after the denied write and requires both reads to equal stl_ppu_entry_t::expectedValue.

Set false only for a read-denied testReg. The register content is then not verified by the self-test; data integrity for that register must be verified by the application from a protection context with read access, or addressed in the application safety analysis.

uint32_t expectedValue Value stl_ppu_entry_t::testReg must hold before and after the denied write.

Applicable only when stl_ppu_entry_t::checkIntegrity is true.