{"data":{"slug":"discovered-ab8e4893e74f78708b7504631986f37228749fbe54709e14","title":"Mcuboot Rsip Protected","summary":"Configure and manage MCUboot RSIP protected-mode settings for RA8M1\/RA8D1 devices, including module gating, key sections, include paths, and flash-key scripts.","url":"https:\/\/skillshunter.net\/skills\/discovered-ab8e4893e74f78708b7504631986f37228749fbe54709e14","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-ab8e4893e74f78708b7504631986f37228749fbe54709e14","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-ab8e4893e74f78708b7504631986f37228749fbe54709e14.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-ab8e4893e74f78708b7504631986f37228749fbe54709e14\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure `MCUBOOT_USE_RSIP_PROTECTED` is defined only when `BSP_FEATURE_RSIP_RSIP_E51A_SUPPORTED` is 1. Initialize the submodule `ra\/fsp\/src\/r_rsip_protected\/crypto_procedures_protected` with `git submodule update --init --recursive` on build machines.","instructions":"---\nname: mcuboot-rsip-protected\ndescription: MCUboot RSIP protected-mode work for RA8M1\/RA8D1 (RSIP-E51A): module gating, key sections, include paths, flash-key scripts, and known build failures. Use when touching rm_mcuboot_port custom_crypto_stacks\/protected_mode\/rsip, rm_mcuboot_rsip_protected_mode, ra8m1 linker key sections, or flash_with_key*.sh.\nmetadata:\n  type: reference\n  branch: FSPRA-5831_mcb_protected_ra8_hh\n  compacted: 2026-11-01\n---\n\n# MCUboot RSIP protected mode (FSPRA-5831)\n\nStatus: compacted 2026-11-01. Verify line numbers on the branch before use. Resolved issues are removed. Open items are at the end.\n\n## Devices\n- `MCUBOOT_USE_RSIP_PROTECTED` is set only when `BSP_FEATURE_RSIP_RSIP_E51A_SUPPORTED` is 1 (`test_files\/ra_cfg\/mcu-tools\/include\/mcuboot_config\/mcuboot_config.h`).\n- E51A: RA8M1, RA8D1, RA8E1, RA8E2. RA8M2 is E50D only.\n- Module gate (`rm_mcuboot_port\/.module_descriptions\/Renesas##Middleware##all##rm_mcuboot_rsip_protected_mode####x.xx.xx.xml`, line 6): `(\"${interface.mcu.rsip.sce9}\" !== \"1\") && (\"${interface.mcu.rsip.rsip_e51a_protected}\" === \"1\")`. In HEAD (`be04a355f99`).\n\n## Code state\n- `rsip\/rsip_sha256.h`: protected-only. `bootutil_sha_context` is `uint32_t`, and calls pass `&rsip_ctrl`.\n- `rsip\/rsip_image_ec256.c` and `rsip\/rsip_ecdsa_p256.h`: non-protected branches removed (`be04a355f99`). The old software ECDSA used a plaintext key table that RSIP builds do not link. Old code is in `5e7e8866cad`.\n- `rsip\/rsip_keys.c`: `rsip_ctrl`, `rsip_cfg` and the `rsip_sha256.h` include must stay inside `#if defined(MCUBOOT_USE_RSIP_PROTECTED)`. Removing the guard breaks every project that compiles the whole `rm_mcuboot_port` folder.\n- Unused: `BOOTUTIL_CRYPTO_SHA256_BLOCK_SIZE` in `rsip_sha256.h`.\n\n## Key sections and linker\n- RSIP key section: `.mcuboot_wrapped_key`. SCE9 uses `.mcuboot_sce9_key`.\n- ra8m1 boot and image linker scripts keep both sections for gcc, llvm, iar and ac6 (`ra\/fsp\/src\/bsp\/mcu\/ra8m1\/!linker\/`).\n- Generator: `scripts\/mcu_xml_gen\/templates\/linker_policy_template.j2` (two `keep: True` entries).\n- Collected-file hashes: `data\/collected-files\/ddsc-generated.yml`. All 80 ra8m1 entries matched at `5e7e8866cad`. Never hand-edit these files. Regeneration is not yet verified.\n\n## Include paths\n- `rsip_sha256.h` includes `r_rsip.h` from `ra\/fsp\/src\/r_rsip_protected\/crypto_procedures_protected\/src\/rsip\/ra\/inc\/instances\/`. It also needs `r_rsip_api.h` and `r_rsip_cfg.h` from the common folders.\n- The protected driver's pack declares the folders. `rm_mcuboot_port\/!dsn\/module.xml` (RSIP section) declares only `rsip\/`. Builds without the driver folders fail.\n- Projects `ra8m1_ek_rsip_e51a_protected_rsa` and `_fast_boot` add the folders by hand in `projects\/rm_mcuboot_port.xml`.\n- Submodule pointer in HEAD: `50f0ce54`. Init on build machines with `git submodule update --init --recursive ra\/fsp\/src\/r_rsip_protected\/crypto_procedures_protected`.\n\n## Build failures (causes and fixes)\n- `rsip_sha256.h: fatal error: r_rsip.h` in the default `rm_mcuboot_port` project: that project compiles the whole port folder with software crypto. Fix: keep the guard in `rsip_keys.c`. Optional: exclude `protected_mode\/rsip` in that project.\n- Same error in `ra8m1_ek_rsip_e51a_protected_fast_boot_typical`: include folders missing on that machine. Init the submodule.\n\n## Flash-key scripts\n- `rm_mcuboot_port\/!test\/flash_with_key.sh <srec> <key_address_hex> <key_file>`. Checks arguments, SREC, hex address (no `0x`) and key file. Retries `rfp-cli` 20 times, 1 s apart. Exits 1 on failure.\n- The five old scripts (`flash_with_key_{ecc,ecc_rsip,rsa,rsa_3072,rsa_rsip}.sh`) are thin wrappers that forward to the new script.\n- Harness (`fsp_test_parallel.py`, around line 506) runs `script <srec> <flash_script_args values>`. Entries in `projects\/rm_mcuboot_port.xml` use `'flash_script_args': ['g_pub_key', 'pub_key_file']`.\n- Key mapping: `RSA_pub.rkey` (ra6m5 SCE9 RSA), `ECC_pub_5.rkey` (ra6m4 SCE9 fast boot), `RSA_pub_rsip.rkey` and `ECC_pub_rsip.rkey` (ra8m1 RSIP).\n- Not yet run against RFP or hardware.\n\n## Process\n- Review reports: `~\/.claude\/skills\/common\/code-review\/` (`FSPRA-5831_review.md`, `FSPRA-5831_flash_script_reply_to_PM.md`).\n- Project repo commits are made by the user. Skills repo edits are committed by the hooks.\n- The `boot_rsa` project type was removed in `9a88f39b796`. Use the `ra8m1_ek_rsip_e51a_protected_*` projects.\n\n## Open items\n1. Confirm the `rsip_keys.c` guard restore is committed, and rebuild the four failing ra8m1 projects.\n2. Decide whether to exclude `protected_mode\/rsip` from the default project, and\/or add the driver include folders to the RSIP module.\n3. Regenerate the ra8m1 linker files and confirm no diff.\n4. Reply to the review comment on `rsip_sha256.h`.\n5. Remove the five old flash scripts after a harness run.\n6. Remove `BOOTUTIL_CRYPTO_SHA256_BLOCK_SIZE`.\n","use_cases":["Configuring RSIP protected mode for RA8M1\/RA8D1 devices","Managing key sections in linker scripts for RSIP-E51A","Setting up include paths for RSIP protected drivers","Running flash-key scripts for secure boot with RSIP"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/minhnguyenyf\/skills\/blob\/7213d81500a27f3a96028144f5342ccfe4efbe4a\/mcuboot\/mcuboot-rsip-protected\/SKILL.md","source_commit":"7213d81500a27f3a96028144f5342ccfe4efbe4a","license":null,"version":null,"listing_approved_at":"2026-11-30","created_at":"2026-11-29T11:12:11.000000Z","updated_at":"2026-11-30T06:52:26.000000Z","seo_title":"MCUboot RSIP Protected Mode Configuration for RA8M1\/RA8D1","seo_description":"A guide to setting up MCUboot RSIP protected mode for RA8M1 and RA8D1 devices, covering key sections, include paths, and flash-key scripts.","seo_keywords":["MCUboot RSIP protected mode","RA8M1 RSIP configuration","RSIP key sections","flash-key scripts","MCUBOOT_USE_RSIP_PROTECTED"]}}