Skip to content

OV5647 I2C initialization fails on Grove Vision AI V2 with custom firmware #115

Description

@keunyoung39

Environment

Board: Grove Vision AI Module V2
Camera: OV5647 IR Wide (120° FoV)
OS: Windows 11
Toolchain: ARM GNU Toolchain 13.2
Repository: sscma-example-we2
App: allon_sensor_tflm

Problem Description
When building custom firmware from sscma-example-we2 repository, OV5647 camera initialization always fails with I2C error code -60 (E_DEV_I2C_ADDR_NO_ACK).
The same camera works correctly when flashed with SenseCraft firmware (Seeed_SenseCraft_AI_*.img), so the hardware is confirmed to be working.
Boot Log (Custom Firmware)
cis_OV5647_init
Set PA1(AON_GPIO1) to High
hx_drv_cis_set_slaveID(0x36)
dw_iic_write err_state:2
dw_iic_write err_code:-60
[hx_drv_i2cm_write_data]-L:701, Fail:-60
retry=0, (regAddr=0x4800, val=0x01) Fail (-60)
OV5647 off by app fail
OV5647 Init Stream by app fail
...
Event loop start
EVENT EVT_INDEX_EDM_WDT3_TIMEOUT TRIGGERED
OV5647 on by app fail
What I've Tried

Fixed DEAULT_XHSUTDOWN_PIN from AON_GPIO2 → AON_GPIO1
Added 200ms delay after GPIO HIGH
Changed MCLK from DIV3 → DIV10
Added hx_drv_scu_set_SEN_I2C_MST_SDA_pinmux(SCU_SEN_I2CM_SDA_PINMUX_I2CM_SDA_0)
Added hx_drv_scu_set_SEN_I2C_MST_SCL_pinmux(SCU_SEN_I2CM_SCL_PINMUX_I2CM_SCL_0)
Added hx_drv_scu_set_SEN_I2C_MST_SDA_pinmux(SCU_SEN_I2CM_SDA_PINMUX_MIPI_I2C_M_SDA) (MIPI I2C path)
Added hx_drv_i2cm_init(USE_DW_IIC_1, HX_I2C_HOST_MST_1_BASE, DW_IIC_SPEED_FAST)
Added PA2/PA3 pinmux settings
Added PB9/PB10 pinmux settings
Moved hx_drv_cis_init() outside GROVE_VISION_AI block (following HM0360 pattern)
Added pinmux_cfg.pin_sen_i2cm_scl/sda in pinmux_init.c

None of these resolved the issue.

Key Question
What is the correct I2C initialization sequence for OV5647 on Grove Vision AI V2?
Specifically:

Which I2C Master port does hx_drv_cis_setRegTable() use internally? (USE_DW_IIC_0 or USE_DW_IIC_1)
Is there additional pinmux or clock configuration needed for the SEN_I2CM interface on Grove Vision AI V2?
Why does SenseCraft firmware work but custom-built firmware using the same allon_sensor_tflm app fails?

Additional Info

SenseCraft boot log also shows I2C -60 error on startup, but camera works after web Deploy
sensor_type: 15 is detected correctly (sensor hardware present)
MIPI configuration is accepted (MIPI LINE LENGTH: 2592, MIPI FRAME LENGTH: 1944)
The issue appears to be specifically in the I2C Master initialization for the SEN_I2CM interface

Goal
Successfully initialize OV5647 camera in custom firmware to use full 120° FoV (2592x1944 → downscale to 640x480) instead of the 240x240 crop used by SenseCraft.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions