|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Directories | |
| src | |
Proves the DTC descriptor cache-coherency wiring holds with the Cortex-M85 L1 D-cache ON. The app builds with RA8_BOOT_ENABLE_CACHE_MPU, so the shared SystemInit programs the MPU and enables the I-cache, D-cache and branch predictor before main(), and the DTC vector table, the Transfer Information block and both data buffers all live in cacheable M85-private SRAM so the hazard is real. One software-triggered mem-to-mem block copy, verified, then WFI.
The hazard: the DTC fetches its vector table – and, one indirection on, each per-source TI block – straight from SRAM at activation. With the D-cache on, the CPU's writes to those descriptors sit dirty in cache where the engine cannot see them, and a stale fetch sends the transfer at the wrong TI or the wrong addresses. ra8_dtc_enable() cleans the caller-populated vector table back to RAM before setting DTCST. The DTC is direction-blind, like the DMAC, so the owning driver – here the app – cleans the TI block and the source buffer and invalidates the destination itself.
The ordering is the content:
The completion IRQ is deliberately left masked: the registered slot plus DTCE still activate the DTC, and taking the interrupt would let the completion ISR write DTCSTS while the copy is still in flight.
tools/ra8_emulator does model the DTC engine and really moves the bytes, so the whole ra8_dtc + ELC path runs off-target – but its memory is byte-exact and it models no L1 D-cache, so the poll falls through on its first iteration. The hazard this app guards against is observable only on silicon.