ESP32-P4 CSI Partial Frames

TixoRebel
Posts: 2
Joined: Fri May 29, 2020 4:05 am

ESP32-P4 CSI Partial Frames

Postby TixoRebel » Thu Oct 09, 2025 6:58 pm

I'm trying to receive YUV422 image data through the ESP32-P4's MIPI-CSI port, but I'm running into issues where I only receive partial frames. The video resolution is 1920x1080 @ 30Hz, 16bpp, which should be well within the limits of the CSIs maximum bitrate of 1 Gbps per lane. I had the bitrate set to 972 Mbps (synchronized with the transmitter) and was receiving only a small fraction of the frame, the rest was zeros. When lowering it to 594 Mbps (changing the transmitter to match) I started receiving about half the frame (see attached, the green region was all zero in the received buffer). I have the PSRAM set to 200 MHz and ISP set to 240 MHz, see the full CSI and ISP config below, any help would be greatly appreciated.

Code: Select all

    esp_cam_ctlr_csi_config_t csi_config = {
        .ctlr_id = 0,
        .clk_src = MIPI_CSI_PHY_CLK_SRC_DEFAULT,
        .h_res = 1920,
        .v_res = 1080,
        .data_lane_num = 2,
        .lane_bit_rate_mbps = 594,
        .input_data_color_type = CAM_CTLR_COLOR_YUV422,
        .output_data_color_type = CAM_CTLR_COLOR_YUV422,
        .byte_swap_en = false,
        .queue_items = 1,
        .bk_buffer_dis = true,
    };
    esp_cam_ctlr_handle_t cam_handle = NULL;
    esp_err_t ret = esp_cam_new_csi_ctlr(&csi_config, &cam_handle);
    
    isp_proc_handle_t isp_proc = NULL;
    esp_isp_processor_cfg_t isp_config = {
        .clk_src = ISP_CLK_SRC_PLL240,
        .clk_hz = 240 * 1000 * 1000,
        .input_data_source = ISP_INPUT_DATA_SOURCE_CSI,
        .input_data_color_type = ISP_COLOR_YUV422,
        .output_data_color_type = ISP_COLOR_YUV422,
        .has_line_start_packet = false,
        .has_line_end_packet = false,
        .h_res = 1920,
        .v_res = 1080,
        .flags.bypass_isp = true,
    };
    ESP_ERROR_CHECK(esp_isp_new_processor(&isp_config, &isp_proc));
Attachments
framebuf.png
framebuf.png (383.91 KiB) Viewed 815 times

Who is online

Users browsing this forum: Qwantbot and 5 guests