MI VIF DEBUG SOP


REVISION HISTORY

Revision No.
Description
Date
1.00
  • Initial release
  • 2024.12.9

    1. Introduction

    This document aims to introduce how to conduct preliminary troubleshooting and quickly locate issues when encountering problems related to MI VIF and Sensor, as well as what information needs to be provided to RD for analysis once it is determined that the issue is related to the Sigmastar SDK.

    Due to the physical proximity of the Sensor and ISP in the video pipeline, it is common for a single module error to cause other modules to log abnormal messages. In such cases, the following diagram can be referenced for quick issue localization:

    1. cat /proc/mi_modules/mi_vif/mi_vif0
    2. Compare the two judgment conditions in the diagram, first check the dev attr and then check the outport attr, categorizing the issue to the corresponding module.
    3. Further debug the issues of each module: sensor, vif, isp.

    2.1 I2C Error

    The debugging process is as follows:

    Process Confirmation Method Key Information Solution for Anomalies
    A Cross-test to confirm whether the related hardware is normal Specific cross-test steps to determine if the issue occurs only on specific hardware or platforms Feedback the test situation to the customer/vendor to understand if other configurations are needed on the hardware circuit
    B Check the dts settings against the padmux configuration table and hardware schematic, confirming whether the corresponding register values are correct padmux bank: 0x103c
    gpio bank: 0x103e
    1. If the dts does not match the schematic, consult CAE or the vendor to see if there is any rework
    2. Confirm that the padmux is set via padmux.dtsi: refer to Sigmastar_GPIO Usage Reference
    C Use LA or an oscilloscope to measure the voltage and mclk frequency of the relevant pins 1. rst pin, mclk, sensor power supply
    2. i2c sda scl waveform
    1. Please confirm with CAE or the vendor the pins and working voltage and frequency required for sensor power supply
    2. Please confirm with the i2c owner whether the waveform is correct

    2.2 Sensor Not Outputting Stream

    The debugging process is as follows:

    Process Confirmation Method Key Information of the Process Feedback and Solutions for Anomalies
    A Cross-test to confirm whether the related hardware is normal Specific cross-test steps to determine if the issue occurs only on specific hardware or modules Communicate with the customer/vendor about the test situation to understand possible hardware issues
    B Check the dts settings against the padmux configuration table and hardware schematic, confirming whether the corresponding register values are correct padmux bank: 0x103c
    gpio bank: 0x103e
    1. If the dts does not match the schematic, consult CAE or the vendor to see if there is any rework
    2. Confirm that the padmux is set via padmux.dtsi: refer to Sigmastar_GPIO Usage Reference
    C Confirm whether the MIPI sensor's data lane swap and P/N swap are configured correctly, using an oscilloscope to measure whether each lane's p/n is correct data/clk lane waveform diagram Find the customer/CAE to locate the cause of the data lane waveform anomaly
    D Refer to the datasheet to confirm whether the power-on sequence is correct Power-on timing diagram and actual measured power-on timing Please ask the customer/vendor to assist in confirming the power-on sequence
    E Refer to the datasheet to confirm that the differential signals of the MIPI RX data lane are correct, with voltage and frequency within the correct range Focus on the MIPI data lane LP->HS waveform Please ask the vendor/CAE for assistance in confirmation
    F Read the register information of the corresponding sensor pad, 0x7e and 0x7f are the line count and pixel count received by MIPI RX, which should remain unchanged after multiple reads pad0: bank 153b pad2: bank 153E 1. Try asking the vendor to change the sensor clk lane to non-continuous mode
    2. Disable MIPI CSI MCG in the sensor driver
    G If it can be connected to VIF, you can dump images for confirmation. For special data (such as pdaf data), you can ask the vendor/customer for confirmation Images Please confirm the validity of the data with the vendor/customer
    H Dump information to VIF owner for analysis: 1 ./pcupid_vif_reg.sh NA NA

    2.3 Sensor Image Anomaly

    The debugging process is as follows:

    Process Confirmation Method Key Information Solution for Anomalies
    C Check whether crop flip/mirror is set in the init table init table and datasheet 1. Based on the initial Bayer format and crop/mirror/flip operations in the init table, deduce the actual Bayer ID
    2. If there are still issues with the above deduction, try modifying the sensor driver to test all three other Bayer IDs
    D Cross-test to confirm whether the related hardware is normal Specific cross-test steps to ensure that the issue is caused only by specific hardware or modules Feedback the test situation to the customer/vendor to understand if the sensor may be affected by external environments or specific registers
    E CAE analyzes whether there are remnants on the MIPI RX in the schematic Board schematic Please ask CAE to remove all circuit remnants that may affect the MIPI RX
    F Use the sensor pattern to confirm whether the abnormal image is generated by VIF Sensor pattern image Consult the vendor about possible causes of anomalies in the sensor pattern
    H Dump information for VIF owner to analyze 1 ./pcupid_vif_reg.sh NA NA

    2.4 Multi-Sensor Anomalies

    This issue usually occurs when a single sensor cannot output, and it can only be reproduced with multiple sensors.

    Debugging process:

    1. Check the dts and sensor driver for pin configuration issues, such as sensor0 using sensor2's GPIO in the dts.
    2. Check whether the sensor's work mode is slave mode, for example, sensor0 set to slave mode relying on sensor2's vsync.
    3. Dump the registers during normal and abnormal conditions (padmux: 103c gpio:103e) and compare the differences.

    3.1 VIF Frame Rate Anomaly

    Debugging process:

    Process Confirmation Method Key Information Solution for Anomalies
    A Repeatedly cat mi_vif0 to observe the dev attr and outport attr's frame interval, as shown in the diagram below
    cat /proc/mi_modules/mi_vif/mi_vif0 If there are anomalies in the frame intervals observed in these two places, you can first measure the waveform to confirm whether the sensor output frame rate also fluctuates
    B Repeatedly cat mi_vif0 outport attr to check if the fail and drop counts have increased cat /proc/mi_modules/mi_vif/mi_vif0 Please ask MI_SYS to help confirm why there are fails or drops
    C Check the current CPU loading and bandwidth usage
    miu wiki
    1. cat /sys/devices/system/miu/miu0/bw
    2. top
    Please ask MI_SYS to help confirm whether there are anomalies in system load or if it can be reduced

    mi_vif0 debug info:

    3.2 VIF Image Anomaly

    Debugging process:

    1. Look for the datasheet or consult the vendor, enable the sensor pattern to check VIF output.
    2. Use VIF debug cmd to enable VIF patgen and check VIF output.

      echo patgen vifGroup width height fps fmt chn fieldModeEnable enable >/proc/mi_modules/mi_vif/mi_vif0

      example: echo 0 1920 1080 30 32 0 0 1 >/proc/mi_modules/mi_vif/mi_vif0

    3. If all the above steps are normal, continue to apply patterns to subsequent modules until you can locate the module causing the image issue.

    3.3 VIF FIFO Full

    Debugging process:

    1. Confirm whether the current VIF-ISP is in frame mode or real-time bind. If it is in real-time bind, please consult the ISP owner.
    Process Confirmation Method Key Information Solution for Anomalies
    A Check the chip specifications to see if the current bandwidth is near or exceeds the critical value
    NA You can try reducing the sensor's resolution or fps to see if the situation improves
    B Check the current VIF DMA priority, try increasing the VIF DMA priority to see if it alleviates the FIFO full issue cat /sys/devices/system/miu/miu0/bw Please ask the MIU owner to confirm whether VIF QoS can be further improved