{
  "episode": 11,
  "slug": "openhw-cve2-ep11-sccb-camera",
  "date": "2026-11-23",
  "revision": "r31",
  "board": {
    "model": "ALINX PI-AR035-F1-1",
    "fpga": "XC7A35T-FGG484-2",
    "clock_mhz": 50,
    "uart": "115200 8N1",
    "pixel_clock_mhz": 75
  },
  "cpu": {
    "core": "OpenHW CVE2 / CV32E20",
    "isa": "RV32IM"
  },
  "scope": {
    "implemented": [
      "SCCB master 100 kHz",
      "CAM CSR window at 0x4007_0000",
      "HDMI 1280x720@60 colour bars"
    ],
    "not_implemented": [
      "MIPI CSI-2 / DVP image capture",
      "frame buffer",
      "camera preview on HDMI"
    ]
  },
  "camera": {
    "module": "AN5641",
    "sensor": "OV5640",
    "sccb_device_addr_7bit": "0x3c",
    "sccb_write_addr": "0x78",
    "register_addr_bits": 16,
    "scl_khz": 100,
    "scl_divider": 125,
    "scl_period_us": 10,
    "scl_duty": "50%",
    "id_regs": { "0x300a": "0x56", "0x300b": "0x40" },
    "sensor_id": "0x5640",
    "scan_ack_addresses": ["0x78"],
    "scl_edges_after_identify": 1251,
    "enable_pin": "CAM_GPIO (M3)",
    "enable_active_level": 1,
    "status_word": "0x00000000",
    "csr_magic": "0x45501101"
  },
  "video": {
    "resolution": "1280x720",
    "h_total": 1650,
    "v_total": 750,
    "refresh_hz": 60.606,
    "measured_fps": 60.8,
    "measured_frames": 145,
    "measured_cycles": 119189892,
    "measured_window_s": 2.3838,
    "bars": 10,
    "bar_width_px": 128,
    "bar_index_note": "x[9:7] only; x>=1024 wraps to bar 0/1, so 8 defined bars render as 10 bands",
    "marker": "80x80 dark grey, 0x202020, +8px X / +4px Y per frame with bounce",
    "border_px": 4,
    "border_colour": "0xc0c0c0"
  },
  "timing": {
    "wns_ns": 0.861,
    "tns_ns": 0.0,
    "tns_failing_endpoints": 0,
    "whs_ns": -0.85,
    "ths_ns": -4.166,
    "whs_failing_endpoints": 7,
    "endpoints": 21780,
    "worst_hold_path": "rgmii_rx -> rgmii_tx inter-clock, 5 endpoints (EP10 Ethernet path)",
    "sys_clk_whs_ns": -0.023,
    "sys_clk_whs_failing_endpoints": 2,
    "video_clk_wns_ns": 7.909,
    "video_clk_whs_ns": 0.135
  },
  "utilization": {
    "lut": 7714,
    "lut_pct": 37.09,
    "ff": 8210,
    "ff_pct": 19.74,
    "bram_tile": 13.5,
    "bram_pct": 27.0,
    "dsp": 10,
    "dsp_pct": 11.11,
    "iob": 52,
    "iob_pct": 20.8
  },
  "bitstream": {
    "file": "bit/top_cve2_ep11.bit",
    "bytes": 2192137,
    "md5": "7945bb0a02bdb564bdc0f309b37d2522",
    "sha256": "7b5f5df1038cbb905a3d37aad8e7618524043b4142073e0cc3cbe30dcc297465"
  },
  "revision_chain": [
    { "rev": "r28", "md5": "a8c4d72b014a2797ac41d768fb97d5dd", "state": "SCL ~3.1 MHz, all NACK" },
    { "rev": "r29", "md5": "82e9bdc9ca4babcd7ec84de81d0b30fc", "state": "SCL 100 kHz ok, read returns 7 bits" },
    { "rev": "r30", "md5": "2e71cb3b5128281397b3f593dda646c1", "state": "0x300A ok, 0x300B NACK" },
    { "rev": "r31", "md5": "7945bb0a02bdb564bdc0f309b37d2522", "state": "SENSOR_ID 0x5640, STATUS 0" }
  ],
  "tools": {
    "vivado": "2025.2",
    "simulator": "xsim",
    "build_host": "192.168.8.237",
    "project": "/media/alinx/nvme4t/fpga-love/pi_ar035_f1_1_cve2_ep11"
  },
  "limits": [
    "No MIPI/DVP capture: HDMI shows colour bars only",
    "Only register reads verified on board; write path present in RTL but not exercised in the UART log",
    "Single 0x300A/0x300B ID read plus full 7-bit address scan; no OV5640 mode configuration",
    "Colour bar count cosmetic mismatch (8 defined bars, 10 bands on screen)",
    "Hold violation -0.850 ns on rgmii_rx->rgmii_tx async path inherited from EP10"
  ]
}
