|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
TU-shared surface for the DFU MRAM program/verify implementation. More...
Go to the source code of this file.
Functions | |
| ra8_err_t | priv_dfu_write_secure (uintptr_t addr, const uint8_t *src, uint32_t len) |
Program len bytes at addr through the SECURE MRAM gate. | |
TU-shared surface for the DFU MRAM program/verify implementation.
Not part of the public DFU API. Carries the handful of ra8_dfu_program.c helpers that are promoted from static to external linkage so their compound decisions can be exercised with independent influence (MC/DC) from the host unit tests. Production callers keep using the public ra8_dfu.h surface; the only consumers of these symbols outside the defining TU are the tests under tests/ (see CLAUDE.md, "Test access to
internal symbols").
Definition in file ra8_dfu_internal.h.
| ra8_err_t priv_dfu_write_secure | ( | uintptr_t | addr, |
| const uint8_t * | src, | ||
| uint32_t | len ) |
Program len bytes at addr through the SECURE MRAM gate.
The DFU core runs in the secure world and its slot MRAM carries secure attribution, so it must be programmed via MRCPC1 (k_ra8_flash_world_s). This helper drives ra8_flash_write_block directly, one 32-byte page at a time, erasing each page to the all-ones baseline first, with IRQs masked across each page program so no ISR fetches code-MRAM while the array is busy. The soft write-window installed by ra8_dfu_program_prepare is still enforced inside ra8_flash_write_block, so an out-of-slot destination is rejected.
Promoted from TU-private static linkage so the argument guard can be exercised for MC/DC directly (both production callers validate their pointer/length before dispatching here, so neither guard condition is presentable on a public-API path); defined in ra8_dfu_program.c.
| [in] | addr | 32-byte aligned MRAM destination. |
| [in] | src | Non-NULL source buffer of at least len bytes. |
| [in] | len | Non-zero multiple of the 32-byte page size. |
| k_ra8_ok | Every page committed. |
| k_ra8_err_invalid_arg | src was NULL or len was zero. |
src non-null and len a non-zero multiple of the page size. src. Program len bytes at addr through the SECURE MRAM gate.
Definition at line 61 of file ra8_dfu_program.c.
References k_ra8_dfu_page_size, k_ra8_dfu_prog_erased_byte, k_ra8_err_invalid_arg, k_ra8_flash_world_s, k_ra8_ok, memset(), ra8_flash_write_block(), RA8_PRIV, ra8_register_guard_enter(), and ra8_register_guard_exit().
Referenced by ra8_dfu_program_commit(), and ra8_dfu_program_image().