Skip to content

Add Renesas RX71M support - #942

Open
yosuke-wolfssl wants to merge 4 commits into
wolfSSL:masterfrom
yosuke-wolfssl:feat/rx71m
Open

yosuke-wolfssl wants to merge 4 commits into
wolfSSL:masterfrom
yosuke-wolfssl:feat/rx71m

Conversation

@yosuke-wolfssl

@yosuke-wolfssl yosuke-wolfssl commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds wolfBoot support for the Renesas RX71M (RSK+ RX71M, R5F571MLCDFC: 4 MB code flash, 512 KB RAM, no TSIP), built with GCC for Renesas RX 14.2 (USE_GCC=0) and using software crypto only.

Changes (hal/renesas-rx.c)

  • Target wiring: config/examples/renesas-rx71m.config, hal/rx71m.ld and arch.mk checks. NVM_FLASH_WRITEONCE=1 is required; PKA=1 and DELTA_UPDATES=1 are rejected.
  • Boot tables (src/boot_renesas.c): the RXv2 fault vectors go to INT_Fault. RomCodeArea[] keeps ROMCODE (0xFFFFFF9C) at 0xFFFFFFFF, so ROM code protection stays off. The option-setting memory is written only with the opt-in WOLFBOOT_RENESAS_OSM.
  • Clock, UART, LED: 24 MHz crystal × 10 gives 240 MHz (RX_MAIN_XTAL_HZ sets the crystal for other boards). The console is on SCI7 (P90/P92), and LED0 is on P03.
  • Code flash driver:
    • copies the FCU firmware to FCURAM at init
    • programs 256-byte units, each at most once per erase (FLASH_ERR_NOT_BLANK otherwise)
    • runs from RAM with interrupts masked during each program and erase, with timeouts and FSTATR error checks
    • #error unless RAM_CODE and __WOLFBOOT are defined
  • Shared RX changes: uart_write() waits for TEND after the last character. The test app's printPart() reads the state through wolfBoot_get_partition_state().
  • CI: two RX71M build jobs (little endian; big endian with OSM), plus a check that ROMCODE in wolfboot.bin is 0xFFFFFFFF.
  • Docs: a Renesas RX71M section in docs/Targets.md (layout, flashing with rfp-cli, update wear, OSM and endianness) and an RX71M entry in docs/Renesas.md.

Verification

On the RSK+ RX71M with an E2 Lite:

Test Result
Boot and signature check pass
wolfBoot_success() persists across reset pass
Update to v2 pass
Rollback when v2 does not confirm pass
Update confirmed at v2 pass
Update interrupted twice by reset resumes and completes
Erase return codes during one 3-sector update 144 erases, all 0
PSW.I around program/erase masked during it, restored after
EXTB/INTB at main FFFF0400 / FFFF0000
  • RX71M, RX65N and RX72N example configs build with no warnings.

Not in this PR

  • TSIP, external flash, delta updates.
  • CC-RX build with E2 Studio project
  • Follow-ups for RX65N/RX72N: USE_GCC?=0 in their configs, and routing their fault vectors to INT_Fault.

@yosuke-wolfssl yosuke-wolfssl self-assigned this Oct 16, 2026
Copilot AI balanced review requested due to automatic review settings October 16, 2026 06:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Flash timeout handling can continue writing to a full buffer or resume execution before code flash is readable.

2 open findings
What changed in this PR

Adds Renesas RX71M support to wolfBoot using software cryptography and the GNU RX toolchain.

Changes:

  • Adds target configuration, linker layout, boot vectors, and board initialization.
  • Implements RAM-resident flash programming and erase operations.
  • Adds build coverage, ROMCODE checks, and setup documentation.
File Description
test-app/​RENESAS_RX.ld Places flash routines in RAM.
test-app/​Makefile Enables RAM execution for the RX71M driver.
test-app/​app_renesas_rx.c Reads partition state through the public API.
src/​boot_renesas.c Adds RX71M fault vectors and protection settings.
hal/​rx71m.ld Defines RX71M memory and section layout.
hal/​rx71m.c Identifies the shared HAL implementation.
hal/​renesas-rx.h Adds RX71M registers and flash constants.
hal/​renesas-rx.c Implements board initialization and flash operations.
docs/​Targets.md Documents RX71M setup and limitations.
docs/​Renesas.md Lists RX71M support.
config/​examples/​renesas-rx71m.config Supplies the example target configuration.
arch.mk Adds target checks and build flags.
.github/​workflows/​test-configs.yml Adds RX71M build variants.
.github/​workflows/​test-build-renesas-rx.yml Checks the ROMCODE protection word.
.github/​docker/​renesas-rx/​README.md Lists RX71M among supported configurations.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hal/renesas-rx.c Outdated
Comment thread hal/renesas-rx.c Outdated
- renesas-rx71m.config, rx71m.ld, rx71m.c: RSK+ RX71M layout with
  NVM_FLASH_WRITEONCE=1, .romcode at 0xFFFFFF80 and .ofs_rx71m at
  0x00120040.
- arch.mk: reject PKA, DELTA_UPDATES and NVM_FLASH_WRITEONCE other
  than 1 for rx71m; build with -misa=v2; drop .ofs_rx71m from
  wolfboot.bin and fill gaps with 0xFF.
- renesas-rx.h: rx71m clock, flash, FACI and MPC values;
  hal_clk_init() sets SYS_MEMWAIT.
- boot_renesas.c: INT_Fault for the rx71m fault vectors,
  RomCodeArea[] with ROMCODE 0xFFFFFFFF, and the option-setting
  array under WOLFBOOT_RENESAS_OSM.
- hal_clk_init(): rx71m runs the main crystal (RX_MAIN_XTAL_HZ,
  default 24MHz) through the PLL to 240MHz.
- uart_init(): SCI7 on P90/P92 by default; uart_write() waits for
  TEND. hal_led_on()/hal_led_off(): LED0 on P03.
- renesas-rx.c: TARGET_rx71m flash driver run from RAM, with #error
  unless RAM_CODE and __WOLFBOOT are defined. It copies the FCU
  firmware at init, programs 256-byte units at most once per erase,
  and masks interrupts with timeouts and FSTATR checks for each
  program and erase.
- renesas-rx.h: PSW, FASTAT and FAEINT bits and the new flash
  error codes.
- renesas-rx71m.config: commented RX_MAIN_XTAL_HZ line.
- test-app: link .ramcode into RAM and build renesas-rx.o with
  RAM_CODE and __WOLFBOOT for rx71m.
- app_renesas_rx.c: printPart() takes the partition id and reads the
  state through wolfBoot_get_partition_state(); the trailer line
  prints BOOT or none.
- test-configs.yml: RX71M build jobs, little endian and
  BIG_ENDIAN=1 with WOLFBOOT_RENESAS_OSM.
- test-build-renesas-rx.yml: check that ROMCODE in wolfboot.bin is
  0xFFFFFFFF for rx71m.
- Targets.md: Renesas RX71M section; Renesas.md and the CI image
  README list RX71M.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #942

Scan targets checked: wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): .github/docker/renesas-rx/README.md, .github/workflows/test-build-renesas-rx.yml, .github/workflows/test-configs.yml, arch.mk, config/examples/renesas-rx71m.config, docs/Renesas.md, docs/Targets.md, hal/renesas-rx.h, hal/rx71m.ld, test-app/Makefile, test-app/RENESAS_RX.ld
Coverage: 3 of 4 in-scope changed file(s) opened by the reviewer; not opened: hal/rx71m.c

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants