The PRA driver is used to protect the system from invalid configurations that could potentially cause the system to be unstable or indirectly allow access to registers and memory that are protected. This is done using several methods:
Allow access to non-critical registers that are protected by a fixed PPU.
On PSoC 64 devices, secure firmware protects entire regions of registers with the fixed PPUs, however there are some registers within that regions that should not be protected but, are protected due to fixed PPU granularity.
The list of the registers that can be accessed by PRA driver directly is defined in the cy_pra.h file with the CY_PRA_INDX_ prefix.
Most PDL drivers are not affected or use the PRA driver. Only the following PDL drivers are affected by this driver:
The execution time of the functions that access the protected registers is increased on the PSoC 64 devices because the access is performed on Cortex-M0+ via the IPC command (both CPU cores run at 8 MHz):
The PRA driver uses an IPC channel to transfer register data between the user application running on the Cortex-CM4 and the secure Cortex-CM0+ CPU. The secure processor performs the data validation and correct register write sequence to ensure proper stable operation of the system. Function status and requested data is also returned via the IPC channel.
The PDL driver that accesses protected registers, generates request to the PRA driver and it passes request over the IPC to secure Cortex-M0+, where request is validated and executed, and, then, reports result back to the driver on Cortex-M4 side.
For PSoC 64 device, device configuration (like system clock settings and power modes) is applied on the secure Cortex-M0+. The device configuration can be initiated from either of the core or both the cores. The device configuration structure cy_stc_pra_system_config_t is initialized with Device Configurator. For Cortext-M4 application, it passed to the secure Cortex-M0+ core through IPC for validation and register the update in the cybsp_init() function. For Cortext-M0+ application, this device configuration structure is directly validated and applied.
The PSoC 64 devices must be provisioned with the external clocks (ECO, WCO, and EXTCLK) configuration before routing these clocks to CLK_HF0. To do that, update the JSON file (delivered with CySecureTools) with the "extclk" node in the custom data section as shown below. The configuration fields in the JSON file match the fields in the Device Configurator.
For more details, refer to the PSoC 64 Secure MCU Secure Boot SDK User Guide.
The PSoC 64 devices must be provisioned with the SRAM power mode configuration to protects secure core memory. To do that, update the JSON file (delivered with CySecureTools) with the "srampwrmode" node in the custom data section as shown below.
For more details, refer to the PSoC 64 Secure MCU Secure Boot SDK User Guide.
If PDL is used in Standalone mode without Board Support Package (BSP), do the following:
See the device technical reference manual (TRM) reference manual (TRM) for the list of the protected registers.
Version | Changes | Reason for Change |
---|---|---|
2.40.1 | Coverity errors fixed. | Bug fixes. |
2.40 | Initialize internal data structure to initial values when external clock policy pointer is NULL to avoid null pointer de-referencing. | Defect fix. |
2.30 | System Configuration can be done from CM0+ using PRA API with CY_PRA_MSG_TYPE_SYS_CFG_FUNC and CY_PRA_FUNC_INIT_CYCFG_DEVICE arguments. | Enhancement based on customer feedback. |
System configuration structure is updated with appropriate value, when cm0+ application calls any PDL API accessing to FUNCTION_POLICY registers. | Enhancement based on customer feedback. | |
Fixed MISRA 2012 violations. | MISRA 2012 compliance. | |
Updated doxygen for External clock source to HF0. | Documentation enhancement. | |
2.20 | Allowing external clocks (EXT_CLK, ECO and WCO) can be source to secure core. Provide interface for validating and configuring SRAM power modes. | External clock support and SRAM power mode configuration support. |
2.10 | Removed include of cy_gpio.h from the driver's c source files. Added some source code comments. | Source code cleanup. |
Updated attribute usage for the linker section placement. | Enhancement based on usability feedback. | |
Fixed MISRA 2012 violations. | MISRA 2012 compliance. | |
2.0 | Added PSoC 64 CYB06xx7 devices support. | New devices support. |
Updated Cy_PRA_Init() to compare the major and minor version of the PRA driver on the Cortex-M0+ and Cortex-M4 sides and halt Cortex-M4 if the versions are different. | Ensure that the same PRA driver version is used on the Cortex-M0+ and Cortex-M4 sides. | |
Fixed the location of the cy_stc_pra_system_config_t description in the documentation. | Documentation update. | |
Corrected the reference to the SysTick (Arm® System Timer) function with the limitation description - Cy_SysTick_SetClockSource(). | Documentation update. | |
The state of the following clocks changes only when the requested state differs from the actual state in the hardware: HF1-HF5, TIMER, PUMP, BLE_ECO, ILO, PILO, and WCO. | Improved the Cy_PRA_SystemConfig() function execution time. | |
Renamed altHfFreq to altHFclkFreq in cy_stc_pra_system_config_t. | Eliminated the naming conflict with the SysClk driver. | |
1.0 | Initial version |
API Reference | |
Macros | |
Functions | |
Enumerated Types | |
Data Structures | |