Infineon: Add cyw20829 platform, shared slot feature, json memory map, psoc6 xip
diff --git a/boot/cypress/MCUBootApp/MCUBootApp_CYW20829_Debug.launch b/boot/cypress/MCUBootApp/MCUBootApp_CYW20829_Debug.launch
new file mode 100644
index 0000000..3b3300a
--- /dev/null
+++ b/boot/cypress/MCUBootApp/MCUBootApp_CYW20829_Debug.launch
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType">
+ <stringAttribute key="com.cypress.studio.launch.mode" value="debug"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="true"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="false"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="true"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/>
+ <booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="true"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.firstResetType" value="init"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="/Users/rnok/Downloads/ASSETS/cyopenocd/openocd_4.3_1445/bin/openocd"/>
+ <intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-s "/Users/rnok/Downloads/ASSETS/cyopenocd/openocd_4.3_1445/scripts" -s "./libs/TARGET_PSVP-CYW20829/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource" -c "set SMIF_LOADER /Users/rnok/repos/cyw20829/AnyCloud_CYW20829_Blinky_App/./libs/TARGET_PSVP-CYW20829/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/CYW208xx_SMIF.FLM" -c "source [find interface/kitprog3.cfg]" -c "puts stderr {Started by GNU MCU Eclipse}" -c "source [find target/cyw208xx.cfg]" -c "cyw208xx.cm33 configure -rtos auto -rtos-wipe-on-reset-halt 1" -c "gdb_breakpoint_override hard" -c "init; reset init""/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/>
+ <intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherRunCommands" value="flushregs"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.secondResetType" value="init"/>
+ <stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value=""/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value="${cy_prj_path}/build/PSVP-CYW20829/Debug/mtb-example-anycloud-blinky.bin"/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU OpenOCD"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="false"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
+ <intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value="/Users/rnok/repos/cyw20829/cy_mcuboot/boot/cypress/MCUBootApp/out/CYW20829/Debug/MCUBootApp.elf"/>
+ <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="true"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="true"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="false"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="false"/>
+ <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
+ <stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cy_tools_path:CY_TOOL_arm-none-eabi-gdb_EXE}"/>
+ <booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
+ <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
+ <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
+ <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="/Users/rnok/repos/cyw20829/cy_mcuboot/boot/cypress/MCUBootApp/out/CYW20829/Debug/MCUBootApp.elf"/>
+ <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="MCUBootApp_CYW20829_Debug"/>
+ <booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
+ <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+ </listAttribute>
+ <stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/>
+ <stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/boot/cypress/coverity/all_files/cert-c-custom.config b/boot/cypress/coverity/all_files/cert-c-custom.config
new file mode 100644
index 0000000..8443bef
--- /dev/null
+++ b/boot/cypress/coverity/all_files/cert-c-custom.config
@@ -0,0 +1,8 @@
+{
+ "version": "2.0",
+ "standard": "cert-c",
+ "title": "CERT-C All Rules",
+ "deviations": [
+
+ ]
+}
diff --git a/boot/cypress/coverity/all_files/config_mcuboot_cert_c.json b/boot/cypress/coverity/all_files/config_mcuboot_cert_c.json
new file mode 100644
index 0000000..c0d4834
--- /dev/null
+++ b/boot/cypress/coverity/all_files/config_mcuboot_cert_c.json
@@ -0,0 +1,34 @@
+{
+ "script_config":{
+ "coding_standard":"CERT C",
+ "log_file":".\\coverity.log",
+ "coverity_path":"C:\\Program Files\\Coverity\\Coverity Static Analysis\\bin",
+ "report_to_testrail":false,
+ "report_to_coverity_server":false,
+ "project_source_path":".\\..\\..\\boot\\cypress",
+ "deviations_config":".\\..\\..\\boot\\cypress\\coverity\\all_files\\cert-c-custom.config",
+ "build_cmd":"make clean app POST_BUILD_ENABLE=0 APP_NAME=MCUBootApp PLATFORM=CYW20829",
+ "manual_clean":true,
+ "fail_condition":1
+ },
+ "coverity_config":{
+ "coverity_project_name":"mcuboot",
+ "coverity_stream_name":"develop",
+ "analyze_options":[
+ "--all"
+ ],
+ "compiler_type":"gcc",
+ "compiler":"arm-none-eabi-gcc",
+ "enable_checkers":[
+ "ENUM_AS_BOOLEAN",
+ "HFA"
+ ],
+ "disable_checkers":[
+ "SECURE_CODING",
+ "MISRA_CAST"
+ ],
+ "source_filter":[
+
+ ]
+ }
+}
diff --git a/boot/cypress/coverity/all_files/config_mcuboot_misra.json b/boot/cypress/coverity/all_files/config_mcuboot_misra.json
new file mode 100644
index 0000000..0dc6702
--- /dev/null
+++ b/boot/cypress/coverity/all_files/config_mcuboot_misra.json
@@ -0,0 +1,33 @@
+{
+ "script_config":{
+ "coding_standard":"MISRA",
+ "log_file":".\\coverity.log",
+ "coverity_path":"C:\\Program Files\\Coverity\\Coverity Static Analysis\\bin",
+ "report_to_testrail":false,
+ "report_to_coverity_server":false,
+ "project_source_path":".\\..\\..\\boot\\cypress",
+ "deviations_config":".\\..\\..\\boot\\cypress\\coverity\\all_files\\misrac2012_custom.config",
+ "build_cmd":"make clean app POST_BUILD_ENABLE=0 APP_NAME=MCUBootApp PLATFORM=CYW20829",
+ "manual_clean":true,
+ "fail_condition":1
+ },
+ "coverity_config":{
+ "coverity_project_name":"mcuboot",
+ "coverity_stream_name":"develop",
+ "analyze_options":[
+ "--all"
+ ],
+ "compiler_type":"gcc",
+ "compiler":"arm-none-eabi-gcc",
+ "enable_checkers":[
+ "ENUM_AS_BOOLEAN",
+ "HFA"
+ ],
+ "disable_checkers":[
+
+ ],
+ "source_filter":[
+
+ ]
+ }
+}
diff --git a/boot/cypress/coverity/all_files/misrac2012_custom.config b/boot/cypress/coverity/all_files/misrac2012_custom.config
new file mode 100644
index 0000000..55d963e
--- /dev/null
+++ b/boot/cypress/coverity/all_files/misrac2012_custom.config
@@ -0,0 +1,8 @@
+{
+ "version": "2.0",
+ "standard": "misrac2012",
+ "title": "MISRA C-2012 All Rules",
+ "deviations": [
+
+ ]
+}
diff --git a/boot/cypress/coverity/cyw20829/cert-c-custom.config b/boot/cypress/coverity/cyw20829/cert-c-custom.config
new file mode 100644
index 0000000..8443bef
--- /dev/null
+++ b/boot/cypress/coverity/cyw20829/cert-c-custom.config
@@ -0,0 +1,8 @@
+{
+ "version": "2.0",
+ "standard": "cert-c",
+ "title": "CERT-C All Rules",
+ "deviations": [
+
+ ]
+}
diff --git a/boot/cypress/coverity/cyw20829/config_mcuboot_cert_c.json b/boot/cypress/coverity/cyw20829/config_mcuboot_cert_c.json
new file mode 100644
index 0000000..2229aa5
--- /dev/null
+++ b/boot/cypress/coverity/cyw20829/config_mcuboot_cert_c.json
@@ -0,0 +1,578 @@
+{
+ "script_config":{
+ "coding_standard":"CERT C",
+ "log_file":".\\coverity.log",
+ "coverity_path":"C:\\Program Files\\Coverity\\Coverity Static Analysis\\bin",
+ "report_to_testrail":false,
+ "report_to_coverity_server":false,
+ "project_source_path":".\\..\\..\\boot\\cypress",
+ "deviations_config":".\\..\\..\\boot\\cypress\\coverity\\cyw20829\\cert-c-custom.config",
+ "build_cmd":"make clean app POST_BUILD_ENABLE=0 APP_NAME=MCUBootApp PLATFORM=CYW20829",
+ "manual_clean":false,
+ "fail_condition":2
+ },
+ "coverity_config":{
+ "coverity_project_name":"mcuboot",
+ "coverity_stream_name":"develop",
+ "analyze_options":[
+ "--all"
+ ],
+ "compiler_type":"gcc",
+ "compiler":"arm-none-eabi-gcc",
+ "enable_checkers":[
+ "ENUM_AS_BOOLEAN",
+ "HFA"
+ ],
+ "disable_checkers":[
+ "SECURE_CODING",
+ "MISRA_CAST"
+ ],
+ "source_filter":[
+ "boot/cypress/libs/mtb-pdl-cat1",
+ "boot/cypress/libs/mtb-hal-cat1",
+ "boot/cypress/libs/cy-mbedtls-acceleration",
+ "ext/mbedtls"
+ ]
+ },
+ "suppress_list":{
+ "/boot/cypress/libs/core-lib":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/cy-mbedtls-acceleration":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-hal-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-pdl-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/retarget-io":{ "reason":"Third-party library" },
+ "/ext/mbedtls":{ "reason":"Third-party library" },
+ "boot/bootutil/src/bootutil_misc.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "The operations were reviewed for possible wrap.",
+ "count": 14
+ },
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"image_index\" from \"int\" to \"unsigned long\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "image_index can only be a positive number.",
+ "count": 2
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_public.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "The operations were reviewed for possible wrap.",
+ "count": 9
+ },
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"flash_area_id\" from \"int\" to \"unsigned char\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "flash_area_id can only be a positive number.",
+ "count": 1,
+ "source_code": "rc = flash_area_open(flash_area_id, &fap);"
+ },
+ {
+ "message": "Casting \"(image_num << 4) | swap_type\" from \"int\" to \"unsigned char\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "All operands are always positive numbers.",
+ "count": 1,
+ "source_code": "BOOT_SET_SWAP_INFO(swap_info, image_num, swap_type);"
+ },
+ {
+ "message": "Casting \"image_index\" from \"int\" to \"unsigned long\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "image_index can only be a positive number.",
+ "count": 4
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/encrypted.c":{
+ "rules":{
+ "CERT INT31-C":{
+ "reason": "The results of the expresions were reviewed for not being misinterpreted.",
+ "count": 5
+ }
+ }
+ },
+ "boot/bootutil/src/image_validate.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "Violations were reviewed for possible wrap.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/loader.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "Violations were reviewed for possible wrap.",
+ "count": 2
+ },
+ "CERT INT31-C":{
+ "reason": "Violations were reviewed for correct interpretation.",
+ "count": 9
+ }
+ }
+ },
+ "boot/bootutil/src/tlv.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "violations":[
+ {
+ "message": "Unsigned integer operation \"it->tlv_off + 4UL\" may wrap.",
+ "reason": "The operation is reviewed for possible wrap.",
+ "count": 1,
+ "source_code": "*off = it->tlv_off + sizeof(tlv);"
+ },
+ {
+ "message": "Unsigned integer operation \"it->tlv_off += 4U + tlv.it_len\" may wrap.",
+ "reason": "The operation is reviewed for possible wrap.",
+ "count": 1,
+ "source_code": "it->tlv_off += sizeof(tlv) + tlv.it_len;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_scratch.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "Violations were reviewed for possible wrap.",
+ "count": 13
+ },
+ "CERT INT31-C":{
+ "reason": "Violations were reviewed for correct interpretation.",
+ "count": 4
+ },
+ "CERT INT32-C":{
+ "reason": "Violations were reviewed for possible overflow.",
+ "count": 2
+ }
+ }
+ },
+ "boot/bootutil/src/image_ec256.c":{
+ "rules":{
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"end - pubkey\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "The result of the expresion was reviewed for not being misinterpreted.",
+ "count": 1,
+ "source": "rc = bootutil_ecdsa_p256_verify(&ctx, pubkey, end - pubkey, hash, sig, slen);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_misc.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"((uint32_t)slot + 1UL) * 16UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return boot_swap_size_off(fap) - (((uint32_t)slot + 1UL) * (uint32_t)BOOT_ENC_KEY_SIZE);"
+ },
+ {
+ "message":"Unsigned integer operation \"boot_swap_size_off(fap) - ((uint32_t)slot + 1UL) * 16UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return boot_swap_size_off(fap) - (((uint32_t)slot + 1UL) * (uint32_t)BOOT_ENC_KEY_SIZE);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_part.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"4096UL * calc_rec_idx(offs)\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return BOOT_SWAP_STATUS_ROW_SZ * calc_rec_idx(offs);"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + i * 8192UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fin_offset = rec_offset + i * BOOT_SWAP_STATUS_D_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"copy_counter + 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t next_counter = copy_counter + 1U;"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + copy_num * 8192UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fin_offset = rec_offset + copy_num*BOOT_SWAP_STATUS_D_SIZE;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cy_security_cnt_platform.c":{
+ "rules":{
+ "CERT INT31-C": {
+ "violations":[
+ {
+ "message":"Casting \"FIH_FAILURE\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "return (fih_uint)FIH_FAILURE;"
+ },
+ {
+ "message":"Casting \"FIH_FAILURE\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "fih_uint nv_counter_secure = (fih_uint)FIH_FAILURE;"
+ },
+ {
+ "message":"Casting \"FIH_FAILURE\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "fih_uint security_cnt = (fih_uint) FIH_FAILURE;"
+ }
+ ]
+ },
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"j--\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "j--;"
+ },
+ {
+ "message":"Unsigned integer operation \"32UL - j\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "if ((MAX_SEC_COUNTER_VAL - j) == i) {"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cy_service_app.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"address % erase_size + len\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "(((address % erase_size) + len) > erase_size) ) {"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/utils/cyw_20829_utils.c":{
+ "rules":{
+ "CERT INT31-C": {
+ "violations":[
+ {
+ "message":"Casting \"c ^ stream_block[i]\" from \"int\" to \"unsigned char\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"False positive violation.",
+ "count":1,
+ "source_code": "*output++ = c ^ stream_block[i];"
+ },
+ {
+ "message":"Casting \"FIH_FAILURE\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "fih_uint l1_app_descr_addr = (fih_uint)FIH_FAILURE;"
+ },
+ {
+ "message":"Casting \"FIH_FAILURE\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "fih_uint ns_vect_tbl_addr = (fih_uint)FIH_FAILURE;"
+ }
+ ]
+ },
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"xip_addr += 16UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "xip_addr += BOOTUTIL_CRYPTO_AES_CTR_BLOCK_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fap->fa_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fa_addr = flash_base + fap->fa_off;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa_pri->fa_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fa_addr = flash_base + fa_pri->fa_off;"
+ },
+ {
+ "message":"Unsigned integer operation \"off += fa_addr - 1610612736UL + 134217728UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "off += CY_GET_XIP_REMAP_ADDR(fa_addr);"
+ },
+ {
+ "message":"Unsigned integer operation \"(uintptr_t)bootstrap_dst_addr + bootstrap_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fits_into((uintptr_t)bootstrap_dst_addr + bootstrap_size, 0,"
+ },
+ {
+ "message":"Unsigned integer operation \"fih_uint_decode(fih_uint_decode(toc2_addr) + bootstrap_src_addr) - 1610612736UL + 134217728UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "ns_vect_tbl_addr = CY_GET_XIP_REMAP_ADDR_FIH(fih_uint_decode(toc2_addr) + bootstrap_src_addr);"
+ },
+ {
+ "message":"Unsigned integer operation \"fih_uint_decode(toc2_addr) + bootstrap_src_addr\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "ns_vect_tbl_addr = CY_GET_XIP_REMAP_ADDR_FIH(fih_uint_decode(toc2_addr) + bootstrap_src_addr);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/main.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"flash_base + rsp->br_image_off + rsp->br_hdr->ih_hdr_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return fih_uint_encode(flash_base +"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + rsp->br_image_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return fih_uint_encode(flash_base +"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_cyw208xx/cy_flash_map.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off + off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "addr = flash_base + fa->fa_off + off;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "addr = flash_base + fa->fa_off + off;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off + off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "write_start_addr = flash_base + fa->fa_off + off;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "write_start_addr = flash_base + fa->fa_off + off;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off + off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "erase_start_addr = flash_base + fa->fa_off + off;"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "erase_start_addr = flash_base + fa->fa_off + off;"
+ },
+ {
+ "message":"Unsigned integer operation \"area_size + (sector_size - 1U)\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sectors_n = (area_size + (sector_size - 1U)) / sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"sector_size - 1U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sectors_n = (area_size + (sector_size - 1U)) / sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"my_sector_addr += my_sector_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "my_sector_addr += my_sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"area_size -= my_sector_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "area_size -= my_sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"sector_size *= 2U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sector_size *= 2u;"
+ },
+ {
+ "message":"Unsigned integer operation \"sectors_n++\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sectors_n++;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_cyw208xx/cy_smif_cyw20829.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"(uint32_t)addr - 1610612736UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":3
+ },
+ {
+ "message":"Unsigned integer operation \"eraseSize - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t address = ((uint32_t)addr - CY_XIP_BASE) & ~((uint32_t)(eraseSize - 1u));"
+ },
+ {
+ "message":"Unsigned integer operation \"address += eraseSize\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "address += eraseSize;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_cyw208xx/flash_qspi/cy_smif_hybrid_sect.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"length - 6U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "if(id[length - 6u] != SEMPER_ID_MANUF)"
+ },
+ {
+ "message":"Unsigned integer operation \"size--\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "size--;"
+ },
+ {
+ "message":"Unsigned integer operation \"size + startPos\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "byteArray[size + startPos] = (uint8_t)(value & PARAM_ID_LSB_MASK);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_cyw208xx/flash_qspi/flash_qspi.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"smif_id - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "Cy_GPIO_Port_Deinit(qspi_SS_Configuration[smif_id-1U].SS_Port);"
+ }
+ ]
+ }
+ }
+ },
+ "/boot/cypress/libs/watchdog/watchdog.c":{
+ "rules":{
+ "CERT INT31-C": {
+ "violations":[
+ {
+ "message":"Casting \"timeout - (1UL << 17U - ignore_bits) + Cy_WDT_GetCount()\" from \"unsigned long\" to \"unsigned short\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Used free-running WDT with a maximum of 16-bit resolution.",
+ "count":1,
+ "source_code": "return (uint16_t)(timeout - (1UL << (17U - ignore_bits)) + Cy_WDT_GetCount());"
+ }
+ ]
+ },
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"17U - ignore_bits\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return (uint16_t)(timeout - (1UL << (17U - ignore_bits)) + Cy_WDT_GetCount());"
+ },
+ {
+ "message":"Unsigned integer operation \"timeout - (1UL << 17U - ignore_bits)\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return (uint16_t)(timeout - (1UL << (17U - ignore_bits)) + Cy_WDT_GetCount());"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_priv.h":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"flash_sector_get_off(&state->imgs[0U][slot].sectors[sector]) - flash_sector_get_off(&state->imgs[0U][slot].sectors[0])\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return flash_sector_get_off(&BOOT_IMG(state, slot).sectors[sector]) -"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"bs->idx - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t off = (bs->idx - BOOT_STATUS_IDX_0) * elem_sz;"
+ },
+ {
+ "message":"Unsigned integer operation \"(bs->idx - 1UL) * elem_sz\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t off = (bs->idx - BOOT_STATUS_IDX_0) * elem_sz;"
+ }
+ ]
+ }
+ }
+ }
+ }
+}
diff --git a/boot/cypress/coverity/cyw20829/config_mcuboot_misra.json b/boot/cypress/coverity/cyw20829/config_mcuboot_misra.json
new file mode 100644
index 0000000..98ec021
--- /dev/null
+++ b/boot/cypress/coverity/cyw20829/config_mcuboot_misra.json
@@ -0,0 +1,897 @@
+{
+ "script_config":{
+ "coding_standard":"MISRA",
+ "log_file":".\\coverity.log",
+ "coverity_path":"C:\\Program Files\\Coverity\\Coverity Static Analysis\\bin",
+ "report_to_testrail":false,
+ "report_to_coverity_server":false,
+ "project_source_path":".\\..\\..\\boot\\cypress",
+ "deviations_config":".\\..\\..\\boot\\cypress\\coverity\\cyw20829\\misrac2012_custom.config",
+ "build_cmd":"make clean app POST_BUILD_ENABLE=0 APP_NAME=MCUBootApp PLATFORM=CYW20829",
+ "manual_clean":false,
+ "fail_condition":2
+ },
+ "coverity_config":{
+ "coverity_project_name":"mcuboot",
+ "coverity_stream_name":"develop",
+ "analyze_options":[
+ "--all"
+ ],
+ "compiler_type":"gcc",
+ "compiler":"arm-none-eabi-gcc",
+ "enable_checkers":[
+ "ENUM_AS_BOOLEAN",
+ "HFA"
+ ],
+ "disable_checkers":[
+
+ ],
+ "source_filter":[
+ "boot/cypress/libs/mtb-pdl-cat1",
+ "boot/cypress/libs/mtb-hal-cat1",
+ "boot/cypress/libs/cy-mbedtls-acceleration",
+ "ext/mbedtls"
+ ]
+ },
+ "suppress_list":{
+ "/boot/cypress/libs/core-lib":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/cy-mbedtls-acceleration":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-hal-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-pdl-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/retarget-io":{ "reason":"Third-party library" },
+ "/boot/cypress/keys":{ "reason":"Doesn't contain source code files" },
+ "ext/mbedtls":{ "reason":"Third-party library" },
+ "boot/cypress/MCUBootApp/os":{ "reason":"Third-party library" },
+ "boot/bootutil/include/bootutil":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 21.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 7
+ },
+ "MISRA C-2012 Rule 21.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 8
+ }
+ }
+ },
+ "boot/bootutil/src":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 21
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/fault_injection_hardening.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/crypto/aes_ctr.h":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/crypto/ecdsa_p256.h":{
+ "rules":{
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/crypto/ecdh_p256.h":{
+ "rules":{
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/config/mcuboot_crypto_config.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 56
+ },
+ "MISRA C-2012 Rule 21.1": {
+ "violations":[
+ {
+ "message":"Defining or undefining a reserved name \"_CRT_SECURE_NO_DEPRECATE\", which is an identifier or macro name beginning with an underscore.",
+ "reason":" _CRT_SECURE_NO_DEPRECATE cannot be renamed, because it is using in many files of the mbedtls library.",
+ "count":1,
+ "source_code": "#define _CRT_SECURE_NO_DEPRECATE 1"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/config/mcuboot_config/mcuboot_logging.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/cy_security_cnt.c":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/keys.c":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/main.c":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 10.4": {
+ "violations":[
+ {
+ "message":"Essential type of the left hand operand \"1\" (boolean) is not the same as that of the right operand \"fih_eq(fih_rc, FIH_SUCCESS)\"(signed).",
+ "reason":"fih_eq() is common MCUboot function.",
+ "count":1,
+ "source_code": "if (true == fih_eq(fih_rc, FIH_SUCCESS)) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "message": "Controlling expression \"!false\" is invariant.",
+ "reason": "A violation occurs on \"while (true)\" code",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 14
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/sysflash/sysflash.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/libs/watchdog":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 2
+ }
+ }
+ },
+ "boot/cypress/libs/watchdog/watchdog.h":{
+ "rules":{
+ "MISRA C-2012 Directive 4.10":{
+ "reason": "Violation appears on the included library .h files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_cyw208xx":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 2
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_cyw208xx/cy_flash_map.c":{
+ "rules":{
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 3
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/cy_flash_map.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "cy_flash_map.h is generated from json files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 21
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cybsp.h":{
+ "rules":{
+ "MISRA C-2012 Directive 4.10":{
+ "reason": "Violation appears on the included library .h files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cybsp_doc.h":{
+ "rules":{
+ "MISRA C-2012 Directive 4.10":{
+ "reason": "Violation appears on the included library .h files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cybsp_types.h":{
+ "rules":{
+ "MISRA C-2012 Directive 4.10":{
+ "reason": "Violation appears on the included library .h files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_misc.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 7
+ },
+ "MISRA C-2012 Rule 21.16":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 8.10":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 8.5":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_priv.h":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_public.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 26
+ },
+ "MISRA C-2012 Rule 11.8":{
+ "violations":[
+ {
+ "message": "The type cast of the pointer expression \"buffer\" to type \"uint8_t *\" removes \"const\" qualifier from the pointed to type.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (p = (uint8_t *)buffer; len-- > 0; p++) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The condition clause expression of the for loop has persistent side-effects.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (p = (uint8_t *)buffer; len-- > 0; p++) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "violations":[
+ {
+ "message": "The condition \"rc == 1\" must be true.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "if (rc == BOOT_HOOK_REGULAR)"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 16.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 16.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 8
+ },
+ "MISRA C-2012 Rule 7.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ }
+ },
+ "boot/bootutil/src/caps.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 10
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 5
+ },
+ "MISRA C-2012 Rule 12.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ }
+ }
+ },
+ "boot/bootutil/src/encrypted.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":7
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 19
+ },
+ "MISRA C-2012 Rule 11.8":{
+ "violations":[
+ {
+ "message": "The type cast of the pointer expression \"bootutil_enc_key.key\" to type \"uint8_t *\" removes \"const\" qualifier from the pointed to type.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "cp = (uint8_t *)bootutil_enc_key.key;"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The third clause of the for loop has more than one persistent side-effect.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (off = 0; len > 0; off += BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE, ++counter) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 5
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.14":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 7.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/image_ec256.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":1
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 11.8":{
+ "violations":[
+ {
+ "message": "The type cast of the pointer expression \"bootutil_keys[key_id].key\" to type \"uint8_t *\" removes \"const\" qualifier from the pointed to type.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "pubkey = (uint8_t *)bootutil_keys[key_id].key;"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 21.14":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 8.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/image_validate.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":6
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 11.9":{
+ "violations":[
+ {
+ "message": "Literal \"0\" shall not be used as null pointer constant.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The expression \"blk_sz\" used in the for loop clauses is modified in the loop body.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (off = 0; off < size; off += blk_sz) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "violations":[
+ {
+ "message": "The condition \"0\" cannot be true.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "if (!EXPECTED_SIG_LEN(len) || len > sizeof(buf)) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 21
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":4
+ },
+ "MISRA C-2012 Rule 8.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/loader.c":{
+ "rules":{
+ "MISRA C-2012 Directive 4.7":{
+ "reason": "REQUIRED violations will not be fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":43
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 38
+ },
+ "MISRA C-2012 Rule 11.6":{
+ "violations":[
+ {
+ "message": "The expression \"entry_val\" of type \"uintptr_t\" is cast to type \"void *\".",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "*entry = (void *) entry_val;"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 11.9":{
+ "violations":[
+ {
+ "message": "Literal \"0\" shall not be used as null pointer constant.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 13.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 13.5":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The first clause of the for loop is not empty, does not declare a loop counter or has a side-effect other than to set the loop counter.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (sect = 0, size = 0; sect < sect_count; sect++) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 7
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 22
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 20.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 15
+ },
+ "MISRA C-2012 Rule 21.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":33
+ },
+ "MISRA C-2012 Rule 5.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":1
+ },
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/swap_misc.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 36
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status.c":{
+ "rules":{
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 2
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_misc.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "violations":[
+ {
+ "message": "The expression \"1\" of non-boolean essential type is being interpreted as a boolean value for the operator \"? :\".",
+ "reason": "False-positive violation.",
+ "count": 1,
+ "source_code": "BOOT_SET_SWAP_INFO_M(swap_info, 0u, (uint8_t)BOOT_SWAP_TYPE_NONE);"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "violations":[
+ {
+ "message": "Essential type of the left hand operand \"32U\" (signed) is not the same as that of the right operand \"1U\"(unsigned).",
+ "reason": "MCUBOOT_MAX_IMG_SECTORS is passed as make parameter.",
+ "count": 2
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "Ternary oprerator compares the constants.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 5
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_part.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "violations":[
+ {
+ "message": "Essential type of the left hand operand \"offset\" (signed) is not the same as that of the right operand \"2UL * 8192UL\"(unsigned).",
+ "reason": "BOOT_SWAP_STATUS_SIZE always has a value about a few kilobytes.",
+ "count": 1,
+ "source_code": "offset += BOOT_SWAP_STATUS_SIZE;"
+ },
+ {
+ "message": "Essential type of the left hand operand \"32U\" (signed) is not the same as that of the right operand \"1U\"(unsigned).",
+ "reason": "MCUBOOT_MAX_IMG_SECTORS is passed as make parameter.",
+ "count": 5
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "Ternary oprerator compares the constants.",
+ "count": 2
+ }
+ }
+ },
+ "boot/bootutil/src/swap_scratch.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":14
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 21
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 5
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":12
+ },
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ }
+ }
+ },
+ "boot/bootutil/src/tlv.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 19
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cy_security_cnt_platform.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4": {
+ "violations":[
+ {
+ "message":"Essential type of the left hand operand \"1\" (boolean) is not the same as that of the right operand \"fih_eq(fih_rc, FIH_SUCCESS)\"(signed).",
+ "reason":"fih_eq() is common MCUboot function.",
+ "count":1,
+ "source_code": "if (true == fih_eq(fih_rc, FIH_SUCCESS)) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "Violations occur in \"do { } while(false)\" pattern that is used in some macros of header files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/utils/cyw_20829_utils.c":{
+ "rules":{
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "Violations occur in \"do { } while(false)\" pattern that is used in some macros of header files.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 8.6":{
+ "reason": "hsiniFppAnuR_92802wyc is used in ASM code",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/utils/cyw_20829_utils.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.6":{
+ "reason": "Symbols are defined in linker script.",
+ "count": 8
+ }
+ }
+ },
+ "boot/cypress/platforms/CYW20829/cy_service_app.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4": {
+ "violations":[
+ {
+ "message":"Essential type of the left hand operand \"1610612736UL\" (unsigned) is not the same as that of the right operand \"491520\"(signed).",
+ "reason":"CY_XIP_BASE is defined in PDL. SERVICE_APP_INPUT_PARAMS_OFFSET is passed as make parameter.",
+ "count":1,
+ "source_code": "rc = flash_write_packet((CY_XIP_BASE + SERVICE_APP_INPUT_PARAMS_OFFSET),"
+ },
+ {
+ "message":"Essential type of the left hand operand \"1610612736UL\" (unsigned) is not the same as that of the right operand \"492544\"(signed).",
+ "reason":"CY_XIP_BASE is defined in PDL. SERVICE_APP_DESC_OFFSET is passed as make parameter.",
+ "count":1,
+ "source_code": "rc = flash_write_packet((CY_XIP_BASE + SERVICE_APP_DESC_OFFSET),"
+ },
+ {
+ "message":"Essential type of the left hand operand \"1610612736UL\" (unsigned) is not the same as that of the right operand \"492544\"(signed).",
+ "reason":"CY_XIP_BASE is defined in PDL. SERVICE_APP_INPUT_PARAMS_OFFSET is passed as make parameter.",
+ "count":1,
+ "source_code": "rc = flash_read((CY_XIP_BASE + SERVICE_APP_DESC_OFFSET),"
+ },
+ {
+ "message":"Essential type of the left hand operand \"1610612736UL\" (unsigned) is not the same as that of the right operand \"492544\"(signed).",
+ "reason":"CY_XIP_BASE is defined in PDL. SERVICE_APP_DESC_OFFSET is passed as make parameter.",
+ "count":1,
+ "source_code": "rc = cyw20829_smif_erase((CY_XIP_BASE + SERVICE_APP_DESC_OFFSET), qspi_get_erase_size());"
+ }
+ ]
+ }
+ }
+ }
+ }
+}
diff --git a/boot/cypress/coverity/cyw20829/misrac2012_custom.config b/boot/cypress/coverity/cyw20829/misrac2012_custom.config
new file mode 100644
index 0000000..55d963e
--- /dev/null
+++ b/boot/cypress/coverity/cyw20829/misrac2012_custom.config
@@ -0,0 +1,8 @@
+{
+ "version": "2.0",
+ "standard": "misrac2012",
+ "title": "MISRA C-2012 All Rules",
+ "deviations": [
+
+ ]
+}
diff --git a/boot/cypress/coverity/psoc062/cert-c-custom.config b/boot/cypress/coverity/psoc062/cert-c-custom.config
new file mode 100644
index 0000000..8443bef
--- /dev/null
+++ b/boot/cypress/coverity/psoc062/cert-c-custom.config
@@ -0,0 +1,8 @@
+{
+ "version": "2.0",
+ "standard": "cert-c",
+ "title": "CERT-C All Rules",
+ "deviations": [
+
+ ]
+}
diff --git a/boot/cypress/coverity/psoc062/config_mcuboot_cert_c.json b/boot/cypress/coverity/psoc062/config_mcuboot_cert_c.json
new file mode 100644
index 0000000..ce46968
--- /dev/null
+++ b/boot/cypress/coverity/psoc062/config_mcuboot_cert_c.json
@@ -0,0 +1,533 @@
+{
+ "script_config":{
+ "coding_standard":"CERT C",
+ "log_file":".\\coverity.log",
+ "coverity_path":"C:\\Program Files\\Coverity\\Coverity Static Analysis\\bin",
+ "report_to_testrail":false,
+ "report_to_coverity_server":false,
+ "project_source_path":".\\..\\..\\boot\\cypress",
+ "deviations_config":".\\..\\..\\boot\\cypress\\coverity\\psoc062\\cert-c-custom.config",
+ "build_cmd":"make clean app POST_BUILD_ENABLE=0 APP_NAME=MCUBootApp PLATFORM=PSOC_062_2M",
+ "manual_clean":false,
+ "fail_condition":2
+ },
+ "coverity_config":{
+ "coverity_project_name":"mcuboot",
+ "coverity_stream_name":"develop",
+ "analyze_options":[
+ "--all"
+ ],
+ "compiler_type":"gcc",
+ "compiler":"arm-none-eabi-gcc",
+ "enable_checkers":[
+ "ENUM_AS_BOOLEAN",
+ "HFA"
+ ],
+ "disable_checkers":[
+ "SECURE_CODING",
+ "MISRA_CAST"
+ ],
+ "source_filter":[
+ "boot/cypress/libs/mtb-pdl-cat1",
+ "boot/cypress/libs/mtb-hal-cat1",
+ "boot/cypress/libs/cy-mbedtls-acceleration",
+ "ext/mbedtls"
+ ]
+ },
+ "suppress_list":{
+ "/boot/cypress/libs/core-lib":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/cy-mbedtls-acceleration":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-hal-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-pdl-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/retarget-io":{ "reason":"Third-party library" },
+ "/ext/mbedtls":{ "reason":"Third-party library" },
+ "boot/bootutil/src/bootutil_misc.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "The operations were reviewed for possible wrap.",
+ "count": 14
+ },
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"image_index\" from \"int\" to \"unsigned long\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "image_index can only be a positive number.",
+ "count": 2
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_public.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "The operations were reviewed for possible wrap.",
+ "count": 9
+ },
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"flash_area_id\" from \"int\" to \"unsigned char\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "flash_area_id can only be a positive number.",
+ "count": 1,
+ "source_code": "rc = flash_area_open(flash_area_id, &fap);"
+ },
+ {
+ "message": "Casting \"(image_num << 4) | swap_type\" from \"int\" to \"unsigned char\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "All operands are always positive numbers.",
+ "count": 1,
+ "source_code": "BOOT_SET_SWAP_INFO(swap_info, image_num, swap_type);"
+ },
+ {
+ "message": "Casting \"image_index\" from \"int\" to \"unsigned long\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "image_index can only be a positive number.",
+ "count": 4
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/encrypted.c":{
+ "rules":{
+ "CERT INT31-C":{
+ "reason": "The results of the expresions were reviewed for not being misinterpreted.",
+ "count": 5
+ }
+ }
+ },
+ "boot/bootutil/src/image_validate.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "Violations were reviewed for possible wrap.",
+ "count": 4
+ },
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"image_index\" from \"int\" to \"unsigned long\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "image_index is always a positive number.",
+ "count": 1,
+ "source_code": "if (MUST_DECRYPT(fap, image_index, hdr) &&"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/loader.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "Violations were reviewed for possible wrap.",
+ "count": 5
+ },
+ "CERT INT31-C":{
+ "reason": "Violations were reviewed for correct interpretation.",
+ "count": 12
+ }
+ }
+ },
+ "boot/bootutil/src/tlv.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "violations":[
+ {
+ "message": "Unsigned integer operation \"it->tlv_off + 4UL\" may wrap.",
+ "reason": "The operation is reviewed for possible wrap.",
+ "count": 1,
+ "source_code": "*off = it->tlv_off + sizeof(tlv);"
+ },
+ {
+ "message": "Unsigned integer operation \"it->tlv_off += 4U + tlv.it_len\" may wrap.",
+ "reason": "The operation is reviewed for possible wrap.",
+ "count": 1,
+ "source_code": "it->tlv_off += sizeof(tlv) + tlv.it_len;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_scratch.c":{
+ "rules":{
+ "CERT INT30-C":{
+ "reason": "Violations were reviewed for possible wrap.",
+ "count": 13
+ },
+ "CERT INT31-C":{
+ "reason": "Violations were reviewed for correct interpretation.",
+ "count": 4
+ },
+ "CERT INT32-C":{
+ "reason": "Violations were reviewed for possible overflow.",
+ "count": 6
+ }
+ }
+ },
+ "boot/bootutil/src/image_ec256.c":{
+ "rules":{
+ "CERT INT31-C":{
+ "violations":[
+ {
+ "message": "Casting \"end - pubkey\" from \"int\" to \"unsigned int\" without checking its value may result in lost or misinterpreted data.",
+ "reason": "The result of the expresion was reviewed for not being misinterpreted.",
+ "count": 1,
+ "source": "rc = bootutil_ecdsa_p256_verify(&ctx, pubkey, end - pubkey, hash, sig, slen);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_misc.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"((uint32_t)slot + 1UL) * 16UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return boot_swap_size_off(fap) - (((uint32_t)slot + 1UL) * (uint32_t)BOOT_ENC_KEY_SIZE);"
+ },
+ {
+ "message":"Unsigned integer operation \"boot_swap_size_off(fap) - ((uint32_t)slot + 1UL) * 16UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return boot_swap_size_off(fap) - (((uint32_t)slot + 1UL) * (uint32_t)BOOT_ENC_KEY_SIZE);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_part.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"512UL * calc_rec_idx(offs)\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return BOOT_SWAP_STATUS_ROW_SZ * calc_rec_idx(offs);"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + i * 2560UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":2,
+ "source_code": "fin_offset = rec_offset + i * BOOT_SWAP_STATUS_D_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + i * 1024UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":2,
+ "source_code": "fin_offset = rec_offset + i * BOOT_SWAP_STATUS_D_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"crc_fail++\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "crc_fail++;"
+ },
+ {
+ "message":"Unsigned integer operation \"magic_fail++\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "magic_fail++;"
+ },
+ {
+ "message":"Unsigned integer operation \"copy_counter + 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t next_counter = copy_counter + 1U;"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + copy_num * 2560UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fin_offset = rec_offset + copy_num*BOOT_SWAP_STATUS_D_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + copy_num * 1024UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fin_offset = rec_offset + copy_num*BOOT_SWAP_STATUS_D_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offs += 512UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "rec_offs += BOOT_SWAP_STATUS_ROW_SZ;"
+ },
+ {
+ "message":"Unsigned integer operation \"fap->fa_size - primary_trailer_buf_sz\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "rc= flash_area_erase(fap, fap->fa_size - primary_trailer_buf_sz, primary_trailer_buf_sz);"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + i * 1536UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":2,
+ "source_code": "fin_offset = rec_offset + i * BOOT_SWAP_STATUS_D_SIZE;"
+ },
+ {
+ "message":"Unsigned integer operation \"rec_offset + copy_num * 1536UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "fin_offset = rec_offset + copy_num*BOOT_SWAP_STATUS_D_SIZE;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/main.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"flash_base + rsp->br_image_off + rsp->br_hdr->ih_hdr_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return fih_uint_encode(flash_base +"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + rsp->br_image_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return fih_uint_encode(flash_base +"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_psoc6/cy_flash_map.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off + off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":5
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":5
+ },
+ {
+ "message":"Unsigned integer operation \"flash_base + fa->fa_off + off + len\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":2
+ },
+ {
+ "message":"Unsigned integer operation \"write_end_addr - write_start_addr\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "row_number = (write_end_addr - write_start_addr) / CY_FLASH_SIZEOF_ROW;"
+ },
+ {
+ "message":"Unsigned integer operation \"erase_start_addr / 512U * 512U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t row_start_addr = (erase_start_addr / CY_FLASH_SIZEOF_ROW) * CY_FLASH_SIZEOF_ROW;"
+ },
+ {
+ "message":"Unsigned integer operation \"erase_end_addr / 512U * 512U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t row_end_addr = (erase_end_addr / CY_FLASH_SIZEOF_ROW) * CY_FLASH_SIZEOF_ROW;"
+ },
+ {
+ "message":"Unsigned integer operation \"area_size + (sector_size - 1U)\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sectors_n = (area_size + (sector_size - 1U)) / sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"sector_size - 1U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sectors_n = (area_size + (sector_size - 1U)) / sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"sector_size *= 2U\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sector_size *= 2u;"
+ },
+ {
+ "message":"Unsigned integer operation \"my_sector_addr += my_sector_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "my_sector_addr += my_sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"area_size -= my_sector_size\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "area_size -= my_sector_size;"
+ },
+ {
+ "message":"Unsigned integer operation \"sectors_n++\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "sectors_n++;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_psoc6/cy_smif_psoc6.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"(uint32_t)addr - 402653184UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":3
+ },
+ {
+ "message":"Unsigned integer operation \"memCfg->deviceCfg->eraseSize - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "address = ((uint32_t)addr - CY_SMIF_BASE_MEM_OFFSET ) & ~((uint32_t)(memCfg->deviceCfg->eraseSize - 1u));"
+ },
+ {
+ "message":"Unsigned integer operation \"address += memCfg->deviceCfg->eraseSize\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "address += memCfg->deviceCfg->eraseSize;"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_psoc6/flash_qspi/flash_qspi.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"smif_id - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "Cy_GPIO_Port_Deinit(qspi_SS_Configuration[smif_id-1U].SS_Port);"
+ }
+ ]
+ }
+ }
+ },
+ "/boot/cypress/libs/watchdog/watchdog.c":{
+ "rules":{
+ "CERT INT31-C": {
+ "violations":[
+ {
+ "message":"Casting \"timeout - (1UL << 17U - ignore_bits) + Cy_WDT_GetCount()\" from \"unsigned long\" to \"unsigned short\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Used free-running WDT with a maximum of 16-bit resolution.",
+ "count":1,
+ "source_code": "return (uint16_t)(timeout - (1UL << (17U - ignore_bits)) + Cy_WDT_GetCount());"
+ }
+ ]
+ },
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"17U - ignore_bits\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return (uint16_t)(timeout - (1UL << (17U - ignore_bits)) + Cy_WDT_GetCount());"
+ },
+ {
+ "message":"Unsigned integer operation \"timeout - (1UL << 17U - ignore_bits)\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "return (uint16_t)(timeout - (1UL << (17U - ignore_bits)) + Cy_WDT_GetCount());"
+ }
+ ]
+ }
+ }
+ },
+ "/boot/cypress/libs/retarget_io_pdl/cy_retarget_io_pdl.c":{
+ "rules":{
+ "CERT INT31-C": {
+ "violations":[
+ {
+ "message":"Casting \"cy_retarget_io_getchar()\" from \"unsigned char\" to \"char\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "*ptr = (char)cy_retarget_io_getchar();"
+ },
+ {
+ "message":"Casting \"c\" from \"char\" to \"unsigned char\" without checking its value may result in lost or misinterpreted data.",
+ "reason":"Type cast was reviewed for correctness.",
+ "count":1,
+ "source_code": "count = Cy_SCB_UART_Put(CYBSP_UART_HW, (uint8_t)c);"
+ }
+ ]
+ },
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"Cy_SysClk_ClkPeriGetFrequency() * (1UL << frac_bits) + baudrate * oversample_value / 2UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "divider = ((Cy_SysClk_ClkPeriGetFrequency() * (1UL << frac_bits)) + ((baudrate * oversample_value) / 2U)) / (baudrate * oversample_value) - 1U;"
+ },
+ {
+ "message":"Unsigned integer operation \"baudrate * oversample_value\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "divider = ((Cy_SysClk_ClkPeriGetFrequency() * (1UL << frac_bits)) + ((baudrate * oversample_value) / 2U)) / (baudrate * oversample_value) - 1U;"
+ },
+ {
+ "message":"Unsigned integer operation \"(Cy_SysClk_ClkPeriGetFrequency() * (1UL << frac_bits) + baudrate * oversample_value / 2UL) / (baudrate * oversample_value) - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "divider = ((Cy_SysClk_ClkPeriGetFrequency() * (1UL << frac_bits)) + ((baudrate * oversample_value) / 2U)) / (baudrate * oversample_value) - 1U;"
+ },
+ {
+ "message":"Unsigned integer operation \"10UL * cy_delayFreqKhz\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "Cy_SysLib_DelayCycles(10U * cy_delayFreqKhz);"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_priv.h":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"flash_sector_get_off(&state->imgs[state->curr_img_idx][slot].sectors[sector]) - flash_sector_get_off(&state->imgs[state->curr_img_idx][slot].sectors[0])\" may wrap.",
+ "reason":"L2 C-CERT violations are not fixed in common MCUboot source files.",
+ "count":1,
+ "source_code": "return flash_sector_get_off(&BOOT_IMG(state, slot).sectors[sector]) -"
+ },
+ {
+ "message":"Unsigned integer operation \"flash_sector_get_off(&state->imgs[0U][slot].sectors[sector]) - flash_sector_get_off(&state->imgs[0U][slot].sectors[0])\" may wrap.",
+ "reason":"L2 C-CERT violations are not fixed in common MCUboot source files.",
+ "count":1,
+ "source_code": "return flash_sector_get_off(&BOOT_IMG(state, slot).sectors[sector]) -"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status.c":{
+ "rules":{
+ "CERT INT30-C": {
+ "violations":[
+ {
+ "message":"Unsigned integer operation \"bs->idx - 1UL\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t off = (bs->idx - BOOT_STATUS_IDX_0) * elem_sz;"
+ },
+ {
+ "message":"Unsigned integer operation \"(bs->idx - 1UL) * elem_sz\" may wrap.",
+ "reason":"The operations were reviewed for possible overflow. All of them either performed with static data or checked (limited) prior to the operation.",
+ "count":1,
+ "source_code": "uint32_t off = (bs->idx - BOOT_STATUS_IDX_0) * elem_sz;"
+ }
+ ]
+ }
+ }
+ }
+ }
+}
diff --git a/boot/cypress/coverity/psoc062/config_mcuboot_misra.json b/boot/cypress/coverity/psoc062/config_mcuboot_misra.json
new file mode 100644
index 0000000..776096e
--- /dev/null
+++ b/boot/cypress/coverity/psoc062/config_mcuboot_misra.json
@@ -0,0 +1,894 @@
+{
+ "script_config":{
+ "coding_standard":"MISRA",
+ "log_file":".\\coverity.log",
+ "coverity_path":"C:\\Program Files\\Coverity\\Coverity Static Analysis\\bin",
+ "report_to_testrail":false,
+ "report_to_coverity_server":false,
+ "project_source_path":".\\..\\..\\boot\\cypress",
+ "deviations_config":".\\..\\..\\boot\\cypress\\coverity\\psoc062\\misrac2012-custom.config",
+ "build_cmd":"make clean app POST_BUILD_ENABLE=0 APP_NAME=MCUBootApp PLATFORM=PSOC_062_2M",
+ "manual_clean":false,
+ "fail_condition":2
+ },
+ "coverity_config":{
+ "coverity_project_name":"mcuboot",
+ "coverity_stream_name":"develop",
+ "analyze_options":[
+ "--all"
+ ],
+ "compiler_type":"gcc",
+ "compiler":"arm-none-eabi-gcc",
+ "enable_checkers":[
+ "ENUM_AS_BOOLEAN",
+ "HFA"
+ ],
+ "disable_checkers":[
+
+ ],
+ "source_filter":[
+ "boot/cypress/libs/mtb-pdl-cat1",
+ "boot/cypress/libs/mtb-hal-cat1",
+ "boot/cypress/libs/cy-mbedtls-acceleration",
+ "ext/mbedtls"
+ ]
+ },
+ "suppress_list":{
+ "/boot/cypress/libs/core-lib":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/cy-mbedtls-acceleration":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-hal-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/mtb-pdl-cat1":{ "reason":"Third-party library" },
+ "/boot/cypress/libs/retarget-io":{ "reason":"Third-party library" },
+ "/boot/cypress/keys":{ "reason":"Doesn't contain source code files" },
+ "ext/mbedtls":{ "reason":"Third-party library" },
+ "boot/cypress/MCUBootApp/os":{ "reason":"Third-party library" },
+ "boot/bootutil/include/bootutil":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 21.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 7
+ },
+ "MISRA C-2012 Rule 21.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 10
+ }
+ }
+ },
+ "boot/bootutil/src":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 21
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/fault_injection_hardening.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/crypto/aes_ctr.h":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/ramload.h":{
+ "rules":{
+ "MISRA C-2012 Rule 21.2":{
+ "violations":[
+ {
+ "message":"\"__RAMLOAD_H__\", an identifier or macro name beginning with an underscore, shall not be declared.",
+ "reason":"REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":1,
+ "source_code": "#define __RAMLOAD_H__"
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/crypto/ecdsa_p256.h":{
+ "rules":{
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/crypto/ecdh_p256.h":{
+ "rules":{
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/image.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/include/bootutil/enc_key.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 8
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/config/mcuboot_crypto_config.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 56
+ },
+ "MISRA C-2012 Rule 21.1": {
+ "violations":[
+ {
+ "message":"Defining or undefining a reserved name \"_CRT_SECURE_NO_DEPRECATE\", which is an identifier or macro name beginning with an underscore.",
+ "reason":" _CRT_SECURE_NO_DEPRECATE cannot be renamed, because it is using in many files of the mbedtls library.",
+ "count":1,
+ "source_code": "#define _CRT_SECURE_NO_DEPRECATE 1"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/config/mcuboot_config/mcuboot_logging.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/config/custom_debug_uart_cfg.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/cy_security_cnt.c":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/keys.c":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/MCUBootApp/main.c":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The mcuboot_crypto_config.h file is based on mbedtls config template file.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 10.4": {
+ "violations":[
+ {
+ "message":"Essential type of the left hand operand \"1\" (boolean) is not the same as that of the right operand \"fih_eq(fih_rc, FIH_SUCCESS)\"(signed).",
+ "reason":"fih_eq() is common MCUboot function.",
+ "count":1,
+ "source_code": "if (true == fih_eq(fih_rc, FIH_SUCCESS)) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "message": "Controlling expression \"!false\" is invariant.",
+ "reason": "A violation occurs on \"while (true)\" code",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 14
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/sysflash/sysflash.h":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/libs/watchdog":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 2
+ }
+ }
+ },
+ "boot/cypress/libs/watchdog/watchdog.h":{
+ "rules":{
+ "MISRA C-2012 Directive 4.10":{
+ "reason": "Violation appears on the included library .h files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_psoc6":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 4
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_psoc6/cy_flash_map.c":{
+ "rules":{
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 3
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 10.8":{
+ "reason": "The constant is defined in PDL library",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "violations":[
+ {
+ "message": "Execution cannot reach this statement: \";\".",
+ "reason": "The violation occurs on while {true}.",
+ "count": 1,
+ "source_code": "FIH_PANIC; /* There is no appropriate error code */"
+ }
+ ]
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/cy_flash_map.h":{
+ "rules":{
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "cy_flash_map.h is generated from json files.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/cy_flash_pal/flash_psoc6/flash_qspi/flash_qspi.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "The function and \"anonymous enum\" are defined in PDL library",
+ "count": 5
+ }
+ }
+ },
+ "boot/cypress/libs/retarget_io_pdl/cy_retarget_io_pdl.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "The function and \"anonymous enum\" are defined in PDL library",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 21.2":{
+ "reason": "_read(), _write() replace the default implementation in \"newlibc\".",
+ "count": 4
+ }
+ }
+ },
+ "boot/cypress/libs/retarget_io_pdl/cy_retarget_io_pdl.h":{
+ "rules":{
+ "MISRA C-2012 Directive 4.10":{
+ "reason": "Violation appears on the included library .h files.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 1
+ }
+ }
+ },
+ "boot/cypress/platforms/PSOC6/cycfg_system.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "The function and \"anonymous enum\" are defined in PDL library",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "The identifiers are defined in PDL library",
+ "count": 8
+ }
+ }
+ },
+ "boot/cypress/platforms/PSOC6":{
+ "rules":{
+ "MISRA C-2012 Rule 3.1":{
+ "reason": "The violations occur on the \"http://...\" substring in the comments.",
+ "count": 21
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_misc.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 10
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 7
+ },
+ "MISRA C-2012 Rule 21.16":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 8.10":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 8.5":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_priv.h":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/bootutil_public.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 26
+ },
+ "MISRA C-2012 Rule 11.8":{
+ "violations":[
+ {
+ "message": "The type cast of the pointer expression \"buffer\" to type \"uint8_t *\" removes \"const\" qualifier from the pointed to type.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (p = (uint8_t *)buffer; len-- > 0; p++) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The condition clause expression of the for loop has persistent side-effects.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (p = (uint8_t *)buffer; len-- > 0; p++) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "violations":[
+ {
+ "message": "The condition \"rc == 1\" must be true.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "if (rc == BOOT_HOOK_REGULAR)"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 16.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 16.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 8
+ },
+ "MISRA C-2012 Rule 7.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ }
+ },
+ "boot/bootutil/src/caps.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 10
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 5
+ },
+ "MISRA C-2012 Rule 12.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ }
+ }
+ },
+ "boot/bootutil/src/encrypted.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":7
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 19
+ },
+ "MISRA C-2012 Rule 11.8":{
+ "violations":[
+ {
+ "message": "The type cast of the pointer expression \"bootutil_enc_key.key\" to type \"uint8_t *\" removes \"const\" qualifier from the pointed to type.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "cp = (uint8_t *)bootutil_enc_key.key;"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The third clause of the for loop has more than one persistent side-effect.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (off = 0; len > 0; off += BOOTUTIL_CRYPTO_SHA256_DIGEST_SIZE, ++counter) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 5
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.14":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 7.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/image_ec256.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":1
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 11.8":{
+ "violations":[
+ {
+ "message": "The type cast of the pointer expression \"bootutil_keys[key_id].key\" to type \"uint8_t *\" removes \"const\" qualifier from the pointed to type.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "pubkey = (uint8_t *)bootutil_keys[key_id].key;"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 21.14":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 8.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/image_validate.c":{
+ "rules":{
+ "MISRA C-2012 Rule 2.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 9
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":6
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 11.9":{
+ "violations":[
+ {
+ "message": "Literal \"0\" shall not be used as null pointer constant.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The expression \"blk_sz\" used in the for loop clauses is modified in the loop body.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (off = 0; off < size; off += blk_sz) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "violations":[
+ {
+ "message": "The condition \"0\" cannot be true.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "if (!EXPECTED_SIG_LEN(len) || len > sizeof(buf)) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 21
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":4
+ },
+ "MISRA C-2012 Rule 8.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/loader.c":{
+ "rules":{
+ "MISRA C-2012 Directive 4.7":{
+ "reason": "REQUIRED violations will not be fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 12
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":48
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 58
+ },
+ "MISRA C-2012 Rule 11.6":{
+ "violations":[
+ {
+ "message": "The expression \"entry_val\" of type \"uintptr_t\" is cast to type \"void *\".",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "*entry = (void *) entry_val;"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 11.9":{
+ "violations":[
+ {
+ "message": "Literal \"0\" shall not be used as null pointer constant.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 13.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 13.5":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 14.2":{
+ "violations":[
+ {
+ "message": "The first clause of the for loop is not empty, does not declare a loop counter or has a side-effect other than to set the loop counter.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1,
+ "source_code": "for (sect = 0, size = 0; sect < sect_count; sect++) {"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 7
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 22
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 16.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 16.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 17.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 2.2":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 20.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 15
+ },
+ "MISRA C-2012 Rule 21.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":33
+ },
+ "MISRA C-2012 Rule 5.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":1
+ },
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ },
+ "boot/bootutil/src/swap_misc.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 36
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status.c":{
+ "rules":{
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 2
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_misc.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "violations":[
+ {
+ "message": "The expression \"1\" of non-boolean essential type is being interpreted as a boolean value for the operator \"? :\".",
+ "reason": "False-positive violation.",
+ "count": 1,
+ "source_code": "BOOT_SET_SWAP_INFO_M(swap_info, 0u, (uint8_t)BOOT_SWAP_TYPE_NONE);"
+ }
+ ]
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "BOOT_IMAGE_NUMBER is defined in common MCUboot source file",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "Ternary oprerator compares the constants.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "violations":[
+ {
+ "message": "Using function \"fprintf\".",
+ "reason": "fprintf function, which is used in default logging implementation of mcuboot is a part of standard input/output library",
+ "count": 5
+ }
+ ]
+ }
+ }
+ },
+ "boot/bootutil/src/swap_status_part.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "BOOT_IMAGE_NUMBER is defined in common MCUboot source file",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "Ternary oprerator compares the constants.",
+ "count": 8
+ }
+ }
+ },
+ "boot/bootutil/src/swap_scratch.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.1":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 4
+ },
+ "MISRA C-2012 Rule 10.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":16
+ },
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 22
+ },
+ "MISRA C-2012 Rule 14.3":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 6
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "message": "No non-empty terminating \"else\" statement.",
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 2
+ },
+ "MISRA C-2012 Rule 20.9":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 5
+ },
+ "MISRA C-2012 Rule 21.6":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count":12
+ },
+ "MISRA C-2012 Rule 8.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ }
+ }
+ },
+ "boot/bootutil/src/tlv.c":{
+ "rules":{
+ "MISRA C-2012 Rule 10.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 19
+ },
+ "MISRA C-2012 Rule 14.4":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 3
+ },
+ "MISRA C-2012 Rule 15.7":{
+ "reason": "REQUIRED violations are not fixed in common MCUboot source code.",
+ "count": 1
+ }
+ }
+ }
+ }
+}
diff --git a/boot/cypress/coverity/psoc062/misrac2012-custom.config b/boot/cypress/coverity/psoc062/misrac2012-custom.config
new file mode 100644
index 0000000..55d963e
--- /dev/null
+++ b/boot/cypress/coverity/psoc062/misrac2012-custom.config
@@ -0,0 +1,8 @@
+{
+ "version": "2.0",
+ "standard": "misrac2012",
+ "title": "MISRA C-2012 All Rules",
+ "deviations": [
+
+ ]
+}
diff --git a/boot/cypress/cppcheck/MCUBootApp/ignore_files.list b/boot/cypress/cppcheck/MCUBootApp/ignore_files.list
new file mode 100644
index 0000000..22c4abd
--- /dev/null
+++ b/boot/cypress/cppcheck/MCUBootApp/ignore_files.list
@@ -0,0 +1,16 @@
+../../ext/mbedtls/crypto/library
+../../ext/mbedtls/library
+libs/mtb-pdl-cat1/devices/COMPONENT_CAT1A/templates/COMPONENT_MTB/COMPONENT_CM0P
+libs/mtb-pdl-cat1/devices/COMPONENT_CAT1A/source
+libs/mtb-pdl-cat1/drivers/source
+libs/mtb-pdl-cat1/devices/COMPONENT_CAT1B/templates/COMPONENT_MTB/COMPONENT_CM33/non-secure
+libs/mtb-pdl-cat1/devices/COMPONENT_CAT1B/source
+libs/mtb-hal-cat1/COMPONENT_PSOC6HAL/source
+libs/mtb-hal-cat1/COMPONENT_PSOC6HAL/COMPONENT_CAT1B/source
+libs/mtb-hal-cat1/COMPONENT_PSOC6HAL/COMPONENT_CAT1B/source/pin_packages
+libs/mtb-hal-cat1/COMPONENT_PSOC6HAL/COMPONENT_CAT1B/source/triggers
+../../ext/mbedtls/include/mbedtls/check_config.h
+boot/cypress/libs/mtb-pdl-cat1/drivers/include/cy_smif.h
+boot/cypress/libs/mtb-pdl-cat1/cmsis/include/cmsis_gcc.h
+boot/cypress/libs/mtb-pdl-cat1/drivers/include/cy_mcwdt.h
+ext/mbedtls/include/mbedtls/check_config.h
\ No newline at end of file
diff --git a/boot/cypress/cppcheck/MCUBootApp/suppress_messages.list b/boot/cypress/cppcheck/MCUBootApp/suppress_messages.list
new file mode 100644
index 0000000..7585e88
--- /dev/null
+++ b/boot/cypress/cppcheck/MCUBootApp/suppress_messages.list
@@ -0,0 +1,5 @@
+severity@id@message@file@line
+style@constVariable@Variable 'primary_slot_sectors' can be declared with const@boot/bootutil/src/loader.c@1984:33
+style@constVariable@Variable 'secondary_slot_sectors' can be declared with const@boot/bootutil/src/loader.c@1985:33
+style@redundantInitialization@Redundant initialization for 'align'. The initialized value is overwritten before it is read.@boot/bootutil/src/swap_status_part.c@439:11
+style@knownConditionTrueFalse@Condition 'rc!=0' is always false@boot/bootutil/src/loader.c@1198:12
diff --git a/boot/cypress/cppcheck/MCUBootApp/suppress_types.list b/boot/cypress/cppcheck/MCUBootApp/suppress_types.list
new file mode 100644
index 0000000..97431f4
--- /dev/null
+++ b/boot/cypress/cppcheck/MCUBootApp/suppress_types.list
@@ -0,0 +1,7 @@
+missingInclude
+variableScope
+unusedFunction
+duplicateValueTernary
+unreadVariable
+redundantInitialization
+unmatchedSuppression
diff --git a/boot/cypress/cppcheck/cppcheck-htmlreport.py b/boot/cypress/cppcheck/cppcheck-htmlreport.py
new file mode 100644
index 0000000..afc7380
--- /dev/null
+++ b/boot/cypress/cppcheck/cppcheck-htmlreport.py
@@ -0,0 +1,696 @@
+#! /usr/bin/python3
+
+from __future__ import unicode_literals
+
+import io
+import sys
+import optparse
+import os
+import operator
+
+from collections import Counter
+from pygments import highlight
+from pygments.lexers import guess_lexer_for_filename
+from pygments.formatters import HtmlFormatter
+from xml.sax import parse as xml_parse
+from xml.sax import SAXParseException as XmlParseException
+from xml.sax.handler import ContentHandler as XmlContentHandler
+from xml.sax.saxutils import escape
+"""
+Turns a cppcheck xml file into a browsable html report along
+with syntax highlighted source code.
+"""
+
+STYLE_FILE = """
+body {
+ font: 13px Arial, Verdana, Sans-Serif;
+ margin: 0;
+ width: auto;
+}
+
+h1 {
+ margin: 10px;
+}
+
+#footer > p {
+ margin: 4px;
+}
+
+.error {
+ background-color: #ffb7b7;
+}
+
+.error2 {
+ background-color: #faa;
+ border: 1px dotted black;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+.inconclusive {
+ background-color: #B6B6B4;
+}
+
+.inconclusive2 {
+ background-color: #B6B6B4;
+ border: 1px dotted black;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+div.verbose {
+ display: inline-block;
+ vertical-align: top;
+ cursor: help;
+}
+
+div.verbose div.content {
+ display: none;
+ position: absolute;
+ padding: 10px;
+ margin: 4px;
+ max-width: 40%;
+ white-space: pre-wrap;
+ border: 1px solid black;
+ background-color: #FFFFCC;
+ cursor: auto;
+}
+
+.highlight .hll {
+ padding: 1px;
+}
+
+#header {
+ border-bottom: thin solid #aaa;
+}
+
+#menu {
+ float: left;
+ margin-top: 5px;
+ text-align: left;
+ width: 150px;
+ height: 75%;
+ position: fixed;
+ overflow: auto;
+ z-index: 1;
+}
+
+#menu_index {
+ float: left;
+ margin-top: 5px;
+ padding-left: 5px;
+ text-align: left;
+ width: 200px;
+ height: 75%;
+ position: fixed;
+ overflow: auto;
+ z-index: 1;
+}
+
+#menu > a {
+ display: block;
+ margin-left: 10px;
+ font: 12px;
+ z-index: 1;
+}
+
+#filename {
+ margin-left: 10px;
+ font: 12px;
+ z-index: 1;
+}
+
+.highlighttable {
+ background-color:white;
+ z-index: 10;
+ position: relative;
+ margin: -10 px;
+}
+
+#content {
+ background-color: white;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ float: left;
+ margin: 5px;
+ margin-left: 10px;
+ padding: 0 10px 10px 10px;
+ width: 80%;
+ padding-left: 150px;
+}
+
+#content_index {
+ background-color: white;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ float: left;
+ margin: 5px;
+ margin-left: 10px;
+ padding: 0 10px 10px 10px;
+ width: 80%;
+ padding-left: 200px;
+}
+
+.linenos {
+ border-right: thin solid #aaa;
+ color: lightgray;
+ padding-right: 6px;
+}
+
+#footer {
+ border-top: thin solid #aaa;
+ clear: both;
+ font-size: 90%;
+ margin-top: 5px;
+}
+
+#footer ul {
+ list-style-type: none;
+ padding-left: 0;
+}
+"""
+
+HTML_HEAD = """
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - %s</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+%s
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - %s: %s </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> %s</p>
+"""
+
+HTML_HEAD_END = """
+ </div>
+ <div id="content">
+"""
+
+HTML_FOOTER = """
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck %s - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ <p>
+ </div>
+ </body>
+</html>
+"""
+
+HTML_ERROR = "<span class='error2'><--- %s</span>\n"
+HTML_INCONCLUSIVE = "<span class='inconclusive2'><--- %s</span>\n"
+
+HTML_EXPANDABLE_ERROR = "<div class='verbose expandable'><span class='error2'><--- %s <span class='marker'>[+]</span></span><div class='content'>%s</div></div>\n"""
+HTML_EXPANDABLE_INCONCLUSIVE = "<div class='verbose expandable'><span class='inconclusive2'><--- %s <span class='marker'>[+]</span></span><div class='content'>%s</div></div>\n"""
+
+# escape() and unescape() takes care of &, < and >.
+html_escape_table = {
+ '"': """,
+ "'": "'"
+}
+html_unescape_table = {v: k for k, v in html_escape_table.items()}
+
+
+def html_escape(text):
+ return escape(text, html_escape_table)
+
+
+class AnnotateCodeFormatter(HtmlFormatter):
+ errors = []
+
+ def wrap(self, source, outfile):
+ line_no = 1
+ for i, t in HtmlFormatter.wrap(self, source, outfile):
+ # If this is a source code line we want to add a span tag at the
+ # end.
+ if i == 1:
+ for error in self.errors:
+ if error['line'] == line_no:
+ try:
+ if error['inconclusive'] == 'true':
+ # only print verbose msg if it really differs
+ # from actual message
+ if error.get('verbose') and (error['verbose'] != error['msg']):
+ index = t.rfind('\n')
+ t = t[:index] + HTML_EXPANDABLE_INCONCLUSIVE % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
+ else:
+ t = t.replace('\n', HTML_INCONCLUSIVE % error['msg'])
+ except KeyError:
+ if error.get('verbose') and (error['verbose'] != error['msg']):
+ index = t.rfind('\n')
+ t = t[:index] + HTML_EXPANDABLE_ERROR % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
+ else:
+ t = t.replace('\n', HTML_ERROR % error['msg'])
+
+ line_no = line_no + 1
+ yield i, t
+
+
+class CppCheckHandler(XmlContentHandler):
+
+ """Parses the cppcheck xml file and produces a list of all its errors."""
+
+ def __init__(self):
+ XmlContentHandler.__init__(self)
+ self.errors = []
+ self.version = '1'
+ self.versionCppcheck = ''
+
+ def startElement(self, name, attributes):
+ if name == 'results':
+ self.version = attributes.get('version', self.version)
+
+ if self.version == '1':
+ self.handleVersion1(name, attributes)
+ else:
+ self.handleVersion2(name, attributes)
+
+ def handleVersion1(self, name, attributes):
+ if name != 'error':
+ return
+
+ self.errors.append({
+ 'file': attributes.get('file', ''),
+ 'line': int(attributes.get('line', 0)),
+ 'locations': [{
+ 'file': attributes.get('file', ''),
+ 'line': int(attributes.get('line', 0)),
+ }],
+ 'id': attributes['id'],
+ 'severity': attributes['severity'],
+ 'msg': attributes['msg']
+ })
+
+ def handleVersion2(self, name, attributes):
+ if name == 'cppcheck':
+ self.versionCppcheck = attributes['version']
+ if name == 'error':
+ error = {
+ 'locations': [],
+ 'file': '',
+ 'line': 0,
+ 'id': attributes['id'],
+ 'severity': attributes['severity'],
+ 'msg': attributes['msg'],
+ 'verbose': attributes.get('verbose')
+ }
+
+ if 'inconclusive' in attributes:
+ error['inconclusive'] = attributes['inconclusive']
+ if 'cwe' in attributes:
+ error['cwe'] = attributes['cwe']
+
+ self.errors.append(error)
+ elif name == 'location':
+ assert self.errors
+ error = self.errors[-1]
+ locations = error['locations']
+ file = attributes['file']
+ line = int(attributes['line'])
+ if not locations:
+ error['file'] = file
+ error['line'] = line
+ locations.append({
+ 'file': file,
+ 'line': line,
+ 'info': attributes.get('info')
+ })
+
+if __name__ == '__main__':
+ # Configure all the options this little utility is using.
+ parser = optparse.OptionParser()
+ parser.add_option('--title', dest='title',
+ help='The title of the project.',
+ default='[project name]')
+ parser.add_option('--file', dest='file',
+ help='The cppcheck xml output file to read defects '
+ 'from. Default is reading from stdin.')
+ parser.add_option('--report-dir', dest='report_dir',
+ help='The directory where the HTML report content is '
+ 'written.')
+ parser.add_option('--source-dir', dest='source_dir',
+ help='Base directory where source code files can be '
+ 'found.')
+ parser.add_option('--source-encoding', dest='source_encoding',
+ help='Encoding of source code.', default='utf-8')
+
+ # Parse options and make sure that we have an output directory set.
+ options, args = parser.parse_args()
+
+ try:
+ sys.argv[1]
+ except IndexError: # no arguments give, print --help
+ parser.print_help()
+ quit()
+
+ if not options.report_dir:
+ parser.error('No report directory set.')
+
+ # Get the directory where source code files are located.
+ source_dir = os.getcwd()
+ if options.source_dir:
+ source_dir = options.source_dir
+
+ # Get the stream that we read cppcheck errors from.
+ input_file = sys.stdin
+ if options.file:
+ if not os.path.exists(options.file):
+ parser.error('cppcheck xml file: %s not found.' % options.file)
+ input_file = io.open(options.file, 'r')
+ else:
+ parser.error('No cppcheck xml file specified. (--file=)')
+
+ # Parse the xml file and produce a simple list of errors.
+ print('Parsing xml report.')
+ try:
+ contentHandler = CppCheckHandler()
+ xml_parse(input_file, contentHandler)
+ except XmlParseException as msg:
+ print('Failed to parse cppcheck xml file: %s' % msg)
+ sys.exit(1)
+
+ # We have a list of errors. But now we want to group them on
+ # each source code file. Lets create a files dictionary that
+ # will contain a list of all the errors in that file. For each
+ # file we will also generate a HTML filename to use.
+ files = {}
+ file_no = 0
+ for error in contentHandler.errors:
+ filename = error['file']
+ if filename not in files.keys():
+ files[filename] = {
+ 'errors': [], 'htmlfile': str(file_no) + '.html'}
+ file_no = file_no + 1
+ files[filename]['errors'].append(error)
+
+ # Make sure that the report directory is created if it doesn't exist.
+ print('Creating %s directory' % options.report_dir)
+ if not os.path.exists(options.report_dir):
+ os.mkdir(options.report_dir)
+
+ # Generate a HTML file with syntax highlighted source code for each
+ # file that contains one or more errors.
+ print('Processing errors')
+
+ decode_errors = []
+ for filename, data in sorted(files.items()):
+ htmlfile = data['htmlfile']
+ errors = []
+
+ for error in data['errors']:
+ for location in error['locations']:
+ if filename == location['file']:
+ newError = dict(error)
+
+ del newError['locations']
+ newError['line'] = location['line']
+ if location.get('info'):
+ newError['msg'] = location['info']
+ newError['severity'] = 'information'
+ del newError['verbose']
+
+ errors.append(newError)
+
+ lines = []
+ for error in errors:
+ lines.append(error['line'])
+
+ if filename == '':
+ continue
+
+ source_filename = os.path.join(source_dir, filename)
+ try:
+ with io.open(source_filename, 'r', encoding=options.source_encoding) as input_file:
+ content = input_file.read()
+ except IOError:
+ if (error['id'] == 'unmatchedSuppression'):
+ continue # file not found, bail out
+ else:
+ sys.stderr.write("ERROR: Source file '%s' not found.\n" %
+ source_filename)
+ continue
+ except UnicodeDecodeError:
+ sys.stderr.write("WARNING: Unicode decode error in '%s'.\n" %
+ source_filename)
+ decode_errors.append(source_filename[2:]) # "[2:]" gets rid of "./" at beginning
+ continue
+
+ htmlFormatter = AnnotateCodeFormatter(linenos=True,
+ style='colorful',
+ hl_lines=lines,
+ lineanchors='line',
+ encoding=options.source_encoding)
+ htmlFormatter.errors = errors
+
+ with io.open(os.path.join(options.report_dir, htmlfile), 'w', encoding='utf-8') as output_file:
+ output_file.write(HTML_HEAD %
+ (options.title,
+ htmlFormatter.get_style_defs('.highlight'),
+ options.title,
+ filename,
+ filename.split('/')[-1]))
+
+ for error in sorted(errors, key=lambda k: k['line']):
+ output_file.write("<a href='%s#line-%d'> %s %s</a>" % (data['htmlfile'], error['line'], error['id'], error['line']))
+
+ output_file.write(HTML_HEAD_END)
+ try:
+ lexer = guess_lexer_for_filename(source_filename, '')
+ except:
+ sys.stderr.write("ERROR: Couldn't determine lexer for the file' " + source_filename + " '. Won't be able to syntax highlight this file.")
+ output_file.write("\n <tr><td colspan='4'> Could not generated content because pygments failed to retrieve the determine code type.</td></tr>")
+ output_file.write("\n <tr><td colspan='4'> Sorry about this.</td></tr>")
+ continue
+
+ if options.source_encoding:
+ lexer.encoding = options.source_encoding
+
+ output_file.write(
+ highlight(content, lexer, htmlFormatter).decode(
+ options.source_encoding))
+
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
+
+ print(' ' + filename)
+
+ # Generate a master index.html file that will contain a list of
+ # all the errors created.
+ print('Creating index.html')
+
+ with io.open(os.path.join(options.report_dir, 'index.html'),
+ 'w') as output_file:
+
+ stats_count = 0
+ stats = []
+ for filename, data in sorted(files.items()):
+ for error in data['errors']:
+ stats.append(error['id']) # get the stats
+ stats_count += 1
+
+ counter = Counter(stats)
+
+ stat_html = []
+ # the following lines sort the stat primary by value (occurrences),
+ # but if two IDs occur equally often, then we sort them alphabetically by warning ID
+ try:
+ cnt_max = counter.most_common()[0][1]
+ except IndexError:
+ cnt_max = 0
+
+ try:
+ cnt_min = counter.most_common()[-1][1]
+ except IndexError:
+ cnt_min = 0
+
+ stat_fmt = " <tr><td><input type='checkbox' onclick='toggle_class_visibility(this.id)' id='{}' name='{}' checked></td><td>{}</td><td>{}</td></tr>"
+ for occurrences in reversed(range(cnt_min, cnt_max + 1)):
+ for _id in [k for k, v in sorted(counter.items()) if v == occurrences]:
+ stat_html.append(stat_fmt.format(_id, _id, dict(counter.most_common())[_id], _id))
+
+ output_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defects:", "Defect summary;", 1) % (options.title, '', options.title, '', ''))
+ output_file.write(' <table>')
+ output_file.write(' <tr><th>Show</th><th>#</th><th>Defect ID</th></tr>')
+ output_file.write(''.join(stat_html))
+ output_file.write(' <tr><td></td><td>' + str(stats_count) + '</td><td>total</td></tr>')
+ output_file.write(' </table>')
+ output_file.write(' <a href="stats.html">Statistics</a></p>')
+ output_file.write(HTML_HEAD_END.replace("content", "content_index", 1))
+ output_file.write(' <table>\n')
+
+ output_file.write(
+ ' <tr><th>Line</th><th>Id</th><th>CWE</th><th>Severity</th><th>Message</th></tr>')
+ for filename, data in sorted(files.items()):
+ if filename in decode_errors: # don't print a link but a note
+ output_file.write("\n <tr><td colspan='4'>%s</td></tr>" % (filename))
+ output_file.write("\n <tr><td colspan='4'> Could not generated due to UnicodeDecodeError</td></tr>")
+ else:
+ if filename.endswith('*'): # assume unmatched suppression
+ output_file.write(
+ "\n <tr><td colspan='4'>%s</td></tr>" %
+ (filename))
+ else:
+ output_file.write(
+ "\n <tr><td colspan='4'><a href='%s'>%s</a></td></tr>" %
+ (data['htmlfile'], filename))
+
+ for error in sorted(data['errors'], key=lambda k: k['line']):
+ error_class = ''
+ try:
+ if error['inconclusive'] == 'true':
+ error_class = 'class="inconclusive"'
+ error['severity'] += ", inconcl."
+ except KeyError:
+ pass
+
+ try:
+ if error['cwe']:
+ cwe_url = "<a href='https://cwe.mitre.org/data/definitions/" + error['cwe'] + ".html'>" + error['cwe'] + "</a>"
+ except KeyError:
+ cwe_url = ""
+
+ if error['severity'] == 'error':
+ error_class = 'class="error"'
+ if error['id'] == 'missingInclude':
+ output_file.write(
+ '\n <tr class="%s"><td></td><td>%s</td><td></td><td>%s</td><td>%s</td></tr>' %
+ (error['id'], error['id'], error['severity'], error['msg']))
+ elif (error['id'] == 'unmatchedSuppression') and filename.endswith('*'):
+ output_file.write(
+ '\n <tr class="%s"><td></td><td>%s</td><td></td><td>%s</td><td %s>%s</td></tr>' %
+ (error['id'], error['id'], error['severity'], error_class,
+ error['msg']))
+ else:
+ output_file.write(
+ '\n <tr class="%s"><td><a href="%s#line-%d">%d</a></td><td>%s</td><td>%s</td><td>%s</td><td %s>%s</td></tr>' %
+ (error['id'], data['htmlfile'], error['line'], error['line'],
+ error['id'], cwe_url, error['severity'], error_class,
+ error['msg']))
+
+ output_file.write('\n </table>')
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
+
+ if (decode_errors):
+ sys.stderr.write("\nGenerating html failed for the following files: " + ' '.join(decode_errors))
+ sys.stderr.write("\nConsider changing source-encoding (for example: \"htmlreport ... --source-encoding=\"iso8859-1\"\"\n")
+
+ print('Creating style.css file')
+ with io.open(os.path.join(options.report_dir, 'style.css'),
+ 'w') as css_file:
+ css_file.write(STYLE_FILE)
+
+ print("Creating stats.html (statistics)\n")
+ stats_countlist = {}
+
+ for filename, data in sorted(files.items()):
+ if (filename == ''):
+ continue
+ stats_tmplist = []
+ for error in sorted(data['errors'], key=lambda k: k['line']):
+ stats_tmplist.append(error['severity'])
+
+ stats_countlist[filename] = dict(Counter(stats_tmplist))
+
+ # get top ten for each severity
+ SEVERITIES = "error", "warning", "portability", "performance", "style", "unusedFunction", "information", "missingInclude", "internal"
+
+ with io.open(os.path.join(options.report_dir, 'stats.html'), 'w') as stats_file:
+
+ stats_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defects:", "Back to summary", 1) % (options.title, '', options.title, 'Statistics', ''))
+ stats_file.write(HTML_HEAD_END.replace("content", "content_index", 1))
+
+ for sev in SEVERITIES:
+ _sum = 0
+ stats_templist = {}
+
+ # if the we have an style warning but we are checking for
+ # portability, we have to skip it to prevent KeyError
+ try:
+ for filename in stats_countlist:
+ try: # also bail out if we have a file with no sev-results
+ _sum += stats_countlist[filename][sev]
+ stats_templist[filename] = (int)(stats_countlist[filename][sev]) # file : amount,
+ except KeyError:
+ continue
+ # don't print "0 style" etc, if no style warnings were found
+ if (_sum == 0):
+ break
+ except KeyError:
+ continue
+ stats_file.write("<p>Top 10 files for " + sev + " severity, total findings: " + str(_sum) + "</br>\n")
+
+ # sort, so that the file with the most severities per type is first
+ stats_list_sorted = sorted(stats_templist.items(), key=operator.itemgetter(1, 0), reverse=True)
+ it = 0
+ LENGTH = 0
+
+ for i in stats_list_sorted: # printing loop
+ # for aesthetics: if it's the first iteration of the loop, get
+ # the max length of the number string
+ if (it == 0):
+ LENGTH = len(str(i[1])) # <- length of longest number, now get the difference and try to make other numbers align to it
+
+ stats_file.write(" " * 3 + str(i[1]) + " " * (1 + LENGTH - len(str(i[1]))) + "<a href=\"" + files[i[0]]['htmlfile'] + "\"> " + i[0] + "</a></br>\n")
+ it += 1
+ if (it == 10): # print only the top 10
+ break
+ stats_file.write("</p>\n")
+
+ print("\nOpen '" + options.report_dir + "/index.html' to see the results.")
diff --git a/boot/cypress/cppcheck/cppcheck.sh b/boot/cypress/cppcheck/cppcheck.sh
new file mode 100644
index 0000000..689e338
--- /dev/null
+++ b/boot/cypress/cppcheck/cppcheck.sh
@@ -0,0 +1,162 @@
+#!/bin/bash
+#
+# this must be the first non-commented line in this script. It ensures
+# bash doesn't choke on \r on Windows
+(set -o igncr) 2>/dev/null && set -o igncr; # this comment is needed
+
+#
+# This script does static code analysis using Cppcheck tool
+# Copyright (c) 2019 Cypress Semiconductor.
+#
+
+# It performs Cppcheck code analysis with following inputs
+# 1. CypressBootloader/sources - Code analysis is done on all the sources of CypressBootloader.
+# 2. Additional source files to be analyzed are grabbed from config file that is provided as a first argument to the script.
+# 3. Files to be ignored are grabbed from config file that is provided as a first argument to the script.
+# 4. To ignore a file its name need to be added to the config file with word "ignore" as perfix
+# 5. To add any additional files, apart the files from CypressBootloader/sources, those names need
+# to be added in a config file.
+# Example
+# A). add below entries in cpp_check.dat file
+# ignore cy_bootloader_hw.c
+# file1.c
+# file2.c
+# ignore cy_bootloader_services.c
+# B). invoke cpp_check shell script
+# cpp_check.sh cpp_check.dat
+#
+# Above example performs Cppcheck analysis on CypressBootloader/sources, ignore cy_bootloader_hw.c, file1.c, file2.c and ignores cy_bootloader_services.c
+
+
+app_name="$1"
+platform="$2"
+app_defines="$3"
+app_includes="$4"
+CPP_CHECK_FILES="$5"
+scope="$6"
+buildcfg="$7"
+
+if [[ ${scope} != "" ]]; then
+ SCOPE="--enable=${scope}"
+else
+ SCOPE=""
+fi
+
+#Retrieve list of files need to be ignored
+while IFS= read -r line
+do
+ CPP_CHECK_IGNORE_FILES="$CPP_CHECK_IGNORE_FILES -i $line"
+done < "cppcheck/${app_name}/ignore_files.list"
+
+#Retrieve list of cppcheck directives
+while IFS= read -r line
+do
+ CPP_CHECK_SUPPRESS="$CPP_CHECK_SUPPRESS --suppress=$line"
+done < "cppcheck/${app_name}/suppress_types.list"
+
+echo "-------------------------------------------"
+echo "Suppress options:" "$CPP_CHECK_SUPPRESS"
+echo "-------------------------------------------"
+echo "Additional files:" "$CPP_CHECK_FILES"
+echo "-------------------------------------------"
+echo "Ignoring files:" "$CPP_CHECK_IGNORE_FILES"
+echo "-------------------------------------------"
+echo "CppCheck scope of messages defined with option " ${SCOPE}
+echo "-------------------------------------------"
+echo "Run CppCheck for platform" ${platform}
+echo "-------------------------------------------"
+echo "Defines passed to CppCheck:"
+echo ${app_defines}
+echo "-------------------------------------------"
+echo "Include dirs passed to CppCheck:"
+echo ${app_includes}
+echo "-------------------------------------------"
+
+mkdir -p cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_html
+
+dos2unix cppcheck/${app_name}/suppress_messages.list
+
+dos2unix cppcheck/${app_name}/ignore_files.list
+
+#Generate file with list of additional files for cppcheck
+CPP_CHECK_FILES_LIST_FILE=cppcheck/${app_name}/cpp-check-files.list
+echo ${CPP_CHECK_FILES} | sed -e "s+ +\n+g" > ${CPP_CHECK_FILES_LIST_FILE}
+
+#Generate xml file
+cppcheck ${SCOPE} ${CPP_CHECK_SUPPRESS} -D__GNUC__ -D${platform} ${app_defines} ${app_includes} --file-list=${CPP_CHECK_FILES_LIST_FILE} ${CPP_CHECK_IGNORE_FILES} \
+ --xml 2> cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.xml
+
+#Generate html file
+python cppcheck/cppcheck-htmlreport.py --file=cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.xml --report-dir=cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_html --title=${app_name}
+
+cppcheck ${SCOPE} ${CPP_CHECK_SUPPRESS} -D__GNUC__ -D${platform} ${app_defines} ${app_includes} --file-list=${CPP_CHECK_FILES_LIST_FILE} ${CPP_CHECK_IGNORE_FILES} \
+ --template="{severity}\n{id}\n{message}\n{file}\n{line}:{column}\n{code}\n" 2> cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.full
+
+#Generate csv file
+echo "severity@id@message@file@line" > cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.csv
+while IFS= read -r line
+do
+ read -r line2
+ read -r line3
+ read -r line4
+ read -r line5
+ line4=$(echo $line4 | sed 's/.*\\cy_mcuboot\\//' | tr '\\' '/')
+ if grep -xq "${line}@${line2}@${line3}@${line4}@${line5}" cppcheck/${app_name}/suppress_messages.list
+ then
+ :;#suppress current warning
+ else
+ if grep -xq "${line4}" cppcheck/${app_name}/ignore_files.list
+ then
+ :;#suppress current warning
+ else
+ echo ${line}@${line2}@${line3}@${line4}@${line5}
+ fi
+ fi
+ read -r line
+ read -r line
+ read -r line
+done \
+< cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.full \
+>>cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.csv
+
+#Generate log file
+while IFS= read -r line
+do
+ read -r line2
+ read -r line3
+ read -r line4
+ read -r line5
+ line4=$(echo $line4 | sed 's/.*\\cy_mcuboot\\//' | tr '\\' '/')
+ if grep -xq "${line}@${line2}@${line3}@${line4}@${line5}" cppcheck/${app_name}/suppress_messages.list
+ then
+ read -r line
+ read -r line
+ read -r line
+ else
+ if grep -xq "${line4}" cppcheck/${app_name}/ignore_files.list
+ then
+ read -r line
+ read -r line
+ read -r line
+ else
+ echo ${line} : ${line2}
+ echo ${line3}
+ echo "${line4} (${line5})"
+ read -r line
+ echo ${line}
+ read -r line
+ echo ${line}
+ read -r line
+ echo "-------------------------------------------"
+ fi
+ fi
+done \
+< cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.full \
+> cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.log
+
+rm cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.full
+cat cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.log
+
+ERRORS=$(( $(wc -l cppcheck/${app_name}/results/${platform}/${buildcfg}/cppcheck_report_${scope}.csv | cut -d' ' -f1) -1 ))
+echo "${app_name} CPPCHECK FOR ${platform} KIT FOUND $ERRORS ERRORS"
+exit $ERRORS
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_multi2_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_multi2_psvp.json
new file mode 100644
index 0000000..f913ed7
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_multi2_psvp.json
@@ -0,0 +1,57 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xF000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6003E000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xF000"
+ }
+ },
+ "application_2": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x6002F000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xF000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6004D000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xF000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_single_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_single_psvp.json
new file mode 100644
index 0000000..8c98f08
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_single_psvp.json
@@ -0,0 +1,39 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0x20000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x60040000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0x20000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_multi2_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_multi2_psvp.json
new file mode 100644
index 0000000..42151c1
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_multi2_psvp.json
@@ -0,0 +1,73 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ },
+ "scratch_address": {
+ "description": "Address of the scratch area",
+ "value": "0x6007E000"
+ },
+ "scratch_size": {
+ "description": "Size of the scratch area",
+ "value": "0x2000"
+ },
+ "status_address": {
+ "description": "Address of the swap status partition",
+ "value": "0x6005C000"
+ },
+ "status_size": {
+ "description": "Size of the swap status partition",
+ "value": "0x1C000"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xF000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6003E000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xF000"
+ }
+ },
+ "application_2": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x6002F000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xF000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6004D000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xF000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_single_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_single_psvp.json
new file mode 100644
index 0000000..3fb2ac2
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_single_psvp.json
@@ -0,0 +1,55 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ },
+ "scratch_address": {
+ "description": "Address of the scratch area",
+ "value": "0x6007E000"
+ },
+ "scratch_size": {
+ "description": "Size of the scratch area",
+ "value": "0x2000"
+ },
+ "status_address": {
+ "description": "Address of the swap status partition",
+ "value": "0x60060000"
+ },
+ "status_size": {
+ "description": "Size of the swap status partition",
+ "value": "0xC000"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0x20000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x60040000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0x20000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_overwrite_multi2_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_overwrite_multi2_psvp.json
new file mode 100644
index 0000000..d226156
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_overwrite_multi2_psvp.json
@@ -0,0 +1,83 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ }
+ },
+ "service_app": {
+ "address": {
+ "description": "Address of the service application",
+ "value": "0x60070000"
+ },
+ "size": {
+ "description": "Size of the service application",
+ "value": "0x8000"
+ },
+ "params_address": {
+ "description": "Address of the service application input parameters",
+ "value": "0x60078000"
+ },
+ "params_size": {
+ "description": "Size of the service application input parameters",
+ "value": "0x400"
+ },
+ "desc_address": {
+ "description": "Address of the service application descriptor",
+ "value": "0x60078400"
+ },
+ "desc_size": {
+ "description": "Size of the service application descriptor",
+ "value": "0x20"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xF000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6003E000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xF000"
+ }
+ },
+ "application_2": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x6002F000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xF000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6004D000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xF000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_overwrite_single_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_overwrite_single_psvp.json
new file mode 100644
index 0000000..d46066d
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_overwrite_single_psvp.json
@@ -0,0 +1,65 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ }
+ },
+ "service_app": {
+ "address": {
+ "description": "Address of the service application",
+ "value": "0x60070000"
+ },
+ "size": {
+ "description": "Size of the service application",
+ "value": "0x8000"
+ },
+ "params_address": {
+ "description": "Address of the service application input parameters",
+ "value": "0x60078000"
+ },
+ "params_size": {
+ "description": "Size of the service application input parameters",
+ "value": "0x400"
+ },
+ "desc_address": {
+ "description": "Address of the service application descriptor",
+ "value": "0x60078400"
+ },
+ "desc_size": {
+ "description": "Size of the service application descriptor",
+ "value": "0x20"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0x20000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x60040000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0x20000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_swap_multi2_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_swap_multi2_psvp.json
new file mode 100644
index 0000000..7a64e43
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_swap_multi2_psvp.json
@@ -0,0 +1,99 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ },
+ "scratch_address": {
+ "description": "Address of the scratch area",
+ "value": "0x6007E000"
+ },
+ "scratch_size": {
+ "description": "Size of the scratch area",
+ "value": "0x2000"
+ },
+ "status_address": {
+ "description": "Address of the swap status partition",
+ "value": "0x60058000"
+ },
+ "status_size": {
+ "description": "Size of the swap status partition",
+ "value": "0x14000"
+ }
+ },
+ "service_app": {
+ "address": {
+ "description": "Address of the service application",
+ "value": "0x60070000"
+ },
+ "size": {
+ "description": "Size of the service application",
+ "value": "0x8000"
+ },
+ "params_address": {
+ "description": "Address of the service application input parameters",
+ "value": "0x60078000"
+ },
+ "params_size": {
+ "description": "Size of the service application input parameters",
+ "value": "0x400"
+ },
+ "desc_address": {
+ "description": "Address of the service application descriptor",
+ "value": "0x60078400"
+ },
+ "desc_size": {
+ "description": "Size of the service application descriptor",
+ "value": "0x20"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xE000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6003C000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xE000"
+ }
+ },
+ "application_2": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x6002E000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0xE000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x6004A000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0xE000"
+ }
+ }
+ }
+}
diff --git a/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_swap_single_psvp.json b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_swap_single_psvp.json
new file mode 100644
index 0000000..addeee1
--- /dev/null
+++ b/boot/cypress/cy_flash_pal/flash_cyw208xx/flashmap/hw_rollback_prot/cyw20829_xip_swap_single_psvp.json
@@ -0,0 +1,81 @@
+{
+ "external_flash": [
+ {
+ "model": "FM25W04",
+ "mode": "XIP"
+ }
+ ],
+ "boot_and_upgrade":
+ {
+ "bootloader": {
+ "address": {
+ "description": "Address of the bootloader",
+ "value": "0x60000000"
+ },
+ "size": {
+ "description": "Size of the bootloader",
+ "value": "0x20000"
+ },
+ "scratch_address": {
+ "description": "Address of the scratch area",
+ "value": "0x6007E000"
+ },
+ "scratch_size": {
+ "description": "Size of the scratch area",
+ "value": "0x2000"
+ },
+ "status_address": {
+ "description": "Address of the swap status partition",
+ "value": "0x60060000"
+ },
+ "status_size": {
+ "description": "Size of the swap status partition",
+ "value": "0xC000"
+ }
+ },
+ "service_app": {
+ "address": {
+ "description": "Address of the service application",
+ "value": "0x60070000"
+ },
+ "size": {
+ "description": "Size of the service application",
+ "value": "0x8000"
+ },
+ "params_address": {
+ "description": "Address of the service application input parameters",
+ "value": "0x60078000"
+ },
+ "params_size": {
+ "description": "Size of the service application input parameters",
+ "value": "0x400"
+ },
+ "desc_address": {
+ "description": "Address of the service application descriptor",
+ "value": "0x60078400"
+ },
+ "desc_size": {
+ "description": "Size of the service application descriptor",
+ "value": "0x20"
+ }
+ },
+ "application_1": {
+ "address": {
+ "description": "Address of the application primary slot",
+ "value": "0x60020000"
+ },
+ "size": {
+ "description": "Size of the application primary slot",
+ "value": "0x20000"
+ },
+ "upgrade_address": {
+ "description": "Address of the application secondary slot",
+ "value": "0x60040000"
+ },
+ "upgrade_size": {
+ "description": "Size of the application secondary slot",
+ "value": "0x20000"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/boot/cypress/platforms/CYW20829/cyw20829_psvp.h b/boot/cypress/platforms/CYW20829/cyw20829_psvp.h
new file mode 100644
index 0000000..65868c0
--- /dev/null
+++ b/boot/cypress/platforms/CYW20829/cyw20829_psvp.h
@@ -0,0 +1,916 @@
+/***************************************************************************//**
+* \file cyw20829_psvp.h
+*
+* \brief
+* CYW20829_PSVP device header
+*
+********************************************************************************
+* \copyright
+* (c) (2016-2021), Cypress Semiconductor Corporation (an Infineon company) or
+* an affiliate of Cypress Semiconductor Corporation.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*******************************************************************************/
+
+#ifndef _CYW20829_PSVP_H_
+#define _CYW20829_PSVP_H_
+
+/**
+* \addtogroup group_device CYW20829_PSVP
+* \{
+*/
+
+/**
+* \addtogroup Configuration_of_CMSIS
+* \{
+*/
+
+/*******************************************************************************
+* Interrupt Number Definition
+*******************************************************************************/
+
+typedef enum {
+ /* ARM Cortex-M33 Core Interrupt Numbers */
+ Reset_IRQn = -15, /*!< -15 Reset Vector, invoked on Power up and warm reset */
+ NonMaskableInt_IRQn = -14, /*!< -14 Non maskable Interrupt, cannot be stopped or preempted */
+ HardFault_IRQn = -13, /*!< -13 Hard Fault, all classes of Fault */
+ MemoryManagement_IRQn = -12, /*!< -12 Memory Management, MPU mismatch, including Access Violation and No Match */
+ BusFault_IRQn = -11, /*!< -11 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory related Fault */
+ UsageFault_IRQn = -10, /*!< -10 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
+ SecureFault_IRQn = -9, /*!< -9 Secure Fault Interrupt */
+ SVCall_IRQn = -5, /*!< -5 System Service Call via SVC instruction */
+ DebugMonitor_IRQn = -4, /*!< -4 Debug Monitor */
+ PendSV_IRQn = -2, /*!< -2 Pendable request for system service */
+ SysTick_IRQn = -1, /*!< -1 System Tick Timer */
+ /* CYW20829_PSVP Peripheral Interrupt Numbers */
+ ioss_interrupts_gpio_0_IRQn = 0, /*!< 0 [DeepSleep] GPIO Port Interrupt #0 */
+ ioss_interrupts_gpio_1_IRQn = 1, /*!< 1 [DeepSleep] GPIO Port Interrupt #1 */
+ ioss_interrupts_gpio_2_IRQn = 2, /*!< 2 [DeepSleep] GPIO Port Interrupt #2 */
+ ioss_interrupts_gpio_3_IRQn = 3, /*!< 3 [DeepSleep] GPIO Port Interrupt #3 */
+ ioss_interrupts_gpio_4_IRQn = 4, /*!< 4 [DeepSleep] GPIO Port Interrupt #4 */
+ ioss_interrupts_gpio_5_IRQn = 5, /*!< 5 [DeepSleep] GPIO Port Interrupt #5 */
+ ioss_interrupt_vdd_IRQn = 6, /*!< 6 [DeepSleep] GPIO Supply Detect Interrupt */
+ ioss_interrupt_gpio_IRQn = 7, /*!< 7 [DeepSleep] GPIO All Ports */
+ scb_0_interrupt_IRQn = 8, /*!< 8 [DeepSleep] Serial Communication Block #0 (DeepSleep capable) */
+ srss_interrupt_mcwdt_0_IRQn = 9, /*!< 9 [DeepSleep] Multi Counter Watchdog Timer interrupt */
+ srss_interrupt_backup_IRQn = 10, /*!< 10 [DeepSleep] Backup domain interrupt */
+ srss_interrupt_IRQn = 11, /*!< 11 [DeepSleep] Other combined Interrupts for srss (LVD and CLKCAL, CLKCAL only supported in Active mode) */
+ cpuss_interrupts_ipc_dpslp_0_IRQn = 12, /*!< 12 [DeepSleep] cpuss Inter Process Communication Interrupt #0 */
+ cpuss_interrupts_ipc_dpslp_1_IRQn = 13, /*!< 13 [DeepSleep] cpuss Inter Process Communication Interrupt #1 */
+ keyscan_interrupt_IRQn = 14, /*!< 14 [DeepSleep] mxkeyscan interrupt for keyscan edge or fifo thresh to WIC in M33 */
+ srss_interrupt_wdt_IRQn = 15, /*!< 15 [DeepSleep] Interrupt from WDT */
+ btss_interrupt_btss_ipc_IRQn = 16, /*!< 16 [DeepSleep] interrupt from BTSS IPC */
+ scb_1_interrupt_IRQn = 17, /*!< 17 [Active] Serial Communication Block #1 */
+ scb_2_interrupt_IRQn = 18, /*!< 18 [Active] Serial Communication Block #2 */
+ cpuss_interrupts_dw0_0_IRQn = 19, /*!< 19 [Active] cpuss DataWire #0, Channel #0 */
+ cpuss_interrupts_dw0_1_IRQn = 20, /*!< 20 [Active] cpuss DataWire #0, Channel #1 */
+ cpuss_interrupts_dw0_2_IRQn = 21, /*!< 21 [Active] cpuss DataWire #0, Channel #2 */
+ cpuss_interrupts_dw0_3_IRQn = 22, /*!< 22 [Active] cpuss DataWire #0, Channel #3 */
+ cpuss_interrupts_dw0_4_IRQn = 23, /*!< 23 [Active] cpuss DataWire #0, Channel #4 */
+ cpuss_interrupts_dw0_5_IRQn = 24, /*!< 24 [Active] cpuss DataWire #0, Channel #5 */
+ cpuss_interrupts_dw0_6_IRQn = 25, /*!< 25 [Active] cpuss DataWire #0, Channel #6 */
+ cpuss_interrupts_dw0_7_IRQn = 26, /*!< 26 [Active] cpuss DataWire #0, Channel #7 */
+ cpuss_interrupts_dw0_8_IRQn = 27, /*!< 27 [Active] cpuss DataWire #0, Channel #8 */
+ cpuss_interrupts_dw0_9_IRQn = 28, /*!< 28 [Active] cpuss DataWire #0, Channel #9 */
+ cpuss_interrupts_dw0_10_IRQn = 29, /*!< 29 [Active] cpuss DataWire #0, Channel #10 */
+ cpuss_interrupts_dw0_11_IRQn = 30, /*!< 30 [Active] cpuss DataWire #0, Channel #11 */
+ cpuss_interrupts_dw0_12_IRQn = 31, /*!< 31 [Active] cpuss DataWire #0, Channel #12 */
+ cpuss_interrupts_dw0_13_IRQn = 32, /*!< 32 [Active] cpuss DataWire #0, Channel #13 */
+ cpuss_interrupts_dw0_14_IRQn = 33, /*!< 33 [Active] cpuss DataWire #0, Channel #14 */
+ cpuss_interrupts_dw0_15_IRQn = 34, /*!< 34 [Active] cpuss DataWire #0, Channel #15 */
+ cpuss_interrupt_mpc_promc_IRQn = 35, /*!< 35 [Active] PROMC Int */
+ cpuss_interrupt_ppu_sramc0_IRQn = 36, /*!< 36 [Active] PPU SRAM0 */
+ cpuss_interrupt_mpc_sramc0_IRQn = 37, /*!< 37 [Active] MPC SRAM0 */
+ cpuss_interrupt_cm33_0_fp_IRQn = 38, /*!< 38 [Active] CM33 0 Floating Point Interrupt */
+ cpuss_interrupts_cm33_0_cti_0_IRQn = 39, /*!< 39 [Active] CM33-0 CTI interrupt outputs */
+ cpuss_interrupts_cm33_0_cti_1_IRQn = 40, /*!< 40 [Active] CM33-1 CTI interrupt outputs */
+ cpuss_interrupt_exp_br_ahb_error_IRQn = 41, /*!< 41 [Active] EXPANSION BRIDGE AHB Error interrupt */
+ tcpwm_0_interrupts_0_IRQn = 42, /*!< 42 [Active] TCPWM #0, Counter #0 */
+ tcpwm_0_interrupts_1_IRQn = 43, /*!< 43 [Active] TCPWM #0, Counter #1 */
+ tcpwm_0_interrupts_256_IRQn = 44, /*!< 44 [Active] TCPWM #0, Counter #256 */
+ tcpwm_0_interrupts_257_IRQn = 45, /*!< 45 [Active] TCPWM #0, Counter #257 */
+ tcpwm_0_interrupts_258_IRQn = 46, /*!< 46 [Active] TCPWM #0, Counter #258 */
+ tcpwm_0_interrupts_259_IRQn = 47, /*!< 47 [Active] TCPWM #0, Counter #259 */
+ tcpwm_0_interrupts_260_IRQn = 48, /*!< 48 [Active] TCPWM #0, Counter #260 */
+ tcpwm_0_interrupts_261_IRQn = 49, /*!< 49 [Active] TCPWM #0, Counter #261 */
+ tcpwm_0_interrupts_262_IRQn = 50, /*!< 50 [Active] TCPWM #0, Counter #262 */
+ smif_interrupt_normal_IRQn = 51, /*!< 51 [Active] Serial Memory Interface interrupt */
+ smif_interrupt_mpc_IRQn = 52, /*!< 52 [Active] Serial Memory Interface interrupt */
+ tdm_0_interrupts_rx_0_IRQn = 53, /*!< 53 [Active] TDM0 Audio interrupt RX */
+ tdm_0_interrupts_tx_0_IRQn = 54, /*!< 54 [Active] TDM0 Audio interrupt TX */
+ pdm_0_interrupts_0_IRQn = 55, /*!< 55 [Active] PDM0/PCM0 Audio interrupt */
+ pdm_0_interrupts_1_IRQn = 56, /*!< 56 [Active] PDM0/PCM0 Audio interrupt */
+ srss_interrupt_main_ppu_IRQn = 57, /*!< 57 [Active] SRSS Main PPU Interrupt */
+ peri_interrupt_ppc_IRQn = 58, /*!< 58 [Active] PERI PPC Interrupt */
+ peri_interrupt_ahb_error_IRQn = 59, /*!< 59 [Active] PERI AHB Interrupt */
+ lin_0_interrupts_0_IRQn = 60, /*!< 60 [Active] LIN Interrupt, Channel #0 */
+ lin_0_interrupts_1_IRQn = 61, /*!< 61 [Active] LIN Interrupt, Channel #1 */
+ crypto_interrupt_error_IRQn = 62, /*!< 62 [Active] Crypto Interrupt */
+ cpuss_interrupt_ppu_cpuss_IRQn = 63, /*!< 63 [Active] CPUSS PPU Interrupt */
+ canfd_0_interrupts0_0_IRQn = 64, /*!< 64 [Active] CAN #0, Interrupt #0, Channel #0 */
+ canfd_0_interrupts1_0_IRQn = 65, /*!< 65 [Active] CAN #0, Interrupt #1, Channel #0 */
+ canfd_0_interrupt0_IRQn = 66, /*!< 66 [Active] Can #0, Consolidated interrupt #0 */
+ adcmic_interrupt_adcmic_IRQn = 67, /*!< 67 [Active] ADCMIC interrupt */
+ btss_interrupt_btss_exception_IRQn = 68, /*!< 68 [Active] interrupt indicating BTSS has encountered exception */
+ unconnected_IRQn = 240 /*!< 240 Unconnected */
+} IRQn_Type;
+
+
+/*******************************************************************************
+* Processor and Core Peripheral Section
+*******************************************************************************/
+
+/* Configuration of the ARM Cortex-M33 Processor and Core Peripherals */
+#define __CM33_REV 0x0001U /*!< CM33 Core Revision */
+#define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
+#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
+#define __VTOR_PRESENT 1 /*!< Set to 1 if CPU supports Vector Table Offset Register */
+#define __MPU_PRESENT 1 /*!< MPU present or not */
+#define __FPU_PRESENT 1 /*!< FPU present or not */
+#define __CM0P_PRESENT 0 /*!< CM0P present or not */
+#define __DTCM_PRESENT 0 /*!< DTCM present or not */
+#define __ICACHE_PRESENT 0 /*!< ICACHE present or not */
+#define __DCACHE_PRESENT 0 /*!< DCACHE present or not */
+
+/** \} Configuration_of_CMSIS */
+
+#include "core_cm33.h" /*!< ARM Cortex-M33 processor and core peripherals */
+
+
+/* Memory Blocks */
+#define CY_ROM_BASE 0x00000000UL
+#define CY_ROM_SIZE 0x00010000UL
+#define CY_ROM_SECURE_OFFSET 0x10000000UL
+#define CY_ROM_REMAP_OFFSET 0x00000000UL
+#define CY_ROM_REMAP_SECURE_OFFSET 0x10000000UL
+#define CY_CAN0MRAM_BASE 0x40450000UL
+#define CY_CAN0MRAM_SIZE 0x00010000UL
+#define CY_EFUSE_BASE 0x40810800UL
+#define CY_EFUSE_SIZE 0x00000200UL
+#define CY_XIP_BASE 0x60000000UL
+#define CY_XIP_SIZE 0x08000000UL
+#define CY_XIP_SECURE_OFFSET 0x70000000UL
+#define CY_XIP_REMAP_OFFSET 0x08000000UL
+#define CY_XIP_REMAP_SECURE_OFFSET 0x18000000UL
+#define CY_SRAM0_BASE 0x20000000UL
+#define CY_SRAM0_SIZE 0x00020000UL
+#define CY_SRAM0_SECURE_OFFSET 0x30000000UL
+#define CY_SRAM0_REMAP_OFFSET 0x04000000UL
+#define CY_SRAM0_REMAP_SECURE_OFFSET 0x14000000UL
+
+#include "system_cat1b.h" /*!< Category 1B System */
+
+/* IP List */
+#define CY_IP_MXS40ADCMIC 1u
+#define CY_IP_MXS40ADCMIC_INSTANCES 1u
+#define CY_IP_MXS40ADCMIC_VERSION 1u
+#define CY_IP_MXS40BLE52SS 1u
+#define CY_IP_MXS40BLE52SS_INSTANCES 1u
+#define CY_IP_MXS40BLE52SS_VERSION 1u
+#define CY_IP_MXTTCANFD 1u
+#define CY_IP_MXTTCANFD_INSTANCES 1u
+#define CY_IP_MXTTCANFD_VERSION 1u
+#define CY_IP_M33SYSCPUSS 1u
+#define CY_IP_M33SYSCPUSS_INSTANCES 1u
+#define CY_IP_M33SYSCPUSS_VERSION 1u
+#define CY_IP_MXCRYPTOLITE 1u
+#define CY_IP_MXCRYPTOLITE_INSTANCES 1u
+#define CY_IP_MXCRYPTOLITE_VERSION 1u
+#define CY_IP_MXDFT 1u
+#define CY_IP_MXDFT_INSTANCES 1u
+#define CY_IP_MXDFT_VERSION 2u
+#define CY_IP_MXEFUSE 1u
+#define CY_IP_MXEFUSE_INSTANCES 1u
+#define CY_IP_MXEFUSE_VERSION 3u
+#define CY_IP_MXS40SIOSS 1u
+#define CY_IP_MXS40SIOSS_INSTANCES 1u
+#define CY_IP_MXS40SIOSS_VERSION 1u
+#define CY_IP_MXKEYSCAN 1u
+#define CY_IP_MXKEYSCAN_INSTANCES 1u
+#define CY_IP_MXKEYSCAN_VERSION 1u
+#define CY_IP_MXLIN 1u
+#define CY_IP_MXLIN_INSTANCES 1u
+#define CY_IP_MXLIN_VERSION 1u
+#define CY_IP_MXCM33 1u
+#define CY_IP_MXCM33_INSTANCES 1u
+#define CY_IP_MXCM33_VERSION 1u
+#define CY_IP_MXDW 1u
+#define CY_IP_MXDW_INSTANCES 1u
+#define CY_IP_MXDW_VERSION 1u
+#define CY_IP_MXIPC 1u
+#define CY_IP_MXIPC_INSTANCES 1u
+#define CY_IP_MXIPC_VERSION 1u
+#define CY_IP_MXPROMC 1u
+#define CY_IP_MXPROMC_INSTANCES 1u
+#define CY_IP_MXPROMC_VERSION 1u
+#define CY_IP_MXSRAMC 1u
+#define CY_IP_MXSRAMC_INSTANCES 1u
+#define CY_IP_MXSRAMC_VERSION 1u
+#define CY_IP_MXPDM 1u
+#define CY_IP_MXPDM_INSTANCES 1u
+#define CY_IP_MXPDM_VERSION 1u
+#define CY_IP_MXSPERI 1u
+#define CY_IP_MXSPERI_INSTANCES 1u
+#define CY_IP_MXSPERI_VERSION 1u
+#define CY_IP_MXSPERI_TR 1u
+#define CY_IP_MXSPERI_TR_INSTANCES 1u
+#define CY_IP_MXSPERI_TR_VERSION 1u
+#define CY_IP_MXSCB 1u
+#define CY_IP_MXSCB_INSTANCES 3u
+#define CY_IP_MXSCB_VERSION 4u
+#define CY_IP_MXSMIF 1u
+#define CY_IP_MXSMIF_INSTANCES 1u
+#define CY_IP_MXSMIF_VERSION 3u
+#define CY_IP_MXS40SSRSS 1u
+#define CY_IP_MXS40SSRSS_INSTANCES 1u
+#define CY_IP_MXS40SSRSS_VERSION 1u
+#define CY_IP_MXTCPWM 1u
+#define CY_IP_MXTCPWM_INSTANCES 1u
+#define CY_IP_MXTCPWM_VERSION 2u
+#define CY_IP_MXTDM 1u
+#define CY_IP_MXTDM_INSTANCES 1u
+#define CY_IP_MXTDM_VERSION 1u
+
+#include "cyw20829_config.h"
+#include "gpio_cyw20829_56_qfn.h"
+
+#define CY_DEVICE_CYW20829
+#define CY_SILICON_ID 0xFFFFFFFFUL
+#define CY_HF_CLK_MAX_FREQ 150000000UL
+
+
+/*******************************************************************************
+* PERI
+*******************************************************************************/
+
+#define PERI_BASE 0x40000000UL
+#define PERI ((PERI_Type*) PERI_BASE) /* 0x40000000 */
+#define PERI_GR0 ((PERI_GR_Type*) &PERI->GR[0]) /* 0x40004000 */
+#define PERI_GR1 ((PERI_GR_Type*) &PERI->GR[1]) /* 0x40004040 */
+#define PERI_GR2 ((PERI_GR_Type*) &PERI->GR[2]) /* 0x40004080 */
+#define PERI_GR3 ((PERI_GR_Type*) &PERI->GR[3]) /* 0x400040C0 */
+#define PERI_TR_GR0 ((PERI_TR_GR_Type*) &PERI->TR_GR[0]) /* 0x40008000 */
+#define PERI_TR_GR1 ((PERI_TR_GR_Type*) &PERI->TR_GR[1]) /* 0x40008400 */
+#define PERI_TR_GR2 ((PERI_TR_GR_Type*) &PERI->TR_GR[2]) /* 0x40008800 */
+#define PERI_TR_GR3 ((PERI_TR_GR_Type*) &PERI->TR_GR[3]) /* 0x40008C00 */
+#define PERI_TR_GR4 ((PERI_TR_GR_Type*) &PERI->TR_GR[4]) /* 0x40009000 */
+#define PERI_TR_GR5 ((PERI_TR_GR_Type*) &PERI->TR_GR[5]) /* 0x40009400 */
+#define PERI_TR_GR6 ((PERI_TR_GR_Type*) &PERI->TR_GR[6]) /* 0x40009800 */
+#define PERI_TR_GR7 ((PERI_TR_GR_Type*) &PERI->TR_GR[7]) /* 0x40009C00 */
+#define PERI_TR_GR8 ((PERI_TR_GR_Type*) &PERI->TR_GR[8]) /* 0x4000A000 */
+#define PERI_TR_GR9 ((PERI_TR_GR_Type*) &PERI->TR_GR[9]) /* 0x4000A400 */
+#define PERI_TR_1TO1_GR0 ((PERI_TR_1TO1_GR_Type*) &PERI->TR_1TO1_GR[0]) /* 0x4000C000 */
+#define PERI_TR_1TO1_GR1 ((PERI_TR_1TO1_GR_Type*) &PERI->TR_1TO1_GR[1]) /* 0x4000C400 */
+#define PERI_TR_1TO1_GR2 ((PERI_TR_1TO1_GR_Type*) &PERI->TR_1TO1_GR[2]) /* 0x4000C800 */
+#define PERI_TR_1TO1_GR3 ((PERI_TR_1TO1_GR_Type*) &PERI->TR_1TO1_GR[3]) /* 0x4000CC00 */
+#define PERI_TR_1TO1_GR4 ((PERI_TR_1TO1_GR_Type*) &PERI->TR_1TO1_GR[4]) /* 0x4000D000 */
+
+/*******************************************************************************
+* PPC
+*******************************************************************************/
+
+#define PPC_BASE 0x40020000UL
+#define PPC ((PPC_Type*) PPC_BASE) /* 0x40020000 */
+#define PPC_R_ADDR0 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[0]) /* 0x40025000 */
+#define PPC_R_ADDR1 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[1]) /* 0x40025004 */
+#define PPC_R_ADDR2 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[2]) /* 0x40025008 */
+#define PPC_R_ADDR3 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[3]) /* 0x4002500C */
+#define PPC_R_ADDR4 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[4]) /* 0x40025010 */
+#define PPC_R_ADDR5 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[5]) /* 0x40025014 */
+#define PPC_R_ADDR6 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[6]) /* 0x40025018 */
+#define PPC_R_ADDR7 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[7]) /* 0x4002501C */
+#define PPC_R_ADDR8 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[8]) /* 0x40025020 */
+#define PPC_R_ADDR9 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[9]) /* 0x40025024 */
+#define PPC_R_ADDR10 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[10]) /* 0x40025028 */
+#define PPC_R_ADDR11 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[11]) /* 0x4002502C */
+#define PPC_R_ADDR12 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[12]) /* 0x40025030 */
+#define PPC_R_ADDR13 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[13]) /* 0x40025034 */
+#define PPC_R_ADDR14 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[14]) /* 0x40025038 */
+#define PPC_R_ADDR15 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[15]) /* 0x4002503C */
+#define PPC_R_ADDR16 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[16]) /* 0x40025040 */
+#define PPC_R_ADDR17 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[17]) /* 0x40025044 */
+#define PPC_R_ADDR18 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[18]) /* 0x40025048 */
+#define PPC_R_ADDR19 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[19]) /* 0x4002504C */
+#define PPC_R_ADDR20 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[20]) /* 0x40025050 */
+#define PPC_R_ADDR21 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[21]) /* 0x40025054 */
+#define PPC_R_ADDR22 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[22]) /* 0x40025058 */
+#define PPC_R_ADDR23 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[23]) /* 0x4002505C */
+#define PPC_R_ADDR24 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[24]) /* 0x40025060 */
+#define PPC_R_ADDR25 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[25]) /* 0x40025064 */
+#define PPC_R_ADDR26 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[26]) /* 0x40025068 */
+#define PPC_R_ADDR27 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[27]) /* 0x4002506C */
+#define PPC_R_ADDR28 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[28]) /* 0x40025070 */
+#define PPC_R_ADDR29 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[29]) /* 0x40025074 */
+#define PPC_R_ADDR30 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[30]) /* 0x40025078 */
+#define PPC_R_ADDR31 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[31]) /* 0x4002507C */
+#define PPC_R_ADDR32 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[32]) /* 0x40025080 */
+#define PPC_R_ADDR33 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[33]) /* 0x40025084 */
+#define PPC_R_ADDR34 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[34]) /* 0x40025088 */
+#define PPC_R_ADDR35 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[35]) /* 0x4002508C */
+#define PPC_R_ADDR36 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[36]) /* 0x40025090 */
+#define PPC_R_ADDR37 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[37]) /* 0x40025094 */
+#define PPC_R_ADDR38 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[38]) /* 0x40025098 */
+#define PPC_R_ADDR39 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[39]) /* 0x4002509C */
+#define PPC_R_ADDR40 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[40]) /* 0x400250A0 */
+#define PPC_R_ADDR41 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[41]) /* 0x400250A4 */
+#define PPC_R_ADDR42 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[42]) /* 0x400250A8 */
+#define PPC_R_ADDR43 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[43]) /* 0x400250AC */
+#define PPC_R_ADDR44 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[44]) /* 0x400250B0 */
+#define PPC_R_ADDR45 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[45]) /* 0x400250B4 */
+#define PPC_R_ADDR46 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[46]) /* 0x400250B8 */
+#define PPC_R_ADDR47 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[47]) /* 0x400250BC */
+#define PPC_R_ADDR48 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[48]) /* 0x400250C0 */
+#define PPC_R_ADDR49 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[49]) /* 0x400250C4 */
+#define PPC_R_ADDR50 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[50]) /* 0x400250C8 */
+#define PPC_R_ADDR51 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[51]) /* 0x400250CC */
+#define PPC_R_ADDR52 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[52]) /* 0x400250D0 */
+#define PPC_R_ADDR53 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[53]) /* 0x400250D4 */
+#define PPC_R_ADDR54 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[54]) /* 0x400250D8 */
+#define PPC_R_ADDR55 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[55]) /* 0x400250DC */
+#define PPC_R_ADDR56 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[56]) /* 0x400250E0 */
+#define PPC_R_ADDR57 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[57]) /* 0x400250E4 */
+#define PPC_R_ADDR58 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[58]) /* 0x400250E8 */
+#define PPC_R_ADDR59 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[59]) /* 0x400250EC */
+#define PPC_R_ADDR60 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[60]) /* 0x400250F0 */
+#define PPC_R_ADDR61 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[61]) /* 0x400250F4 */
+#define PPC_R_ADDR62 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[62]) /* 0x400250F8 */
+#define PPC_R_ADDR63 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[63]) /* 0x400250FC */
+#define PPC_R_ADDR64 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[64]) /* 0x40025100 */
+#define PPC_R_ADDR65 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[65]) /* 0x40025104 */
+#define PPC_R_ADDR66 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[66]) /* 0x40025108 */
+#define PPC_R_ADDR67 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[67]) /* 0x4002510C */
+#define PPC_R_ADDR68 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[68]) /* 0x40025110 */
+#define PPC_R_ADDR69 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[69]) /* 0x40025114 */
+#define PPC_R_ADDR70 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[70]) /* 0x40025118 */
+#define PPC_R_ADDR71 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[71]) /* 0x4002511C */
+#define PPC_R_ADDR72 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[72]) /* 0x40025120 */
+#define PPC_R_ADDR73 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[73]) /* 0x40025124 */
+#define PPC_R_ADDR74 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[74]) /* 0x40025128 */
+#define PPC_R_ADDR75 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[75]) /* 0x4002512C */
+#define PPC_R_ADDR76 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[76]) /* 0x40025130 */
+#define PPC_R_ADDR77 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[77]) /* 0x40025134 */
+#define PPC_R_ADDR78 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[78]) /* 0x40025138 */
+#define PPC_R_ADDR79 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[79]) /* 0x4002513C */
+#define PPC_R_ADDR80 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[80]) /* 0x40025140 */
+#define PPC_R_ADDR81 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[81]) /* 0x40025144 */
+#define PPC_R_ADDR82 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[82]) /* 0x40025148 */
+#define PPC_R_ADDR83 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[83]) /* 0x4002514C */
+#define PPC_R_ADDR84 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[84]) /* 0x40025150 */
+#define PPC_R_ADDR85 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[85]) /* 0x40025154 */
+#define PPC_R_ADDR86 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[86]) /* 0x40025158 */
+#define PPC_R_ADDR87 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[87]) /* 0x4002515C */
+#define PPC_R_ADDR88 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[88]) /* 0x40025160 */
+#define PPC_R_ADDR89 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[89]) /* 0x40025164 */
+#define PPC_R_ADDR90 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[90]) /* 0x40025168 */
+#define PPC_R_ADDR91 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[91]) /* 0x4002516C */
+#define PPC_R_ADDR92 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[92]) /* 0x40025170 */
+#define PPC_R_ADDR93 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[93]) /* 0x40025174 */
+#define PPC_R_ADDR94 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[94]) /* 0x40025178 */
+#define PPC_R_ADDR95 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[95]) /* 0x4002517C */
+#define PPC_R_ADDR96 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[96]) /* 0x40025180 */
+#define PPC_R_ADDR97 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[97]) /* 0x40025184 */
+#define PPC_R_ADDR98 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[98]) /* 0x40025188 */
+#define PPC_R_ADDR99 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[99]) /* 0x4002518C */
+#define PPC_R_ADDR100 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[100]) /* 0x40025190 */
+#define PPC_R_ADDR101 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[101]) /* 0x40025194 */
+#define PPC_R_ADDR102 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[102]) /* 0x40025198 */
+#define PPC_R_ADDR103 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[103]) /* 0x4002519C */
+#define PPC_R_ADDR104 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[104]) /* 0x400251A0 */
+#define PPC_R_ADDR105 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[105]) /* 0x400251A4 */
+#define PPC_R_ADDR106 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[106]) /* 0x400251A8 */
+#define PPC_R_ADDR107 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[107]) /* 0x400251AC */
+#define PPC_R_ADDR108 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[108]) /* 0x400251B0 */
+#define PPC_R_ADDR109 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[109]) /* 0x400251B4 */
+#define PPC_R_ADDR110 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[110]) /* 0x400251B8 */
+#define PPC_R_ADDR111 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[111]) /* 0x400251BC */
+#define PPC_R_ADDR112 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[112]) /* 0x400251C0 */
+#define PPC_R_ADDR113 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[113]) /* 0x400251C4 */
+#define PPC_R_ADDR114 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[114]) /* 0x400251C8 */
+#define PPC_R_ADDR115 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[115]) /* 0x400251CC */
+#define PPC_R_ADDR116 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[116]) /* 0x400251D0 */
+#define PPC_R_ADDR117 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[117]) /* 0x400251D4 */
+#define PPC_R_ADDR118 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[118]) /* 0x400251D8 */
+#define PPC_R_ADDR119 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[119]) /* 0x400251DC */
+#define PPC_R_ADDR120 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[120]) /* 0x400251E0 */
+#define PPC_R_ADDR121 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[121]) /* 0x400251E4 */
+#define PPC_R_ADDR122 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[122]) /* 0x400251E8 */
+#define PPC_R_ADDR123 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[123]) /* 0x400251EC */
+#define PPC_R_ADDR124 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[124]) /* 0x400251F0 */
+#define PPC_R_ADDR125 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[125]) /* 0x400251F4 */
+#define PPC_R_ADDR126 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[126]) /* 0x400251F8 */
+#define PPC_R_ADDR127 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[127]) /* 0x400251FC */
+#define PPC_R_ADDR128 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[128]) /* 0x40025200 */
+#define PPC_R_ADDR129 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[129]) /* 0x40025204 */
+#define PPC_R_ADDR130 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[130]) /* 0x40025208 */
+#define PPC_R_ADDR131 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[131]) /* 0x4002520C */
+#define PPC_R_ADDR132 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[132]) /* 0x40025210 */
+#define PPC_R_ADDR133 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[133]) /* 0x40025214 */
+#define PPC_R_ADDR134 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[134]) /* 0x40025218 */
+#define PPC_R_ADDR135 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[135]) /* 0x4002521C */
+#define PPC_R_ADDR136 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[136]) /* 0x40025220 */
+#define PPC_R_ADDR137 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[137]) /* 0x40025224 */
+#define PPC_R_ADDR138 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[138]) /* 0x40025228 */
+#define PPC_R_ADDR139 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[139]) /* 0x4002522C */
+#define PPC_R_ADDR140 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[140]) /* 0x40025230 */
+#define PPC_R_ADDR141 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[141]) /* 0x40025234 */
+#define PPC_R_ADDR142 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[142]) /* 0x40025238 */
+#define PPC_R_ADDR143 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[143]) /* 0x4002523C */
+#define PPC_R_ADDR144 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[144]) /* 0x40025240 */
+#define PPC_R_ADDR145 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[145]) /* 0x40025244 */
+#define PPC_R_ADDR146 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[146]) /* 0x40025248 */
+#define PPC_R_ADDR147 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[147]) /* 0x4002524C */
+#define PPC_R_ADDR148 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[148]) /* 0x40025250 */
+#define PPC_R_ADDR149 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[149]) /* 0x40025254 */
+#define PPC_R_ADDR150 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[150]) /* 0x40025258 */
+#define PPC_R_ADDR151 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[151]) /* 0x4002525C */
+#define PPC_R_ADDR152 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[152]) /* 0x40025260 */
+#define PPC_R_ADDR153 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[153]) /* 0x40025264 */
+#define PPC_R_ADDR154 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[154]) /* 0x40025268 */
+#define PPC_R_ADDR155 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[155]) /* 0x4002526C */
+#define PPC_R_ADDR156 ((PPC_R_ADDR_Type*) &PPC->R_ADDR[156]) /* 0x40025270 */
+#define PPC_R_ATT0 ((PPC_R_ATT_Type*) &PPC->R_ATT[0]) /* 0x40026000 */
+#define PPC_R_ATT1 ((PPC_R_ATT_Type*) &PPC->R_ATT[1]) /* 0x40026004 */
+#define PPC_R_ATT2 ((PPC_R_ATT_Type*) &PPC->R_ATT[2]) /* 0x40026008 */
+#define PPC_R_ATT3 ((PPC_R_ATT_Type*) &PPC->R_ATT[3]) /* 0x4002600C */
+#define PPC_R_ATT4 ((PPC_R_ATT_Type*) &PPC->R_ATT[4]) /* 0x40026010 */
+#define PPC_R_ATT5 ((PPC_R_ATT_Type*) &PPC->R_ATT[5]) /* 0x40026014 */
+#define PPC_R_ATT6 ((PPC_R_ATT_Type*) &PPC->R_ATT[6]) /* 0x40026018 */
+#define PPC_R_ATT7 ((PPC_R_ATT_Type*) &PPC->R_ATT[7]) /* 0x4002601C */
+#define PPC_R_ATT8 ((PPC_R_ATT_Type*) &PPC->R_ATT[8]) /* 0x40026020 */
+#define PPC_R_ATT9 ((PPC_R_ATT_Type*) &PPC->R_ATT[9]) /* 0x40026024 */
+#define PPC_R_ATT10 ((PPC_R_ATT_Type*) &PPC->R_ATT[10]) /* 0x40026028 */
+#define PPC_R_ATT11 ((PPC_R_ATT_Type*) &PPC->R_ATT[11]) /* 0x4002602C */
+#define PPC_R_ATT12 ((PPC_R_ATT_Type*) &PPC->R_ATT[12]) /* 0x40026030 */
+#define PPC_R_ATT13 ((PPC_R_ATT_Type*) &PPC->R_ATT[13]) /* 0x40026034 */
+#define PPC_R_ATT14 ((PPC_R_ATT_Type*) &PPC->R_ATT[14]) /* 0x40026038 */
+#define PPC_R_ATT15 ((PPC_R_ATT_Type*) &PPC->R_ATT[15]) /* 0x4002603C */
+#define PPC_R_ATT16 ((PPC_R_ATT_Type*) &PPC->R_ATT[16]) /* 0x40026040 */
+#define PPC_R_ATT17 ((PPC_R_ATT_Type*) &PPC->R_ATT[17]) /* 0x40026044 */
+#define PPC_R_ATT18 ((PPC_R_ATT_Type*) &PPC->R_ATT[18]) /* 0x40026048 */
+#define PPC_R_ATT19 ((PPC_R_ATT_Type*) &PPC->R_ATT[19]) /* 0x4002604C */
+#define PPC_R_ATT20 ((PPC_R_ATT_Type*) &PPC->R_ATT[20]) /* 0x40026050 */
+#define PPC_R_ATT21 ((PPC_R_ATT_Type*) &PPC->R_ATT[21]) /* 0x40026054 */
+#define PPC_R_ATT22 ((PPC_R_ATT_Type*) &PPC->R_ATT[22]) /* 0x40026058 */
+#define PPC_R_ATT23 ((PPC_R_ATT_Type*) &PPC->R_ATT[23]) /* 0x4002605C */
+#define PPC_R_ATT24 ((PPC_R_ATT_Type*) &PPC->R_ATT[24]) /* 0x40026060 */
+#define PPC_R_ATT25 ((PPC_R_ATT_Type*) &PPC->R_ATT[25]) /* 0x40026064 */
+#define PPC_R_ATT26 ((PPC_R_ATT_Type*) &PPC->R_ATT[26]) /* 0x40026068 */
+#define PPC_R_ATT27 ((PPC_R_ATT_Type*) &PPC->R_ATT[27]) /* 0x4002606C */
+#define PPC_R_ATT28 ((PPC_R_ATT_Type*) &PPC->R_ATT[28]) /* 0x40026070 */
+#define PPC_R_ATT29 ((PPC_R_ATT_Type*) &PPC->R_ATT[29]) /* 0x40026074 */
+#define PPC_R_ATT30 ((PPC_R_ATT_Type*) &PPC->R_ATT[30]) /* 0x40026078 */
+#define PPC_R_ATT31 ((PPC_R_ATT_Type*) &PPC->R_ATT[31]) /* 0x4002607C */
+#define PPC_R_ATT32 ((PPC_R_ATT_Type*) &PPC->R_ATT[32]) /* 0x40026080 */
+#define PPC_R_ATT33 ((PPC_R_ATT_Type*) &PPC->R_ATT[33]) /* 0x40026084 */
+#define PPC_R_ATT34 ((PPC_R_ATT_Type*) &PPC->R_ATT[34]) /* 0x40026088 */
+#define PPC_R_ATT35 ((PPC_R_ATT_Type*) &PPC->R_ATT[35]) /* 0x4002608C */
+#define PPC_R_ATT36 ((PPC_R_ATT_Type*) &PPC->R_ATT[36]) /* 0x40026090 */
+#define PPC_R_ATT37 ((PPC_R_ATT_Type*) &PPC->R_ATT[37]) /* 0x40026094 */
+#define PPC_R_ATT38 ((PPC_R_ATT_Type*) &PPC->R_ATT[38]) /* 0x40026098 */
+#define PPC_R_ATT39 ((PPC_R_ATT_Type*) &PPC->R_ATT[39]) /* 0x4002609C */
+#define PPC_R_ATT40 ((PPC_R_ATT_Type*) &PPC->R_ATT[40]) /* 0x400260A0 */
+#define PPC_R_ATT41 ((PPC_R_ATT_Type*) &PPC->R_ATT[41]) /* 0x400260A4 */
+#define PPC_R_ATT42 ((PPC_R_ATT_Type*) &PPC->R_ATT[42]) /* 0x400260A8 */
+#define PPC_R_ATT43 ((PPC_R_ATT_Type*) &PPC->R_ATT[43]) /* 0x400260AC */
+#define PPC_R_ATT44 ((PPC_R_ATT_Type*) &PPC->R_ATT[44]) /* 0x400260B0 */
+#define PPC_R_ATT45 ((PPC_R_ATT_Type*) &PPC->R_ATT[45]) /* 0x400260B4 */
+#define PPC_R_ATT46 ((PPC_R_ATT_Type*) &PPC->R_ATT[46]) /* 0x400260B8 */
+#define PPC_R_ATT47 ((PPC_R_ATT_Type*) &PPC->R_ATT[47]) /* 0x400260BC */
+#define PPC_R_ATT48 ((PPC_R_ATT_Type*) &PPC->R_ATT[48]) /* 0x400260C0 */
+#define PPC_R_ATT49 ((PPC_R_ATT_Type*) &PPC->R_ATT[49]) /* 0x400260C4 */
+#define PPC_R_ATT50 ((PPC_R_ATT_Type*) &PPC->R_ATT[50]) /* 0x400260C8 */
+#define PPC_R_ATT51 ((PPC_R_ATT_Type*) &PPC->R_ATT[51]) /* 0x400260CC */
+#define PPC_R_ATT52 ((PPC_R_ATT_Type*) &PPC->R_ATT[52]) /* 0x400260D0 */
+#define PPC_R_ATT53 ((PPC_R_ATT_Type*) &PPC->R_ATT[53]) /* 0x400260D4 */
+#define PPC_R_ATT54 ((PPC_R_ATT_Type*) &PPC->R_ATT[54]) /* 0x400260D8 */
+#define PPC_R_ATT55 ((PPC_R_ATT_Type*) &PPC->R_ATT[55]) /* 0x400260DC */
+#define PPC_R_ATT56 ((PPC_R_ATT_Type*) &PPC->R_ATT[56]) /* 0x400260E0 */
+#define PPC_R_ATT57 ((PPC_R_ATT_Type*) &PPC->R_ATT[57]) /* 0x400260E4 */
+#define PPC_R_ATT58 ((PPC_R_ATT_Type*) &PPC->R_ATT[58]) /* 0x400260E8 */
+#define PPC_R_ATT59 ((PPC_R_ATT_Type*) &PPC->R_ATT[59]) /* 0x400260EC */
+#define PPC_R_ATT60 ((PPC_R_ATT_Type*) &PPC->R_ATT[60]) /* 0x400260F0 */
+#define PPC_R_ATT61 ((PPC_R_ATT_Type*) &PPC->R_ATT[61]) /* 0x400260F4 */
+#define PPC_R_ATT62 ((PPC_R_ATT_Type*) &PPC->R_ATT[62]) /* 0x400260F8 */
+#define PPC_R_ATT63 ((PPC_R_ATT_Type*) &PPC->R_ATT[63]) /* 0x400260FC */
+#define PPC_R_ATT64 ((PPC_R_ATT_Type*) &PPC->R_ATT[64]) /* 0x40026100 */
+#define PPC_R_ATT65 ((PPC_R_ATT_Type*) &PPC->R_ATT[65]) /* 0x40026104 */
+#define PPC_R_ATT66 ((PPC_R_ATT_Type*) &PPC->R_ATT[66]) /* 0x40026108 */
+#define PPC_R_ATT67 ((PPC_R_ATT_Type*) &PPC->R_ATT[67]) /* 0x4002610C */
+#define PPC_R_ATT68 ((PPC_R_ATT_Type*) &PPC->R_ATT[68]) /* 0x40026110 */
+#define PPC_R_ATT69 ((PPC_R_ATT_Type*) &PPC->R_ATT[69]) /* 0x40026114 */
+#define PPC_R_ATT70 ((PPC_R_ATT_Type*) &PPC->R_ATT[70]) /* 0x40026118 */
+#define PPC_R_ATT71 ((PPC_R_ATT_Type*) &PPC->R_ATT[71]) /* 0x4002611C */
+#define PPC_R_ATT72 ((PPC_R_ATT_Type*) &PPC->R_ATT[72]) /* 0x40026120 */
+#define PPC_R_ATT73 ((PPC_R_ATT_Type*) &PPC->R_ATT[73]) /* 0x40026124 */
+#define PPC_R_ATT74 ((PPC_R_ATT_Type*) &PPC->R_ATT[74]) /* 0x40026128 */
+#define PPC_R_ATT75 ((PPC_R_ATT_Type*) &PPC->R_ATT[75]) /* 0x4002612C */
+#define PPC_R_ATT76 ((PPC_R_ATT_Type*) &PPC->R_ATT[76]) /* 0x40026130 */
+#define PPC_R_ATT77 ((PPC_R_ATT_Type*) &PPC->R_ATT[77]) /* 0x40026134 */
+#define PPC_R_ATT78 ((PPC_R_ATT_Type*) &PPC->R_ATT[78]) /* 0x40026138 */
+#define PPC_R_ATT79 ((PPC_R_ATT_Type*) &PPC->R_ATT[79]) /* 0x4002613C */
+#define PPC_R_ATT80 ((PPC_R_ATT_Type*) &PPC->R_ATT[80]) /* 0x40026140 */
+#define PPC_R_ATT81 ((PPC_R_ATT_Type*) &PPC->R_ATT[81]) /* 0x40026144 */
+#define PPC_R_ATT82 ((PPC_R_ATT_Type*) &PPC->R_ATT[82]) /* 0x40026148 */
+#define PPC_R_ATT83 ((PPC_R_ATT_Type*) &PPC->R_ATT[83]) /* 0x4002614C */
+#define PPC_R_ATT84 ((PPC_R_ATT_Type*) &PPC->R_ATT[84]) /* 0x40026150 */
+#define PPC_R_ATT85 ((PPC_R_ATT_Type*) &PPC->R_ATT[85]) /* 0x40026154 */
+#define PPC_R_ATT86 ((PPC_R_ATT_Type*) &PPC->R_ATT[86]) /* 0x40026158 */
+#define PPC_R_ATT87 ((PPC_R_ATT_Type*) &PPC->R_ATT[87]) /* 0x4002615C */
+#define PPC_R_ATT88 ((PPC_R_ATT_Type*) &PPC->R_ATT[88]) /* 0x40026160 */
+#define PPC_R_ATT89 ((PPC_R_ATT_Type*) &PPC->R_ATT[89]) /* 0x40026164 */
+#define PPC_R_ATT90 ((PPC_R_ATT_Type*) &PPC->R_ATT[90]) /* 0x40026168 */
+#define PPC_R_ATT91 ((PPC_R_ATT_Type*) &PPC->R_ATT[91]) /* 0x4002616C */
+#define PPC_R_ATT92 ((PPC_R_ATT_Type*) &PPC->R_ATT[92]) /* 0x40026170 */
+#define PPC_R_ATT93 ((PPC_R_ATT_Type*) &PPC->R_ATT[93]) /* 0x40026174 */
+#define PPC_R_ATT94 ((PPC_R_ATT_Type*) &PPC->R_ATT[94]) /* 0x40026178 */
+#define PPC_R_ATT95 ((PPC_R_ATT_Type*) &PPC->R_ATT[95]) /* 0x4002617C */
+#define PPC_R_ATT96 ((PPC_R_ATT_Type*) &PPC->R_ATT[96]) /* 0x40026180 */
+#define PPC_R_ATT97 ((PPC_R_ATT_Type*) &PPC->R_ATT[97]) /* 0x40026184 */
+#define PPC_R_ATT98 ((PPC_R_ATT_Type*) &PPC->R_ATT[98]) /* 0x40026188 */
+#define PPC_R_ATT99 ((PPC_R_ATT_Type*) &PPC->R_ATT[99]) /* 0x4002618C */
+#define PPC_R_ATT100 ((PPC_R_ATT_Type*) &PPC->R_ATT[100]) /* 0x40026190 */
+#define PPC_R_ATT101 ((PPC_R_ATT_Type*) &PPC->R_ATT[101]) /* 0x40026194 */
+#define PPC_R_ATT102 ((PPC_R_ATT_Type*) &PPC->R_ATT[102]) /* 0x40026198 */
+#define PPC_R_ATT103 ((PPC_R_ATT_Type*) &PPC->R_ATT[103]) /* 0x4002619C */
+#define PPC_R_ATT104 ((PPC_R_ATT_Type*) &PPC->R_ATT[104]) /* 0x400261A0 */
+#define PPC_R_ATT105 ((PPC_R_ATT_Type*) &PPC->R_ATT[105]) /* 0x400261A4 */
+#define PPC_R_ATT106 ((PPC_R_ATT_Type*) &PPC->R_ATT[106]) /* 0x400261A8 */
+#define PPC_R_ATT107 ((PPC_R_ATT_Type*) &PPC->R_ATT[107]) /* 0x400261AC */
+#define PPC_R_ATT108 ((PPC_R_ATT_Type*) &PPC->R_ATT[108]) /* 0x400261B0 */
+#define PPC_R_ATT109 ((PPC_R_ATT_Type*) &PPC->R_ATT[109]) /* 0x400261B4 */
+#define PPC_R_ATT110 ((PPC_R_ATT_Type*) &PPC->R_ATT[110]) /* 0x400261B8 */
+#define PPC_R_ATT111 ((PPC_R_ATT_Type*) &PPC->R_ATT[111]) /* 0x400261BC */
+#define PPC_R_ATT112 ((PPC_R_ATT_Type*) &PPC->R_ATT[112]) /* 0x400261C0 */
+#define PPC_R_ATT113 ((PPC_R_ATT_Type*) &PPC->R_ATT[113]) /* 0x400261C4 */
+#define PPC_R_ATT114 ((PPC_R_ATT_Type*) &PPC->R_ATT[114]) /* 0x400261C8 */
+#define PPC_R_ATT115 ((PPC_R_ATT_Type*) &PPC->R_ATT[115]) /* 0x400261CC */
+#define PPC_R_ATT116 ((PPC_R_ATT_Type*) &PPC->R_ATT[116]) /* 0x400261D0 */
+#define PPC_R_ATT117 ((PPC_R_ATT_Type*) &PPC->R_ATT[117]) /* 0x400261D4 */
+#define PPC_R_ATT118 ((PPC_R_ATT_Type*) &PPC->R_ATT[118]) /* 0x400261D8 */
+#define PPC_R_ATT119 ((PPC_R_ATT_Type*) &PPC->R_ATT[119]) /* 0x400261DC */
+#define PPC_R_ATT120 ((PPC_R_ATT_Type*) &PPC->R_ATT[120]) /* 0x400261E0 */
+#define PPC_R_ATT121 ((PPC_R_ATT_Type*) &PPC->R_ATT[121]) /* 0x400261E4 */
+#define PPC_R_ATT122 ((PPC_R_ATT_Type*) &PPC->R_ATT[122]) /* 0x400261E8 */
+#define PPC_R_ATT123 ((PPC_R_ATT_Type*) &PPC->R_ATT[123]) /* 0x400261EC */
+#define PPC_R_ATT124 ((PPC_R_ATT_Type*) &PPC->R_ATT[124]) /* 0x400261F0 */
+#define PPC_R_ATT125 ((PPC_R_ATT_Type*) &PPC->R_ATT[125]) /* 0x400261F4 */
+#define PPC_R_ATT126 ((PPC_R_ATT_Type*) &PPC->R_ATT[126]) /* 0x400261F8 */
+#define PPC_R_ATT127 ((PPC_R_ATT_Type*) &PPC->R_ATT[127]) /* 0x400261FC */
+#define PPC_R_ATT128 ((PPC_R_ATT_Type*) &PPC->R_ATT[128]) /* 0x40026200 */
+#define PPC_R_ATT129 ((PPC_R_ATT_Type*) &PPC->R_ATT[129]) /* 0x40026204 */
+#define PPC_R_ATT130 ((PPC_R_ATT_Type*) &PPC->R_ATT[130]) /* 0x40026208 */
+#define PPC_R_ATT131 ((PPC_R_ATT_Type*) &PPC->R_ATT[131]) /* 0x4002620C */
+#define PPC_R_ATT132 ((PPC_R_ATT_Type*) &PPC->R_ATT[132]) /* 0x40026210 */
+#define PPC_R_ATT133 ((PPC_R_ATT_Type*) &PPC->R_ATT[133]) /* 0x40026214 */
+#define PPC_R_ATT134 ((PPC_R_ATT_Type*) &PPC->R_ATT[134]) /* 0x40026218 */
+#define PPC_R_ATT135 ((PPC_R_ATT_Type*) &PPC->R_ATT[135]) /* 0x4002621C */
+#define PPC_R_ATT136 ((PPC_R_ATT_Type*) &PPC->R_ATT[136]) /* 0x40026220 */
+#define PPC_R_ATT137 ((PPC_R_ATT_Type*) &PPC->R_ATT[137]) /* 0x40026224 */
+#define PPC_R_ATT138 ((PPC_R_ATT_Type*) &PPC->R_ATT[138]) /* 0x40026228 */
+#define PPC_R_ATT139 ((PPC_R_ATT_Type*) &PPC->R_ATT[139]) /* 0x4002622C */
+#define PPC_R_ATT140 ((PPC_R_ATT_Type*) &PPC->R_ATT[140]) /* 0x40026230 */
+#define PPC_R_ATT141 ((PPC_R_ATT_Type*) &PPC->R_ATT[141]) /* 0x40026234 */
+#define PPC_R_ATT142 ((PPC_R_ATT_Type*) &PPC->R_ATT[142]) /* 0x40026238 */
+#define PPC_R_ATT143 ((PPC_R_ATT_Type*) &PPC->R_ATT[143]) /* 0x4002623C */
+#define PPC_R_ATT144 ((PPC_R_ATT_Type*) &PPC->R_ATT[144]) /* 0x40026240 */
+#define PPC_R_ATT145 ((PPC_R_ATT_Type*) &PPC->R_ATT[145]) /* 0x40026244 */
+#define PPC_R_ATT146 ((PPC_R_ATT_Type*) &PPC->R_ATT[146]) /* 0x40026248 */
+#define PPC_R_ATT147 ((PPC_R_ATT_Type*) &PPC->R_ATT[147]) /* 0x4002624C */
+#define PPC_R_ATT148 ((PPC_R_ATT_Type*) &PPC->R_ATT[148]) /* 0x40026250 */
+#define PPC_R_ATT149 ((PPC_R_ATT_Type*) &PPC->R_ATT[149]) /* 0x40026254 */
+#define PPC_R_ATT150 ((PPC_R_ATT_Type*) &PPC->R_ATT[150]) /* 0x40026258 */
+#define PPC_R_ATT151 ((PPC_R_ATT_Type*) &PPC->R_ATT[151]) /* 0x4002625C */
+#define PPC_R_ATT152 ((PPC_R_ATT_Type*) &PPC->R_ATT[152]) /* 0x40026260 */
+#define PPC_R_ATT153 ((PPC_R_ATT_Type*) &PPC->R_ATT[153]) /* 0x40026264 */
+#define PPC_R_ATT154 ((PPC_R_ATT_Type*) &PPC->R_ATT[154]) /* 0x40026268 */
+#define PPC_R_ATT155 ((PPC_R_ATT_Type*) &PPC->R_ATT[155]) /* 0x4002626C */
+#define PPC_R_ATT156 ((PPC_R_ATT_Type*) &PPC->R_ATT[156]) /* 0x40026270 */
+
+/*******************************************************************************
+* PERI_PCLK
+*******************************************************************************/
+
+#define PERI_PCLK_BASE 0x40040000UL
+#define PERI_PCLK ((PERI_PCLK_Type*) PERI_PCLK_BASE) /* 0x40040000 */
+#define PERI_PCLK_GR0 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[0]) /* 0x40040000 */
+#define PERI_PCLK_GR1 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[1]) /* 0x40042000 */
+#define PERI_PCLK_GR2 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[2]) /* 0x40044000 */
+#define PERI_PCLK_GR3 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[3]) /* 0x40046000 */
+#define PERI_PCLK_GR4 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[4]) /* 0x40048000 */
+#define PERI_PCLK_GR5 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[5]) /* 0x4004A000 */
+#define PERI_PCLK_GR6 ((PERI_PCLK_GR_Type*) &PERI_PCLK->GR[6]) /* 0x4004C000 */
+
+/*******************************************************************************
+* RAMC_PPU
+*******************************************************************************/
+
+#define RAMC_PPU0_BASE 0x40100000UL
+#define RAMC_PPU1_BASE 0x40101000UL
+#define RAMC_PPU2_BASE 0x40102000UL
+#define RAMC_PPU0 ((RAMC_PPU_Type*) RAMC_PPU0_BASE) /* 0x40100000 */
+#define RAMC_PPU1 ((RAMC_PPU_Type*) RAMC_PPU1_BASE) /* 0x40101000 */
+#define RAMC_PPU2 ((RAMC_PPU_Type*) RAMC_PPU2_BASE) /* 0x40102000 */
+
+/*******************************************************************************
+* ICACHE
+*******************************************************************************/
+
+#define ICACHE0_BASE 0x40103000UL
+#define ICACHE1_BASE 0x40104000UL
+#define ICACHE0 ((ICACHE_Type*) ICACHE0_BASE) /* 0x40103000 */
+#define ICACHE1 ((ICACHE_Type*) ICACHE1_BASE) /* 0x40104000 */
+
+/*******************************************************************************
+* CPUSS_PPU
+*******************************************************************************/
+
+#define CPUSS_PPU_BASE 0x40105000UL
+#define CPUSS_PPU ((CPUSS_PPU_Type*) CPUSS_PPU_BASE) /* 0x40105000 */
+
+/*******************************************************************************
+* RAMC
+*******************************************************************************/
+
+#define RAMC0_BASE 0x40110000UL
+#define RAMC0 ((RAMC_Type*) RAMC0_BASE) /* 0x40110000 */
+#define RAMC0_MPC0 ((RAMC_MPC_Type*) &RAMC0->MPC[0]) /* 0x40114000 */
+
+/*******************************************************************************
+* PROMC
+*******************************************************************************/
+
+#define PROMC_BASE 0x40140000UL
+#define PROMC ((PROMC_Type*) PROMC_BASE) /* 0x40140000 */
+#define PROMC_MPC0 ((PROMC_MPC_Type*) &PROMC->MPC[0]) /* 0x40141000 */
+
+/*******************************************************************************
+* MXCM33
+*******************************************************************************/
+
+#define MXCM33_BASE 0x40160000UL
+#define MXCM33 ((MXCM33_Type*) MXCM33_BASE) /* 0x40160000 */
+
+/*******************************************************************************
+* DW
+*******************************************************************************/
+
+#define DW0_BASE 0x40180000UL
+#define DW0 ((DW_Type*) DW0_BASE) /* 0x40180000 */
+#define DW0_CH_STRUCT0 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[0]) /* 0x40188000 */
+#define DW0_CH_STRUCT1 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[1]) /* 0x40188040 */
+#define DW0_CH_STRUCT2 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[2]) /* 0x40188080 */
+#define DW0_CH_STRUCT3 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[3]) /* 0x401880C0 */
+#define DW0_CH_STRUCT4 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[4]) /* 0x40188100 */
+#define DW0_CH_STRUCT5 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[5]) /* 0x40188140 */
+#define DW0_CH_STRUCT6 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[6]) /* 0x40188180 */
+#define DW0_CH_STRUCT7 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[7]) /* 0x401881C0 */
+#define DW0_CH_STRUCT8 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[8]) /* 0x40188200 */
+#define DW0_CH_STRUCT9 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[9]) /* 0x40188240 */
+#define DW0_CH_STRUCT10 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[10]) /* 0x40188280 */
+#define DW0_CH_STRUCT11 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[11]) /* 0x401882C0 */
+#define DW0_CH_STRUCT12 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[12]) /* 0x40188300 */
+#define DW0_CH_STRUCT13 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[13]) /* 0x40188340 */
+#define DW0_CH_STRUCT14 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[14]) /* 0x40188380 */
+#define DW0_CH_STRUCT15 ((DW_CH_STRUCT_Type*) &DW0->CH_STRUCT[15]) /* 0x401883C0 */
+
+/*******************************************************************************
+* CPUSS
+*******************************************************************************/
+
+#define CPUSS_BASE 0x401C0000UL
+#define CPUSS ((CPUSS_Type*) CPUSS_BASE) /* 0x401C0000 */
+
+/*******************************************************************************
+* MS_CTL_1_2
+*******************************************************************************/
+
+#define MS_CTL_1_2_BASE 0x401C4000UL
+#define MS_CTL_1_2 ((MS_CTL_1_2_Type*) MS_CTL_1_2_BASE) /* 0x401C4000 */
+#define MS5 ((MS_Type*) &MS_CTL_1_2->MS[5]) /* 0x401C4050 */
+#define MS_PC5 ((MS_PC_Type*) &MS_CTL_1_2->MS_PC[5]) /* 0x401C5050 */
+
+/*******************************************************************************
+* CPUSS_SL_CTL
+*******************************************************************************/
+
+#define CPUSS_SL_CTL_BASE 0x401C8000UL
+#define CPUSS_SL_CTL ((CPUSS_SL_CTL_Type*) CPUSS_SL_CTL_BASE) /* 0x401C8000 */
+
+/*******************************************************************************
+* IPC
+*******************************************************************************/
+
+#define IPC_BASE 0x401D0000UL
+#define IPC ((IPC_Type*) IPC_BASE) /* 0x401D0000 */
+#define IPC_STRUCT0 ((IPC_STRUCT_Type*) &IPC->STRUCT[0]) /* 0x401D0000 */
+#define IPC_STRUCT1 ((IPC_STRUCT_Type*) &IPC->STRUCT[1]) /* 0x401D0020 */
+#define IPC_STRUCT2 ((IPC_STRUCT_Type*) &IPC->STRUCT[2]) /* 0x401D0040 */
+#define IPC_STRUCT3 ((IPC_STRUCT_Type*) &IPC->STRUCT[3]) /* 0x401D0060 */
+#define IPC_INTR_STRUCT0 ((IPC_INTR_STRUCT_Type*) &IPC->INTR_STRUCT[0]) /* 0x401D1000 */
+#define IPC_INTR_STRUCT1 ((IPC_INTR_STRUCT_Type*) &IPC->INTR_STRUCT[1]) /* 0x401D1020 */
+
+/*******************************************************************************
+* SRSS
+*******************************************************************************/
+
+#define SRSS_BASE 0x40200000UL
+#define SRSS ((SRSS_Type*) SRSS_BASE) /* 0x40200000 */
+#define MCWDT_STRUCT0 ((MCWDT_STRUCT_Type*) &SRSS->MCWDT_STRUCT[0]) /* 0x4020D000 */
+
+/*******************************************************************************
+* PWRMODE
+*******************************************************************************/
+
+#define PWRMODE_BASE 0x40210000UL
+#define PWRMODE ((PWRMODE_Type*) PWRMODE_BASE) /* 0x40210000 */
+#define PWRMODE_PD0 ((PWRMODE_PD_Type*) &PWRMODE->PD[0]) /* 0x40210000 */
+#define PWRMODE_PD1 ((PWRMODE_PD_Type*) &PWRMODE->PD[1]) /* 0x40210010 */
+#define PWRMODE_PD2 ((PWRMODE_PD_Type*) &PWRMODE->PD[2]) /* 0x40210020 */
+#define PWRMODE_PD3 ((PWRMODE_PD_Type*) &PWRMODE->PD[3]) /* 0x40210030 */
+#define PWRMODE_PD4 ((PWRMODE_PD_Type*) &PWRMODE->PD[4]) /* 0x40210040 */
+#define PWRMODE_PD5 ((PWRMODE_PD_Type*) &PWRMODE->PD[5]) /* 0x40210050 */
+#define PWRMODE_PD6 ((PWRMODE_PD_Type*) &PWRMODE->PD[6]) /* 0x40210060 */
+#define PWRMODE_PD7 ((PWRMODE_PD_Type*) &PWRMODE->PD[7]) /* 0x40210070 */
+#define PWRMODE_PD8 ((PWRMODE_PD_Type*) &PWRMODE->PD[8]) /* 0x40210080 */
+#define PWRMODE_PD9 ((PWRMODE_PD_Type*) &PWRMODE->PD[9]) /* 0x40210090 */
+#define PWRMODE_PD10 ((PWRMODE_PD_Type*) &PWRMODE->PD[10]) /* 0x402100A0 */
+#define PWRMODE_PD11 ((PWRMODE_PD_Type*) &PWRMODE->PD[11]) /* 0x402100B0 */
+#define PWRMODE_PD12 ((PWRMODE_PD_Type*) &PWRMODE->PD[12]) /* 0x402100C0 */
+#define PWRMODE_PD13 ((PWRMODE_PD_Type*) &PWRMODE->PD[13]) /* 0x402100D0 */
+#define PWRMODE_PD14 ((PWRMODE_PD_Type*) &PWRMODE->PD[14]) /* 0x402100E0 */
+#define PWRMODE_PD15 ((PWRMODE_PD_Type*) &PWRMODE->PD[15]) /* 0x402100F0 */
+#define PWRMODE_PPU_MAIN ((PWRMODE_PPU_MAIN_Type*) &PWRMODE->PPU_MAIN) /* 0x40211000 */
+#define PWRMODE_PPU_MAIN_PPU_MAIN ((PWRMODE_PPU_MAIN_PPU_MAIN_Type*) &PWRMODE->PPU_MAIN.PPU_MAIN) /* 0x40211000 */
+
+/*******************************************************************************
+* BACKUP
+*******************************************************************************/
+
+#define BACKUP_BASE 0x40220000UL
+#define BACKUP ((BACKUP_Type*) BACKUP_BASE) /* 0x40220000 */
+
+/*******************************************************************************
+* CRYPTO
+*******************************************************************************/
+
+#define CRYPTO_BASE 0x40230000UL
+#define CRYPTO ((CRYPTO_Type*) CRYPTO_BASE) /* 0x40230000 */
+
+/*******************************************************************************
+* HSIOM
+*******************************************************************************/
+
+#define HSIOM_BASE 0x40400000UL
+#define HSIOM ((HSIOM_Type*) HSIOM_BASE) /* 0x40400000 */
+#define HSIOM_PRT0 ((HSIOM_PRT_Type*) &HSIOM->PRT[0]) /* 0x40400000 */
+#define HSIOM_PRT1 ((HSIOM_PRT_Type*) &HSIOM->PRT[1]) /* 0x40400010 */
+#define HSIOM_PRT2 ((HSIOM_PRT_Type*) &HSIOM->PRT[2]) /* 0x40400020 */
+#define HSIOM_PRT3 ((HSIOM_PRT_Type*) &HSIOM->PRT[3]) /* 0x40400030 */
+#define HSIOM_PRT4 ((HSIOM_PRT_Type*) &HSIOM->PRT[4]) /* 0x40400040 */
+#define HSIOM_PRT5 ((HSIOM_PRT_Type*) &HSIOM->PRT[5]) /* 0x40400050 */
+
+/*******************************************************************************
+* GPIO
+*******************************************************************************/
+
+#define GPIO_BASE 0x40410000UL
+#define GPIO ((GPIO_Type*) GPIO_BASE) /* 0x40410000 */
+#define GPIO_PRT0 ((GPIO_PRT_Type*) &GPIO->PRT[0]) /* 0x40410000 */
+#define GPIO_PRT1 ((GPIO_PRT_Type*) &GPIO->PRT[1]) /* 0x40410080 */
+#define GPIO_PRT2 ((GPIO_PRT_Type*) &GPIO->PRT[2]) /* 0x40410100 */
+#define GPIO_PRT3 ((GPIO_PRT_Type*) &GPIO->PRT[3]) /* 0x40410180 */
+#define GPIO_PRT4 ((GPIO_PRT_Type*) &GPIO->PRT[4]) /* 0x40410200 */
+#define GPIO_PRT5 ((GPIO_PRT_Type*) &GPIO->PRT[5]) /* 0x40410280 */
+
+/*******************************************************************************
+* SMARTIO
+*******************************************************************************/
+
+#define SMARTIO_BASE 0x40420000UL
+#define SMARTIO ((SMARTIO_Type*) SMARTIO_BASE) /* 0x40420000 */
+#define SMARTIO_PRT3 ((SMARTIO_PRT_Type*) &SMARTIO->PRT[3]) /* 0x40420300 */
+
+/*******************************************************************************
+* LIN
+*******************************************************************************/
+
+#define LIN0_BASE 0x40430000UL
+#define LIN0 ((LIN_Type*) LIN0_BASE) /* 0x40430000 */
+#define LIN0_CH0 ((LIN_CH_Type*) &LIN0->CH[0]) /* 0x40438000 */
+#define LIN0_CH1 ((LIN_CH_Type*) &LIN0->CH[1]) /* 0x40438100 */
+
+/*******************************************************************************
+* CANFD
+*******************************************************************************/
+
+#define CANFD0_BASE 0x40440000UL
+#define CANFD0 ((CANFD_Type*) CANFD0_BASE) /* 0x40440000 */
+#define CANFD0_CH0 ((CANFD_CH_Type*) &CANFD0->CH[0]) /* 0x40440000 */
+#define CANFD0_CH0_M_TTCAN ((CANFD_CH_M_TTCAN_Type*) &CANFD0->CH[0].M_TTCAN) /* 0x40440000 */
+
+/*******************************************************************************
+* TCPWM
+*******************************************************************************/
+
+#define TCPWM0_BASE 0x404A0000UL
+#define TCPWM0 ((TCPWM_Type*) TCPWM0_BASE) /* 0x404A0000 */
+#define TCPWM0_GRP0 ((TCPWM_GRP_Type*) &TCPWM0->GRP[0]) /* 0x404A0000 */
+#define TCPWM0_GRP1 ((TCPWM_GRP_Type*) &TCPWM0->GRP[1]) /* 0x404A8000 */
+#define TCPWM0_GRP0_CNT0 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[0].CNT[0]) /* 0x404A0000 */
+#define TCPWM0_GRP0_CNT1 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[0].CNT[1]) /* 0x404A0080 */
+#define TCPWM0_GRP1_CNT0 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[0]) /* 0x404A8000 */
+#define TCPWM0_GRP1_CNT1 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[1]) /* 0x404A8080 */
+#define TCPWM0_GRP1_CNT2 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[2]) /* 0x404A8100 */
+#define TCPWM0_GRP1_CNT3 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[3]) /* 0x404A8180 */
+#define TCPWM0_GRP1_CNT4 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[4]) /* 0x404A8200 */
+#define TCPWM0_GRP1_CNT5 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[5]) /* 0x404A8280 */
+#define TCPWM0_GRP1_CNT6 ((TCPWM_GRP_CNT_Type*) &TCPWM0->GRP[1].CNT[6]) /* 0x404A8300 */
+
+/*******************************************************************************
+* MXS40ADCMIC
+*******************************************************************************/
+
+#define MXS40ADCMIC0_BASE 0x40520000UL
+#define MXS40ADCMIC0 ((MXS40ADCMIC_Type*) MXS40ADCMIC0_BASE) /* 0x40520000 */
+
+/*******************************************************************************
+* SCB
+*******************************************************************************/
+
+#define SCB0_BASE 0x40590000UL
+#define SCB1_BASE 0x405A0000UL
+#define SCB2_BASE 0x405B0000UL
+#define SCB0 ((CySCB_Type*) SCB0_BASE) /* 0x40590000 */
+#define SCB1 ((CySCB_Type*) SCB1_BASE) /* 0x405A0000 */
+#define SCB2 ((CySCB_Type*) SCB2_BASE) /* 0x405B0000 */
+
+/*******************************************************************************
+* EFUSE
+*******************************************************************************/
+
+#define EFUSE_BASE 0x40810000UL
+#define EFUSE ((EFUSE_Type*) EFUSE_BASE) /* 0x40810000 */
+
+/*******************************************************************************
+* SMIF
+*******************************************************************************/
+
+#define SMIF0_BASE 0x40890000UL
+#define SMIF0 ((SMIF_Type*) SMIF0_BASE) /* 0x40890000 */
+#define SMIF0_SMIF_CRYPTO0 ((SMIF_SMIF_CRYPTO_Type*) &SMIF0->SMIF_CRYPTO_BLOCK[0]) /* 0x40890200 */
+#define SMIF0_DEVICE0 ((SMIF_DEVICE_Type*) &SMIF0->DEVICE[0]) /* 0x40890800 */
+#define SMIF0_DEVICE1 ((SMIF_DEVICE_Type*) &SMIF0->DEVICE[1]) /* 0x40890880 */
+#define SMIF0_MPC0 ((SMIF_MPC_Type*) &SMIF0->MPC[0]) /* 0x40891000 */
+
+/*******************************************************************************
+* TDM
+*******************************************************************************/
+
+#define TDM0_BASE 0x408C0000UL
+#define TDM0 ((TDM_Type*) TDM0_BASE) /* 0x408C0000 */
+#define TDM0_TDM_STRUCT0 ((TDM_TDM_STRUCT_Type*) &TDM0->TDM_STRUCT[0]) /* 0x408C8000 */
+#define TDM0_TDM_STRUCT0_TDM_TX_STRUCT ((TDM_TDM_STRUCT_TDM_TX_STRUCT_Type*) &TDM0->TDM_STRUCT[0].TDM_TX_STRUCT) /* 0x408C8000 */
+#define TDM0_TDM_STRUCT0_TDM_RX_STRUCT ((TDM_TDM_STRUCT_TDM_RX_STRUCT_Type*) &TDM0->TDM_STRUCT[0].TDM_RX_STRUCT) /* 0x408C8100 */
+
+/*******************************************************************************
+* PDM
+*******************************************************************************/
+
+#define PDM0_BASE 0x408D0000UL
+#define PDM0 ((PDM_Type*) PDM0_BASE) /* 0x408D0000 */
+#define PDM0_CH0 ((PDM_CH_Type*) &PDM0->CH[0]) /* 0x408D8000 */
+#define PDM0_CH1 ((PDM_CH_Type*) &PDM0->CH[1]) /* 0x408D8100 */
+
+/*******************************************************************************
+* MXKEYSCAN
+*******************************************************************************/
+
+#define MXKEYSCAN_BASE 0x40920000UL
+#define MXKEYSCAN ((MXKEYSCAN_Type*) MXKEYSCAN_BASE) /* 0x40920000 */
+
+/*******************************************************************************
+* BTSS
+*******************************************************************************/
+
+#define BTSS_BASE 0x42000000UL
+#define BTSS ((BTSS_Type*) BTSS_BASE) /* 0x42000000 */
+#define BTSS_DATA_RAM_IPC ((BTSS_DATA_RAM_IPC_Type*) &BTSS->DATA_RAM_IPC) /* 0x42600000 */
+
+/** \} CYW20829_PSVP */
+
+#endif /* _CYW20829_PSVP_H_ */
+
+
+/* [] END OF FILE */
diff --git a/boot/cypress/scripts/cppcheck-htmlreport.py b/boot/cypress/scripts/cppcheck-htmlreport.py
new file mode 100644
index 0000000..afc7380
--- /dev/null
+++ b/boot/cypress/scripts/cppcheck-htmlreport.py
@@ -0,0 +1,696 @@
+#! /usr/bin/python3
+
+from __future__ import unicode_literals
+
+import io
+import sys
+import optparse
+import os
+import operator
+
+from collections import Counter
+from pygments import highlight
+from pygments.lexers import guess_lexer_for_filename
+from pygments.formatters import HtmlFormatter
+from xml.sax import parse as xml_parse
+from xml.sax import SAXParseException as XmlParseException
+from xml.sax.handler import ContentHandler as XmlContentHandler
+from xml.sax.saxutils import escape
+"""
+Turns a cppcheck xml file into a browsable html report along
+with syntax highlighted source code.
+"""
+
+STYLE_FILE = """
+body {
+ font: 13px Arial, Verdana, Sans-Serif;
+ margin: 0;
+ width: auto;
+}
+
+h1 {
+ margin: 10px;
+}
+
+#footer > p {
+ margin: 4px;
+}
+
+.error {
+ background-color: #ffb7b7;
+}
+
+.error2 {
+ background-color: #faa;
+ border: 1px dotted black;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+.inconclusive {
+ background-color: #B6B6B4;
+}
+
+.inconclusive2 {
+ background-color: #B6B6B4;
+ border: 1px dotted black;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+div.verbose {
+ display: inline-block;
+ vertical-align: top;
+ cursor: help;
+}
+
+div.verbose div.content {
+ display: none;
+ position: absolute;
+ padding: 10px;
+ margin: 4px;
+ max-width: 40%;
+ white-space: pre-wrap;
+ border: 1px solid black;
+ background-color: #FFFFCC;
+ cursor: auto;
+}
+
+.highlight .hll {
+ padding: 1px;
+}
+
+#header {
+ border-bottom: thin solid #aaa;
+}
+
+#menu {
+ float: left;
+ margin-top: 5px;
+ text-align: left;
+ width: 150px;
+ height: 75%;
+ position: fixed;
+ overflow: auto;
+ z-index: 1;
+}
+
+#menu_index {
+ float: left;
+ margin-top: 5px;
+ padding-left: 5px;
+ text-align: left;
+ width: 200px;
+ height: 75%;
+ position: fixed;
+ overflow: auto;
+ z-index: 1;
+}
+
+#menu > a {
+ display: block;
+ margin-left: 10px;
+ font: 12px;
+ z-index: 1;
+}
+
+#filename {
+ margin-left: 10px;
+ font: 12px;
+ z-index: 1;
+}
+
+.highlighttable {
+ background-color:white;
+ z-index: 10;
+ position: relative;
+ margin: -10 px;
+}
+
+#content {
+ background-color: white;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ float: left;
+ margin: 5px;
+ margin-left: 10px;
+ padding: 0 10px 10px 10px;
+ width: 80%;
+ padding-left: 150px;
+}
+
+#content_index {
+ background-color: white;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ float: left;
+ margin: 5px;
+ margin-left: 10px;
+ padding: 0 10px 10px 10px;
+ width: 80%;
+ padding-left: 200px;
+}
+
+.linenos {
+ border-right: thin solid #aaa;
+ color: lightgray;
+ padding-right: 6px;
+}
+
+#footer {
+ border-top: thin solid #aaa;
+ clear: both;
+ font-size: 90%;
+ margin-top: 5px;
+}
+
+#footer ul {
+ list-style-type: none;
+ padding-left: 0;
+}
+"""
+
+HTML_HEAD = """
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - %s</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+%s
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - %s: %s </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> %s</p>
+"""
+
+HTML_HEAD_END = """
+ </div>
+ <div id="content">
+"""
+
+HTML_FOOTER = """
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck %s - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ <p>
+ </div>
+ </body>
+</html>
+"""
+
+HTML_ERROR = "<span class='error2'><--- %s</span>\n"
+HTML_INCONCLUSIVE = "<span class='inconclusive2'><--- %s</span>\n"
+
+HTML_EXPANDABLE_ERROR = "<div class='verbose expandable'><span class='error2'><--- %s <span class='marker'>[+]</span></span><div class='content'>%s</div></div>\n"""
+HTML_EXPANDABLE_INCONCLUSIVE = "<div class='verbose expandable'><span class='inconclusive2'><--- %s <span class='marker'>[+]</span></span><div class='content'>%s</div></div>\n"""
+
+# escape() and unescape() takes care of &, < and >.
+html_escape_table = {
+ '"': """,
+ "'": "'"
+}
+html_unescape_table = {v: k for k, v in html_escape_table.items()}
+
+
+def html_escape(text):
+ return escape(text, html_escape_table)
+
+
+class AnnotateCodeFormatter(HtmlFormatter):
+ errors = []
+
+ def wrap(self, source, outfile):
+ line_no = 1
+ for i, t in HtmlFormatter.wrap(self, source, outfile):
+ # If this is a source code line we want to add a span tag at the
+ # end.
+ if i == 1:
+ for error in self.errors:
+ if error['line'] == line_no:
+ try:
+ if error['inconclusive'] == 'true':
+ # only print verbose msg if it really differs
+ # from actual message
+ if error.get('verbose') and (error['verbose'] != error['msg']):
+ index = t.rfind('\n')
+ t = t[:index] + HTML_EXPANDABLE_INCONCLUSIVE % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
+ else:
+ t = t.replace('\n', HTML_INCONCLUSIVE % error['msg'])
+ except KeyError:
+ if error.get('verbose') and (error['verbose'] != error['msg']):
+ index = t.rfind('\n')
+ t = t[:index] + HTML_EXPANDABLE_ERROR % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
+ else:
+ t = t.replace('\n', HTML_ERROR % error['msg'])
+
+ line_no = line_no + 1
+ yield i, t
+
+
+class CppCheckHandler(XmlContentHandler):
+
+ """Parses the cppcheck xml file and produces a list of all its errors."""
+
+ def __init__(self):
+ XmlContentHandler.__init__(self)
+ self.errors = []
+ self.version = '1'
+ self.versionCppcheck = ''
+
+ def startElement(self, name, attributes):
+ if name == 'results':
+ self.version = attributes.get('version', self.version)
+
+ if self.version == '1':
+ self.handleVersion1(name, attributes)
+ else:
+ self.handleVersion2(name, attributes)
+
+ def handleVersion1(self, name, attributes):
+ if name != 'error':
+ return
+
+ self.errors.append({
+ 'file': attributes.get('file', ''),
+ 'line': int(attributes.get('line', 0)),
+ 'locations': [{
+ 'file': attributes.get('file', ''),
+ 'line': int(attributes.get('line', 0)),
+ }],
+ 'id': attributes['id'],
+ 'severity': attributes['severity'],
+ 'msg': attributes['msg']
+ })
+
+ def handleVersion2(self, name, attributes):
+ if name == 'cppcheck':
+ self.versionCppcheck = attributes['version']
+ if name == 'error':
+ error = {
+ 'locations': [],
+ 'file': '',
+ 'line': 0,
+ 'id': attributes['id'],
+ 'severity': attributes['severity'],
+ 'msg': attributes['msg'],
+ 'verbose': attributes.get('verbose')
+ }
+
+ if 'inconclusive' in attributes:
+ error['inconclusive'] = attributes['inconclusive']
+ if 'cwe' in attributes:
+ error['cwe'] = attributes['cwe']
+
+ self.errors.append(error)
+ elif name == 'location':
+ assert self.errors
+ error = self.errors[-1]
+ locations = error['locations']
+ file = attributes['file']
+ line = int(attributes['line'])
+ if not locations:
+ error['file'] = file
+ error['line'] = line
+ locations.append({
+ 'file': file,
+ 'line': line,
+ 'info': attributes.get('info')
+ })
+
+if __name__ == '__main__':
+ # Configure all the options this little utility is using.
+ parser = optparse.OptionParser()
+ parser.add_option('--title', dest='title',
+ help='The title of the project.',
+ default='[project name]')
+ parser.add_option('--file', dest='file',
+ help='The cppcheck xml output file to read defects '
+ 'from. Default is reading from stdin.')
+ parser.add_option('--report-dir', dest='report_dir',
+ help='The directory where the HTML report content is '
+ 'written.')
+ parser.add_option('--source-dir', dest='source_dir',
+ help='Base directory where source code files can be '
+ 'found.')
+ parser.add_option('--source-encoding', dest='source_encoding',
+ help='Encoding of source code.', default='utf-8')
+
+ # Parse options and make sure that we have an output directory set.
+ options, args = parser.parse_args()
+
+ try:
+ sys.argv[1]
+ except IndexError: # no arguments give, print --help
+ parser.print_help()
+ quit()
+
+ if not options.report_dir:
+ parser.error('No report directory set.')
+
+ # Get the directory where source code files are located.
+ source_dir = os.getcwd()
+ if options.source_dir:
+ source_dir = options.source_dir
+
+ # Get the stream that we read cppcheck errors from.
+ input_file = sys.stdin
+ if options.file:
+ if not os.path.exists(options.file):
+ parser.error('cppcheck xml file: %s not found.' % options.file)
+ input_file = io.open(options.file, 'r')
+ else:
+ parser.error('No cppcheck xml file specified. (--file=)')
+
+ # Parse the xml file and produce a simple list of errors.
+ print('Parsing xml report.')
+ try:
+ contentHandler = CppCheckHandler()
+ xml_parse(input_file, contentHandler)
+ except XmlParseException as msg:
+ print('Failed to parse cppcheck xml file: %s' % msg)
+ sys.exit(1)
+
+ # We have a list of errors. But now we want to group them on
+ # each source code file. Lets create a files dictionary that
+ # will contain a list of all the errors in that file. For each
+ # file we will also generate a HTML filename to use.
+ files = {}
+ file_no = 0
+ for error in contentHandler.errors:
+ filename = error['file']
+ if filename not in files.keys():
+ files[filename] = {
+ 'errors': [], 'htmlfile': str(file_no) + '.html'}
+ file_no = file_no + 1
+ files[filename]['errors'].append(error)
+
+ # Make sure that the report directory is created if it doesn't exist.
+ print('Creating %s directory' % options.report_dir)
+ if not os.path.exists(options.report_dir):
+ os.mkdir(options.report_dir)
+
+ # Generate a HTML file with syntax highlighted source code for each
+ # file that contains one or more errors.
+ print('Processing errors')
+
+ decode_errors = []
+ for filename, data in sorted(files.items()):
+ htmlfile = data['htmlfile']
+ errors = []
+
+ for error in data['errors']:
+ for location in error['locations']:
+ if filename == location['file']:
+ newError = dict(error)
+
+ del newError['locations']
+ newError['line'] = location['line']
+ if location.get('info'):
+ newError['msg'] = location['info']
+ newError['severity'] = 'information'
+ del newError['verbose']
+
+ errors.append(newError)
+
+ lines = []
+ for error in errors:
+ lines.append(error['line'])
+
+ if filename == '':
+ continue
+
+ source_filename = os.path.join(source_dir, filename)
+ try:
+ with io.open(source_filename, 'r', encoding=options.source_encoding) as input_file:
+ content = input_file.read()
+ except IOError:
+ if (error['id'] == 'unmatchedSuppression'):
+ continue # file not found, bail out
+ else:
+ sys.stderr.write("ERROR: Source file '%s' not found.\n" %
+ source_filename)
+ continue
+ except UnicodeDecodeError:
+ sys.stderr.write("WARNING: Unicode decode error in '%s'.\n" %
+ source_filename)
+ decode_errors.append(source_filename[2:]) # "[2:]" gets rid of "./" at beginning
+ continue
+
+ htmlFormatter = AnnotateCodeFormatter(linenos=True,
+ style='colorful',
+ hl_lines=lines,
+ lineanchors='line',
+ encoding=options.source_encoding)
+ htmlFormatter.errors = errors
+
+ with io.open(os.path.join(options.report_dir, htmlfile), 'w', encoding='utf-8') as output_file:
+ output_file.write(HTML_HEAD %
+ (options.title,
+ htmlFormatter.get_style_defs('.highlight'),
+ options.title,
+ filename,
+ filename.split('/')[-1]))
+
+ for error in sorted(errors, key=lambda k: k['line']):
+ output_file.write("<a href='%s#line-%d'> %s %s</a>" % (data['htmlfile'], error['line'], error['id'], error['line']))
+
+ output_file.write(HTML_HEAD_END)
+ try:
+ lexer = guess_lexer_for_filename(source_filename, '')
+ except:
+ sys.stderr.write("ERROR: Couldn't determine lexer for the file' " + source_filename + " '. Won't be able to syntax highlight this file.")
+ output_file.write("\n <tr><td colspan='4'> Could not generated content because pygments failed to retrieve the determine code type.</td></tr>")
+ output_file.write("\n <tr><td colspan='4'> Sorry about this.</td></tr>")
+ continue
+
+ if options.source_encoding:
+ lexer.encoding = options.source_encoding
+
+ output_file.write(
+ highlight(content, lexer, htmlFormatter).decode(
+ options.source_encoding))
+
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
+
+ print(' ' + filename)
+
+ # Generate a master index.html file that will contain a list of
+ # all the errors created.
+ print('Creating index.html')
+
+ with io.open(os.path.join(options.report_dir, 'index.html'),
+ 'w') as output_file:
+
+ stats_count = 0
+ stats = []
+ for filename, data in sorted(files.items()):
+ for error in data['errors']:
+ stats.append(error['id']) # get the stats
+ stats_count += 1
+
+ counter = Counter(stats)
+
+ stat_html = []
+ # the following lines sort the stat primary by value (occurrences),
+ # but if two IDs occur equally often, then we sort them alphabetically by warning ID
+ try:
+ cnt_max = counter.most_common()[0][1]
+ except IndexError:
+ cnt_max = 0
+
+ try:
+ cnt_min = counter.most_common()[-1][1]
+ except IndexError:
+ cnt_min = 0
+
+ stat_fmt = " <tr><td><input type='checkbox' onclick='toggle_class_visibility(this.id)' id='{}' name='{}' checked></td><td>{}</td><td>{}</td></tr>"
+ for occurrences in reversed(range(cnt_min, cnt_max + 1)):
+ for _id in [k for k, v in sorted(counter.items()) if v == occurrences]:
+ stat_html.append(stat_fmt.format(_id, _id, dict(counter.most_common())[_id], _id))
+
+ output_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defects:", "Defect summary;", 1) % (options.title, '', options.title, '', ''))
+ output_file.write(' <table>')
+ output_file.write(' <tr><th>Show</th><th>#</th><th>Defect ID</th></tr>')
+ output_file.write(''.join(stat_html))
+ output_file.write(' <tr><td></td><td>' + str(stats_count) + '</td><td>total</td></tr>')
+ output_file.write(' </table>')
+ output_file.write(' <a href="stats.html">Statistics</a></p>')
+ output_file.write(HTML_HEAD_END.replace("content", "content_index", 1))
+ output_file.write(' <table>\n')
+
+ output_file.write(
+ ' <tr><th>Line</th><th>Id</th><th>CWE</th><th>Severity</th><th>Message</th></tr>')
+ for filename, data in sorted(files.items()):
+ if filename in decode_errors: # don't print a link but a note
+ output_file.write("\n <tr><td colspan='4'>%s</td></tr>" % (filename))
+ output_file.write("\n <tr><td colspan='4'> Could not generated due to UnicodeDecodeError</td></tr>")
+ else:
+ if filename.endswith('*'): # assume unmatched suppression
+ output_file.write(
+ "\n <tr><td colspan='4'>%s</td></tr>" %
+ (filename))
+ else:
+ output_file.write(
+ "\n <tr><td colspan='4'><a href='%s'>%s</a></td></tr>" %
+ (data['htmlfile'], filename))
+
+ for error in sorted(data['errors'], key=lambda k: k['line']):
+ error_class = ''
+ try:
+ if error['inconclusive'] == 'true':
+ error_class = 'class="inconclusive"'
+ error['severity'] += ", inconcl."
+ except KeyError:
+ pass
+
+ try:
+ if error['cwe']:
+ cwe_url = "<a href='https://cwe.mitre.org/data/definitions/" + error['cwe'] + ".html'>" + error['cwe'] + "</a>"
+ except KeyError:
+ cwe_url = ""
+
+ if error['severity'] == 'error':
+ error_class = 'class="error"'
+ if error['id'] == 'missingInclude':
+ output_file.write(
+ '\n <tr class="%s"><td></td><td>%s</td><td></td><td>%s</td><td>%s</td></tr>' %
+ (error['id'], error['id'], error['severity'], error['msg']))
+ elif (error['id'] == 'unmatchedSuppression') and filename.endswith('*'):
+ output_file.write(
+ '\n <tr class="%s"><td></td><td>%s</td><td></td><td>%s</td><td %s>%s</td></tr>' %
+ (error['id'], error['id'], error['severity'], error_class,
+ error['msg']))
+ else:
+ output_file.write(
+ '\n <tr class="%s"><td><a href="%s#line-%d">%d</a></td><td>%s</td><td>%s</td><td>%s</td><td %s>%s</td></tr>' %
+ (error['id'], data['htmlfile'], error['line'], error['line'],
+ error['id'], cwe_url, error['severity'], error_class,
+ error['msg']))
+
+ output_file.write('\n </table>')
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
+
+ if (decode_errors):
+ sys.stderr.write("\nGenerating html failed for the following files: " + ' '.join(decode_errors))
+ sys.stderr.write("\nConsider changing source-encoding (for example: \"htmlreport ... --source-encoding=\"iso8859-1\"\"\n")
+
+ print('Creating style.css file')
+ with io.open(os.path.join(options.report_dir, 'style.css'),
+ 'w') as css_file:
+ css_file.write(STYLE_FILE)
+
+ print("Creating stats.html (statistics)\n")
+ stats_countlist = {}
+
+ for filename, data in sorted(files.items()):
+ if (filename == ''):
+ continue
+ stats_tmplist = []
+ for error in sorted(data['errors'], key=lambda k: k['line']):
+ stats_tmplist.append(error['severity'])
+
+ stats_countlist[filename] = dict(Counter(stats_tmplist))
+
+ # get top ten for each severity
+ SEVERITIES = "error", "warning", "portability", "performance", "style", "unusedFunction", "information", "missingInclude", "internal"
+
+ with io.open(os.path.join(options.report_dir, 'stats.html'), 'w') as stats_file:
+
+ stats_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defects:", "Back to summary", 1) % (options.title, '', options.title, 'Statistics', ''))
+ stats_file.write(HTML_HEAD_END.replace("content", "content_index", 1))
+
+ for sev in SEVERITIES:
+ _sum = 0
+ stats_templist = {}
+
+ # if the we have an style warning but we are checking for
+ # portability, we have to skip it to prevent KeyError
+ try:
+ for filename in stats_countlist:
+ try: # also bail out if we have a file with no sev-results
+ _sum += stats_countlist[filename][sev]
+ stats_templist[filename] = (int)(stats_countlist[filename][sev]) # file : amount,
+ except KeyError:
+ continue
+ # don't print "0 style" etc, if no style warnings were found
+ if (_sum == 0):
+ break
+ except KeyError:
+ continue
+ stats_file.write("<p>Top 10 files for " + sev + " severity, total findings: " + str(_sum) + "</br>\n")
+
+ # sort, so that the file with the most severities per type is first
+ stats_list_sorted = sorted(stats_templist.items(), key=operator.itemgetter(1, 0), reverse=True)
+ it = 0
+ LENGTH = 0
+
+ for i in stats_list_sorted: # printing loop
+ # for aesthetics: if it's the first iteration of the loop, get
+ # the max length of the number string
+ if (it == 0):
+ LENGTH = len(str(i[1])) # <- length of longest number, now get the difference and try to make other numbers align to it
+
+ stats_file.write(" " * 3 + str(i[1]) + " " * (1 + LENGTH - len(str(i[1]))) + "<a href=\"" + files[i[0]]['htmlfile'] + "\"> " + i[0] + "</a></br>\n")
+ it += 1
+ if (it == 10): # print only the top 10
+ break
+ stats_file.write("</p>\n")
+
+ print("\nOpen '" + options.report_dir + "/index.html' to see the results.")
diff --git a/boot/cypress/scripts/github_pr_cleaner.py b/boot/cypress/scripts/github_pr_cleaner.py
new file mode 100644
index 0000000..be26c07
--- /dev/null
+++ b/boot/cypress/scripts/github_pr_cleaner.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+import shutil
+from os import remove
+from sys import argv
+
+shutil.rmtree('../cppcheck')
+shutil.rmtree('../coverity')
+remove('../../../.gitlab-ci.yml')
+remove('../BlinkyApp/BlinkyApp_CM4_Debug.launch')
+remove('../MCUBootApp/MCUBootApp_CM0P_Debug.launch')
+remove('../MCUBootApp/MCUBootApp_CYW20829_Debug.launch')
+remove('../cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_single_psvp.json')
+remove('../cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_swap_multi2_psvp.json')
+remove('../cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_single_psvp.json')
+remove('../cy_flash_pal/flash_cyw208xx/flashmap/cyw20829_xip_overwrite_multi2_psvp.json')
+remove('./cppcheck-htmlreport.py')
+remove('./rbc_policy_and_cert_revision_modify.py')
+remove('../platforms/CYW20829/cyw20829_psvp.h')
+remove(argv[0])
+
+print('Cleanup complete')
diff --git a/boot/cypress/scripts/rbc_policy_and_cert_revision_modify.py b/boot/cypress/scripts/rbc_policy_and_cert_revision_modify.py
new file mode 100644
index 0000000..7b47634
--- /dev/null
+++ b/boot/cypress/scripts/rbc_policy_and_cert_revision_modify.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+import json
+
+with open("./policy/policy_reprovisioning_secure.json", "r+") as f:
+ data = json.load(f)
+ data["device_policy"]["flow_control"]["sys_reset_req"]["value"] = True
+ f.seek(0)
+ json.dump(data, f)
+ f.truncate()
+ f.close()
+
+with open("./packets/debug_cert.json", "r+") as f:
+ data = json.load(f)
+ data["device_id"]["revision_id"] = "0x00"
+ f.seek(0)
+ json.dump(data, f)
+ f.truncate()
+ f.close()