i.MX8M Mini MIPI CSI RGB888

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8M Mini MIPI CSI RGB888

2,980 Views
bwa1
Contributor I

Hi guys,

I'm just working on a project, that requires support for RGB888 video data over the i.MX8's CSI interface.

Unfortunately the current drivers don't support RGB888 data, so I tried to add support to the kernel.

What I did:
1. Modified mx6s_capture.c to add support for  RGB888

, {
        .name       = "RGB24 (RGB24)",
        .fourcc     = V4L2_PIX_FMT_RGB24,
        .pixelformat    = V4L2_PIX_FMT_RGB24,
        .mbus_code  = MEDIA_BUS_FMT_RBG888_1X24,
        .bpp        = 3,
    }

...

    case V4L2_PIX_FMT_YUV32:
    case V4L2_PIX_FMT_SBGGR8:
    case V4L2_PIX_FMT_RGB24:
        width = pix->width;
        break;

...

        case V4L2_PIX_FMT_RGB24:
            cr18 |= BIT_MIPI_DATA_FORMAT_RGB888;
            break;

2.Modified mxc_mipi_csi.c to add format support

, {
        .code = MEDIA_BUS_FMT_RBG888_1X24,
        .fmt_reg = MIPI_CSIS_ISPCFG_FMT_RGB24,
        .data_alignment = 32,
    }

 

With the 24bit RGB888 format, the MIPI CSI controller should switch to 32-bit mode, using a 32bit databus instead of a 16bit bus between MIPI CSI and the CSI bridge. 

Unfortunately this doesn't seem work and I fail to get all the bytes correctly.
Either I get complete bs or in some constellations the green channel is correct, while blue and red are messed up.

Here is a quick example:

Transmitted:    55CCF0 AA330F 55CCF0 AA330F ...
Received:        EA3343 EA3343  EA3343 EA3343 ...

Has anybody used the RGB888 24-bit mode of the CPU or any compatible CPU?

Labels (1)
0 Kudos
Reply
11 Replies

2,686 Views
santhosh2
Contributor IV

I am also using a custom camera RGB888, I am also facing an issue, i am getting the skip frame 0 message from mx6s_csi_irq_handler section. I am being trying to fix from past one month. let me know how did you solve

0 Kudos
Reply

2,149 Views
mallibeerala
Contributor III

Hi,

I am also getting same Issue, Did you overcome this problem, If yes, Please help us to resolve this Issue.

Currently I am getting below image.

mallibeerala_0-1640084885742.png

Thanks & Regards,
Mallikarjuna B.

0 Kudos
Reply

2,689 Views
joanxie
NXP TechSupport
NXP TechSupport

for rgb888, try to enable PARALLEL24_EN in the CSICR18 and set TWO_8BIT_SENSOR to 0 in the CSICR3

0 Kudos
Reply

2,689 Views
bwa1
Contributor I

Dear Joan,

I already tried to enable PARALLEL24_EN without any luck.
The TWO_8BIT_SENSOR option was/is disabled by default.

Have you done RGB888 already, could you share your driver modifications?

Kind regards

Berni

0 Kudos
Reply

2,689 Views
joanxie
NXP TechSupport
NXP TechSupport

what camera do you use? ov5640? I confirmed that ov5640 couldn't set rgb888

0 Kudos
Reply

2,689 Views
bwa1
Contributor I

Dear Joan,

we use a custom camera with custom MIPI IP, so not the OV5640. 

Kind regards

Berni

0 Kudos
Reply

2,689 Views
joanxie
NXP TechSupport
NXP TechSupport

suggest that you can use unit test to test it first, unit test can support rgb888 capture, and could you set your camera to 16bits first to check if you can get the correct data, then test 24bits, for unit test, you can use "mx6s_v4l2_capture.out" under /unit_tests/V4L2

0 Kudos
Reply

2,688 Views
bwa1
Contributor I

The camera works just fine with 16bits. Only 24bits seem to be a problem. 
To what unit test are you referring to and what /unit_tests/V4L2 folder?

0 Kudos
Reply

2,688 Views
joanxie
NXP TechSupport
NXP TechSupport

when your boar boot up, you should find "V4L2" folder under /unit_tests

0 Kudos
Reply

2,688 Views
bwa1
Contributor I

Ok I see, you are referring to an image generated by the BSP then.
I'll try to install your reference image and try the unit test. 

Where do I find documentation for the mx6s_v4l2_capture.out? What does it do?

0 Kudos
Reply

2,689 Views
joanxie
NXP TechSupport
NXP TechSupport

you don't need any document for this, if you don't know how to use mx6s_v4l2_capture.out, you can use the command "mx6s_v4l2_capture.out -help" to get more parameters for this

0 Kudos
Reply