The Safety Checkers (SC) Library provides productized APIs for ensuring the safety of TIFS, RM and PM modules.
Features Supported
The example demonstrates the usage of RM, PM and TIFS safety checker APIs.
- PM Safety Checker can be used to validate PSC/PLL configurations
- RM Safety Checkers can be used to validate RM module configurations
- TIFS Safety Checker can be used to verify the firewall configuration
Each of these configurations can be validated using the Golden Reference.
SysConfig Features
Features NOT Supported
Important Usage Guidelines
Steps to update board configuration for TIFS Safety Checkers:
- Add below lines to the file " ${mcu_plus_sdk}/source/drivers/sciclient/sciclient_default_boardcfg/{board}/sciclient_defaultBoardcfg_security.c"
.sa2ul_auth_cfg = {
.subhdr = {
.size = 0,
},
.auth_resource_owner = 0,
.enable_saul_psil_global_config_writes = 0x5A,
.safety_host_present = 0x5A,
},
- Note
- host_id = 0x1E for mcu-r5f
- Use the following commands to build the Boardcfg changes For GP and HS-FS
cd ${mcu_plus_sdk}/tools/sysfw/boardcfg/
make SOC={board}
cd ${mcu_plus_sdk}
make scrub SOC={board}
make all SOC={board}
For HS-SE cd ${mcu_plus_sdk}/tools/sysfw/boardcfg/
make SOC={board} DEVICE_TYPE=HS
cd ${mcu_plus_sdk}
make scrub SOC={board} DEVICE_TYPE=HS
make all SOC={board} DEVICE_TYPE=HS
Example Usage
The following shows an example of Safety Checkers API usage
Include the below file to access the APIs
#include <safety_checkers_common.h>
#include "tifs_checkers_fwl_config.h"
Get PM Checkers Register Configuration
Get RM Checkers Register Configuration
Request TIFS firewall open
Get TIFS Checkers Register Configuration
Place holder to verify and save configurations as Golden Reference
Verify the run time register configuration against the golden reference for each of the checkers.
numIter = 10;
while(numIter > 0)
{
if(
status == SAFETY_CHECKERS_SOK)
{
if (
status == SAFETY_CHECKERS_REG_DATA_MISMATCH)
{
SAFETY_CHECKERS_log("\n PSC Register Mismatch with Golden Reference\r\n");
}
if (
status == SAFETY_CHECKERS_REG_DATA_MISMATCH)
{
SAFETY_CHECKERS_log("\n PLL Register Mismatch with Golden Reference\r\n");
}
if (
status == SAFETY_CHECKERS_FAIL)
{
SAFETY_CHECKERS_log("\n PM register lock failed\r\n");
}
if (
status == SAFETY_CHECKERS_REG_DATA_MISMATCH)
{
SAFETY_CHECKERS_log("\n RM Register Mismatch with Golden Reference\r\n");
}
if (
status == SAFETY_CHECKERS_REG_DATA_MISMATCH)
{
SAFETY_CHECKERS_log("\n Firewall Register Mismatch with Golden Reference\r\n");
}
numIter--;
}
}
Request the TIFS to close firewall
API