Skip to the content.

E14 — V3F code from flash vs RAM

   
ID E14
Date 2026-12-02
Status done
Decisions D90 (DECISIONS.md)
Board #1 (rev A, 12 MHz crystals)
Firmware + results fw/tests/2026-12-02-10-adcdual-v5f-flash (sources, binaries, results.txt)
Scripts v5fbench.py, usbfs.py

Summary: The V3F runs a loop ≈ 15× faster from RAM than from flash (no V3F I-cache); USB ISR in RAM: IN 525 → 880 kB/s, OUT → 775 kB/s.

What

Same 10-instruction loop compiled into flash and into RAM, timed at HCLK 48 and 96 MHz, with FLASH enhanced read mode off/on; then the USBFS interrupt handler moved to RAM and E9 re-run.

Results

V3F loop (131072 iterations) 96 MHz 48 MHz
flash 262 ms (192 cycles/iteration) 284 ms
flash + enhanced read (EHMOD) 218 ms 240 ms
RAM 17.8 ms (13 cycles/iteration) 35.5 ms

Lesson

Benchmark where the code runs (flash vs RAM) before calling a result CPU-limited.

Chip facts and numbers: fw/LEARNINGS.md. All experiments: index.