Ricoh GR IV: CEVA-CV AI DSP Co-Processor Awakening & Deep Learning Autofocus Mod
Frame a human subject in Live View: The camera's on-sensor PDAF tracking box will magnetically snap to and track the subject across the frame.
- Custom firmware
- Stable
- Medium brick risk
- Reversible
This project hasn't been claimed by its maintainer yet, so its details come from the community. Is it yours? Claim it
Release Notes - v1.0.5: True CNN Activation & LiveView Face Detection Bridge Fix
Release Date: 2026-10-21
Target Device: Ricoh GR IV (firmware base v1.11 fwdc248b.bin)
Co-Processor: Socionext Milbeaut M10V on-die CEVA-CV Vector AI DSP (0x41000000)
Neural Network: Pentax K-3 Mark III Deep Learning Subject/Face Recognition CNN
1. Executive Summary: Why v1.0.4 Did Not Activate the CNN Model
In v1.0.4, the camera successfully booted and operated without freezing or crashing on half-press AF. However, real-world testing revealed that side-profile faces and backlit/shadow faces were not detected at all, performing identically to the stock FotoNation face detector.
Through deep static disassembly of the RTOS kernel and execution path auditing, we uncovered three critical root causes that caused the DSP CNN pipeline to silently fail or fall back to stock FotoNation on every frame:
Root Cause 1: SD Card Drive Letter Mismatch in LoadDsp ('A' vs 'C')
In stage3_ai_patcher.py, DspService::LoadDsp was invoked with argument r1 = 0x41 (character 'A').
Reverse engineering the DspService::LoadDsp implementation at 0x53966d74:
0x53966d84: add r7, fp, #-0x40 ; template string buffer "A:\DF_EX.BIN"
0x53966d88: strb r1, [fp, #-0x40] ; Overwrites drive letter with r1!
- In Ricoh GR IV RTOS, drive
A:\is the internal ROM resource partition (12_RES.bin). - The SD card root is mounted as drive
C:\(0x43), as verified in all Ricoh firmware paths (C:\fwdc248b.bin,C:\DCIM\, etc.). - Calling
LoadDspwith'A'failed immediately to find or openDF_EX.BIN,DF_ID_S.BIN, andDF_IP.BIN. - Because file loading failed, the
LOADEDbit (status & 2) was never asserted,Start()was never invoked, and the DSP remained inactive. - In Cave 2, the check
tst r2, #1(STARTED bit) evaluated to 0 on every single frame, silently routing 100% of execution tofallback_stock(FotoNation)!
Fix in v1.0.5:
- Changed argument
r1to0x43('C') in both Cave 1 and Cave 2. - Added a Dual-Guarantee On-Demand Wakeup in Cave 2: If the SD card was not yet mounted when Hook 1 fired at early boot, Cave 2 detects
STARTED == 0on frame 0, callsLoadDsp(svc, 'C', 0, 0),Start(), andTest(), guaranteeing DSP ignition.
Root Cause 2: Uninitialized BSS Pointer for LiveView Preview Buffer
Cave 2 attempted to read the LiveView preview image buffer using LV_IMAGE_SVC_VA = 0x55395a18 (ldr r3, [0x55395a18, #8]).
Memory map auditing revealed:
0x55395a18resides in uninitialized BSS space. At runtime,[0x55395a18, #8]evaluates to0x0.- Cave 2 checked
cmp r0, #0; beq fallback_stock. Even if the DSP had started, this null check diverted execution tofallback_stockon 100% of frames!
Deep Disassembly of FaceDetectionService::Task (0x5386ea8c):
At the exact hook site in FaceDetectionService::Task, register r4 holds this (FaceDetectionService*):
[r4, #0x38]points toFdLibraryService*.[r0, #0x44]points top_FdEngine*.[r3, #0xc]is the actual physical YUV LiveView preview frame buffer (verified at0x5386d13c: str r0, [r5, #0xc])![r3, #0x10]is the dynamic frame pitch (stride, default 960).
Fix in v1.0.5: Cave 2 now extracts the preview frame dynamically via:
ldr r0, [r4, #0x38] ; r0 = FdLibraryService*
cmp r0, #0
beq fallback_stock
ldr r3, [r0, #0x44] ; r3 = p_FdEngine*
cmp r3, #0
beq fallback_stock
ldr r0, [r3, #0xc] ; r0 = active YUV LiveView frame buffer!
ldr ip, [r3, #0x10] ; ip = frame pitch (e.g., 960)
cmp r0, #0
beq fallback_stock
The downsampler now multiplies by ip dynamically (mul r6, ip, r6), ensuring perfect aspect ratio and pristine tensor generation.
Root Cause 3: Odd-Frame Decimation Fallback & High Confidence Threshold
- Decimation Wiping Neural Detections:
- In v1.0.4, decimation was implemented as
tst r1, #1; bne fallback_stock. - On odd frames (every 33 ms), execution jumped to stock FotoNation. Since FotoNation cannot detect side-profile or backlit faces, it reported
face_count = 0on every odd frame, immediately clearing any neural bounding box from the screen! - Because the hardware CEVA-CV DSP executes inference in parallel with <0.4% host CPU usage, per-frame inference is completely free. Odd-frame decimation fallback has been removed.
- In v1.0.4, decimation was implemented as
- Confidence Threshold Sensitivity:
- Threshold was set to 60 (approx 24% probability), which is tuned for front-facing direct portraiture.
- Reduced threshold to 25 (approx 10% probability), matching Pentax K-3 III's robust detection threshold for side profiles, dark/backlit scenes, tilted angles, and face masks.
2. Verification & Integrity Checklist
| Check | Expected | Actual v1.0.5 Result | Status |
|---|---|---|---|
| Cave 1 Size & Alignment | 152 bytes @ 0x53000d60 | 152 bytes (ends 0x53000df8) | PASS |
| Cave 2 Size & Alignment | $\le 1024$ bytes @ 0x53000e00 | 756 bytes (ends 0x530010f4) | PASS |
| Cave 2 Limit Margin | Ends before 0x53001200 | Margin = 268 bytes headroom | PASS |
Zero Calls to CreateTask | 0 calls to 0x538e32c4 | 0 calls | PASS |
| Drive Letter for SD Loading | Drive 'C' (0x43) | Passed r1 = 0x43 in both caves | PASS |
| Preview Buffer Retrieval | Dynamic p_FdEngine extraction | [r4, #0x38] -> [r0, #0x44] -> [r3, #0xc] | PASS |
| Round-Trip Outer Container | word_sum == 0 | word_sum == 0 | PASS |
| Round-Trip Inner Payload | word_sum == 0 | word_sum == 0 | PASS |
3. Firmware Release Hashes
- Active Flashable Firmware:
output/fwdc248b.bin- Size: 38,791,732 bytes
- SHA-256:
d058ca69c47da83c7a0937458ad0e8bd9674fb64965c5facd75a8098242ca8c0
- Preserved Stage 3 Firmware:
output/fwdc248b_stage3_ai_track.bin
Before you start
- How hard is it?
- EasyCopy a file or use a web page. No extra software.
- What you need
- Comfort with the command line
- A computer
- An SD card or USB stick
- Can it break my device?
- Small chance of trouble, with a way to recover.
- Can I undo it?
- Yes. You can go back to the official software.
Did it work for you?
Did Ricoh GR IV: CEVA-CV AI DSP Co-Processor Awakening & Deep Learning Autofocus Mod v1.0.5 work on your Ricoh GR IV?
No reports yet for v1.0.5.
One-tap reports from owners. Bricked reports are checked before they count.
Compatibility
Devices: Ricoh GR IV.
No compatibility information yet.
Getting started
From the project's README ("3. Quick Start: Flashing & Usage"):
> [!IMPORTANT] > No disassembly, no soldering, and no UART debug cable required. > The entire modification runs 100% autonomously on camera power-on and is flashable via Ricoh's official SD card firmware updater.
Step 1: Prepare SD Card Files
- Format an SD Card with FAT32.
- Copy the three DSP runtime binaries to the SD card root:
- DFEX.BIN (4,112,408 bytes)
- DFIDS.BIN (65,536 bytes)
- DFIP.BIN (16,384 bytes)
- Copy the patched firmware image to the SD card root as fwdc248b.bin:
- Recommended First Step: Flash Stage 2 minimal verification firmware output/fwdc248bstage2dspwake.bin first to verify clean startup and hardware DSP ignition.
- Once verified, flash Stage 3 full AI tracking firmware output/fwdc248bstage3aitrack.bin.
Your SD card root directory will look like: SD Card Root (C:) ├── fwdc248b.bin (38,693,256 B [Stage 2] or 38,791,732 B [Stage 3]) ├── DFEX.BIN ( 4,112,408 bytes - CEVA-CV Execution partition) ├── DFIDS.BIN ( 65,536 bytes - Neural Network weights) └── DFIP.BIN ( 16,384 bytes - Reset vector table)
Step 2: Flashing Firmware
- Insert the SD card into your Ricoh GR IV with a fully charged battery.
- While holding down the DISP (or MENU) button, turn the camera ON.
- The official firmware update screen will appear, showing the current version (v1.11) and the update version.
- Select Yes to execute the update. Wait for the progress bar to reach 100% and restart.
Step 3: Experience AI Autofocus …
Risk and recovery
- Brick risk
- Medium
- Reversible
- Yes
- Requires opening the device
- No
From the project's README ("4. Safety, Brick-Prevention & Emergency Recovery Guide"):
Emergency Recovery (If Camera Fails to Boot Normally) > [!TIP] > Your camera is NOT permanently bricked! > This project never touches the bootloader partitions (00BOOTPARA.bin through 04BOOT.bin / IPL). > The camera's built-in emergency recovery mode runs from the boot ROM / IPL before RTOS executes. Even if the RTOS image hangs or crashes, the bootloader update mode remains 100% operational.
Unbricking Steps:
- Power Off: If the camera is unresponsive (black screen or power LED on), remove the battery for 10 seconds and reinsert.
- Prepare SD Card: Place the official unmodified fwdc248b.bin (v1.11 stock firmware) or the fixed fwdc248bstage2dspwake.bin on the root of your SD card (named fwdc248b.bin).
- Trigger Hardware Update Mode:
- Make sure the camera is completely OFF.
- Press and hold the MENU (or DISP) button.
- While continuing to hold MENU / DISP, press the Power button.
- The camera will bypass RTOS and launch the official Firmware Update screen directly.
- Select Yes to flash back clean firmware and restore normal operation!
Low-Level Architecture Safeguards
- AAPCS 8-Byte Stack Alignment & Full APCS Frame Construction:
- The code cave executes a complete APCS frame construction (mov ip, sp; push {r4-r7, fp, ip, lr, pc}; sub fp, ip, #4; sub sp, sp, #8) before any function call.
- Registers r0-r3 (16 bytes) and r4-r8, lr (24 bytes) are preserved on strictly double-word (8-byte) aligned boundaries. …
Releases
| Version | Name | Released |
|---|---|---|
| v1.0.5 | v1.0.5 - True CNN Activation & LiveView Face Detection Bridge FixLatest | 21 October 2026 |
| v1.0.4 | v1.0.4 - Dual-Hook Architecture & Half-Press AF Freeze Fix | 21 October 2026 |
| v1.0.3 | v1.0.3 - Continuous LiveView AI Autofocus & LCD Green Box Hook | 21 October 2026 |
| v1.0.2 | v1.0.2 - Fixed Stage 3 MMU Permission Fault | 21 October 2026 |
| v1.0.1 | v1.0.1 - Critical Boot Fix & Dual Stage Releases | 21 October 2026 |
| v1.0.0-stage3 | v1.0.0: Stage 3 AI Live View Tracking Bridge | 19 October 2026 |
Credits, license and support
- License
- MIT