Hi @luigi_sanpaolo,
SEMA42 must be used in conjunction with XRDC for resource protection, meaning hardware semaphores are used when XRDC, SEMA42 and VIRT_WRAPPER is used.
Recommendation is to use the Hardware Resource Isolation and Protection modules, which are described in chapters 8, 17 & 19 from the S32K3XX reference manual.
However, you can refer to the following application note: AN14715: Hardware Resource Isolation and Protection. Here is an excerpt from it, describing VIRT_WRAPPER initialization and usage:
- In the RM module, check "RM Enable Virtual Wrapper feature" to enable VIRT_WRAPPER
configuration.
- In the Virtual Wrapper submodule, configure the virtual addresses and ownership domains for each pad and register.
- In the XRDC module, assign the pad virtual addresses as peripherals to different domains.
- In the Dio module, check "Dio VirtWrapper Support" to enable the VIRT_WRAPPER feature for Dio and assign a Virt_Wrapper PDAC to each Dio channel.
- In the Port module, check "Port VirtWrapper Support" to enable the VIRT_WRAPPER feature for Port and assign a Virt_Wrapper PDAC to the MSCR and IMCR of each Port pin.
- To ensure pad protection takes effect, follow the initialization order:
VIRT_WRAPPER initialization → PORT initialization → XRDC initialization.
I suggest reading the Usage and error handling of VIRT_WRAPPER section, it notes the steps for configuration.
Best regards,
Julián