AnsweredAssumed Answered

Ov5640 camera RAW10 format on i.MX8MM

Question asked by Laura Nao on Jul 5, 2019
Latest reply on Jul 15, 2019 by igorpadykov

Hi all,

 

I'm trying to configure ov5640 camera on the i.MX8MM platform to work in RAW 10-bit mode.

I'm using a custom board board with Android based on the p9.0.0-1.0.0_ga release from NXP.

 

I configured the ov5640 to work in 10-bit mode and output RAW BGGR format by setting the following registers in the camera driver (ov5640_mipi_v2.c):

{0x3034, 0x1A, 0, 0}, // MIPI mode: 10-bit

{0x4300, 0x00, 0, 0}, // Output data format: RAW BGGR

{0x501F, 0x03, 0, 0}, // ISP Format: ISP RAW (DPC)

I also added the RAW 10 media bus format to the supported colour formats in the ov5640 driver:

static const struct ov5640_datafmt ov5640_colour_fmts[] = {
    {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG},
    {MEDIA_BUS_FMT_SBGGR10_1X10, V4L2_COLORSPACE_RAW}
};

I added support for the V4L2_PIX_FMT_SBGGR10 format in mx6s_capture.c driver. I also configured the following registers, based on what is reported in the i.MX8M Mini reference manual:

 

- CSI_CSICR1: set bit 0 (PIXEL_BIT) to 1 (i.e. 10-bit per pixel)

- CSI_CSICR18: set bits 25~30 (MIPI_DATA_FORMAT) to 0x2B (i.e. RAW10 format)

 

With this configuration, resulting raw image is very noisy (see attached image).

 

By looking at the interrupts, I can see multiple `32e30000.mipi_csi` interrupts firing when the frame is captured. By enabling additional debug in the mxc_mipi_csi.c driver, I noticed these interrupts signal multiple errors on the bus:

[   84.310700] ov5640_mipisubdev 5-003c: s_stream: 1
[   84.380096] CRC Error: 1
[   84.382639] Frame Start: 1
[   84.385425] CRC Error: 2
[   84.387986] CRC Error: 3
[   84.390568] CRC Error: 4
[   84.393153] CRC Error: 5
[   84.395735] CRC Error: 6
[   84.398313] CRC Error: 7
[   84.400885] CRC Error: 8
[   84.403464] CRC Error: 9
[   84.406022] CRC Error: 10
[   84.408675] CRC Error: 11
[   84.411343] CRC Error: 12
[   84.413980] CRC Error: 13
[   84.416643] CRC Error: 14
[   84.419305] CRC Error: 15
[   84.421947] CRC Error: 16
[   84.424624] CRC Error: 17
[   84.427278] Lost Frame Start Error: 1
[   84.430944] CRC Error: 18
[   84.433563] Frame End: 1

Do you have any advice on how to further debug this issue? Is there any other register I'm missing for configuring 10-bit mode for the MIPI CSI bus?

 

Any help would be appreciated.

 

Thanks,

 

Laura

Attachments

Outcomes