Developing a CX3 application using the MIPI Aptina MT9M114

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaSt_4567191
Level 4
Level 4
10 likes given 5 likes given First like received

Hello community

I am starting to develop an application which employ the mentioned sensor starting for an example application. I actually found those

a . C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\cx3_examples

b. MIP2USB_Bridge which can be found fresh from in the installation

a. looks quite old (no WIn 10 is mentioned) and the readme is asking for some files which are not in the project (see image below), namely

  1) cyu3mipicsi.a       :      Library providing the APIs for the CX3 Mipi-Csi2 interface.

  2) cy_as0260.a         :      Library providing APIs to configure the Aptina AS0260 sensor.

                                In case a different sensor needs to be used, this library (and the calls

                                made to it) should be replaced with the customer defined sensor library.

  3) cyu3mipicsi.h       :      Header file defining the CX3 Mipi-CSI2 interface APIs.

  4) cyu3imagesensor.h   :      Header file defining the Image sensor APIs.

Also, certain features are not supported

b. is the latest and gretes but the sensor data are left completely to the user.

What do you recommend? Any drawback if I just copy the yuv422_as0260.cycx file from a into cx3config.cycx?

I am new to this matter, so be patient )

Thanks much

pastedImage_0.png

1 Solution

Hello Marco,

I understand that you want to know how to configure your (APTINA) sensor using the CX3 example. Is this right.?

Please refer to this KBA Steps to Setup up MIPI CSI Camera Solution with CX3 – KBA225748 and follow the steps.

As per this KBA

"The cyu3imgasensor.c and cyu3imgagesensor.h are also created and saved in this project. The cyu3imagesensor.c file is used to configure and control the image sensor. In this file, some structures are defined without a valid value. You need to replace these values with actual settings. Generally used APIs such as CyCx3_ImageSensor_Sleep, CyCx3_ImageSensor_Wakeup, and CyCx3_ImageSensor_Trigger_Autofocus are also available the cyu3imagesensor.c and cyu3imagesensor.h files Add the corresponding codes into these definitions."

Hope this helps.

Regarding the errors: You can follow these steps and add your sensor settings and then build the firmware and check "Console" output message tab to know the errors or whether the firmware is built or not.

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
16 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Marco,

I understand that you want to develop an application to stream video through CX3 and the sensor that you are using is MIPI APTINA MT9M114

- The CX3 firmware examples in the SDK can be used in Win10 also

- These example firmware projects support OmniVision® OV5640 and Aptina® AS0260 image sensors. Contact the respective image sensor manufacturers to get access to image sensor datasheet, register description, and configuration data. So the sensor related files need to be replaced with APTINA MT9MM114 sensor files in the example firmware.

- In the CX3 Configuration utility, you need to populate the fields according to you sensor settings / output . We don't recommend to copy yuv422_as0260.cycx

- Please refer to this KBA CX3 Firmware: Frequently Asked Questions - KBA91297

Regards,

Rashi

Regards,
Rashi

Hello Rashiv

thanks for your reply and for the FAQ link which is great. Then which project do you re commend as a starter? Blue pill cx3UvcAS) or red pill (MIP2USBBridge)?

I prefer red pill, still I am asking for advice from more experienced people

regards

0 Likes

I read

  2) cy_as0260.a         :      Library providing APIs to configure the Aptina AS0260 sensor.

                                In case a different sensor needs to be used, this library (and the calls

                                made to it) should be replaced with the customer defined sensor library.

This is an encrypted lib file, so I guess no source code can be disclosed. I wonder how to deal if I need to manage a different sensor. The documentation says 'minor changes are needed (Document No. 001-90369 Rev. *D) ' For a different sensor, the note points out the code modules that require minor modification so I was expecting to be able to access the code that read and write from/to I2C with a sequence of accesses to control registers

Thanks much for the help

0 Likes

Hello Marco,

We recommend to refer to the CX3 example firmware from the SDK 1.3.4 which you can download from https://www.cypress.com/documentation/software-and-drivers/ez-usb-fx3-software-development-kit

Path: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\cx3_examples. This folder contains 4 example firmware. the red pill example you referred is not in the SDK

- You can refer to the firmware with the application note AN75779 which is for FX3. This example project includes files like sensor.c, sensor.h and API to configure the sensor through I2C lines. You can refer to those files and make similar changes to your firmware with your sensor settings.

https://www.cypress.com/documentation/application-notes/an75779-how-implement-image-sensor-interface...

Regards,

Rashi

Regards,
Rashi

Hello Rashi

in fact the documentaion testify the presence of these files

pastedImage_0.png

though I cannot locate them in the folder tree you mentioned

pastedImage_1.png

Please tell me if I am missing something

kind regards

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Marco,

Please refer to this link https://www.cypress.com/documentation/application-notes/an75779-how-implement-image-sensor-interface...

You would find AN75779.zip file, under Related Files section, which contains the AN75779 firmware (Refer attachment)

Please let me know if any other queries.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hello rashi, got it:

I am then putting together the parts of the puzzle. The issue I have now is that

  1. AN75779 have sensor.c and sensor.h (cyfxuv_an75779, OK) but obviously do not present the MIPI-CSI2 SW support since it covers FX3
  2. Since I am using CX3 (because I need the MIPI-CSI2) I am moving to AN90369 which covers the CX3 case but DO NOT have sensor.c and sensor.h or any easy way to customize the sensor interface. It is based on the cx3 configuration file which just generate some headers and c source with sensor specific defines (sensor specific library files are required to be added in the readme ... (*))

approach 1. need the addition of the MIPI-CSI2 stuff (form the AN75779 project? do not looks easy ...), while approach 2. needs to add sensor specifi support APIs and code ...

I need advice on what is quicker / better

I am inspecting both projects into eclipse right now

Thanks much

(*)  This example requires the following CX3 library and header files over and above the standard FX3

  libraries (available under u3p_firmware\lib and u3p_firmware\inc):

  1) cyu3mipicsi.a       :      Library providing the APIs for the CX3 Mipi-Csi2 interface.

  2) cy_ov5640.a         :      Library providing APIs to configure the  Omnivision OV5640 sensor.

                                In case a different sensor needs to be used, this library (and the calls

                                made to it) should be replaced with the customer defined sensor library.

  3) cyu3mipicsi.h       :      Header file defining the CX3 Mipi-CSI2 interface APIs.

  4) cyu3imagesensor.h   :      Header file defining the Image sensor APIs.

0 Likes

EDITED to add more info:

Hello Marco,


You won't be able to locate the sensor.c and sensor.h files inside any of the above CX3 projects.The example projects are based on an older version of the CX3 configuration utility tool where the settings generated from the tool were directly added to the cycx3_uvc.c and cycx3_uvc.h files.

The configuration utility should look something like this:CX3_config_cust.png

The things marked in RED are the CX3 configuration utility files.

Please refer to Section 4.4 (recommend to read from section 4) of the document: https://www.cypress.com/file/351726/download

This will guide you through the steps to use the CX3 configuration utility.

You can also go through the following FAQ links which explains about the usage of the CX3 Config utility: https://community.cypress.com/docs/DOC-9362

Approach 2 would be quicker and easier if you are using CX3 with the image sensor. You will only need to add the sensor settings, active and blanking times, data lanes supported, etc.

While building the project do make sure to open the tabs beside the YELLOW rectangle, i.e, the cyu3mipicsi.c, cycx3_uvcdscr.c and uvc.c and uvc.h files and save them manually by clicking the icon which reads " export to file" in the right corner of the window or else the changes won't be effective in the project.


Regards,
Yashwant

0 Likes

Hello yahwant

thank you for your suggestion and your quick reply.

One more question: How the I2C related settings are handled?

thanks

0 Likes

8I get these errors

pastedImage_0.png

it looks like cyu3types.h is correctly included in the source. Should I add manually the project include path? Looks strange since this flow should be plu'n'pay ...

0 Likes

Hello Marco,

I understand that you want to know how to configure your (APTINA) sensor using the CX3 example. Is this right.?

Please refer to this KBA Steps to Setup up MIPI CSI Camera Solution with CX3 – KBA225748 and follow the steps.

As per this KBA

"The cyu3imgasensor.c and cyu3imgagesensor.h are also created and saved in this project. The cyu3imagesensor.c file is used to configure and control the image sensor. In this file, some structures are defined without a valid value. You need to replace these values with actual settings. Generally used APIs such as CyCx3_ImageSensor_Sleep, CyCx3_ImageSensor_Wakeup, and CyCx3_ImageSensor_Trigger_Autofocus are also available the cyu3imagesensor.c and cyu3imagesensor.h files Add the corresponding codes into these definitions."

Hope this helps.

Regarding the errors: You can follow these steps and add your sensor settings and then build the firmware and check "Console" output message tab to know the errors or whether the firmware is built or not.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hello Rashid

things are moving now. thanks.

I then got this error

No Resolution found suitable for USB 2.0 Bandwidth. CyCx3USBHSConfigDscr[] is incomplete. Do not connect to USB 2.0 host or add a lower resolution to support USB 2.0 cx3config.cycx /cx3Mipi2Usb Unknown Problem

I suppose, assume this will not block the porject build, right? Should I take any countermeasure if I just do not need USB 3.0?

One question

pastedImage_0.png

The Cx3 configuration combo box present old configuration which I tried before and have nothing to do with the current project. How dos this work? Can I clean this combo box? I do not get the point about the meaning of configuration combo box

thanks

0 Likes

Hello Marco,

You need to add resolution to the configuration descriptor if you will be using USB 2.0 (High speed). We would recommend to put the resolutions suitable for USB 2.0  in CyCx3USBHSConfigDscr[]

The CX3 Configuration utility generates a structure which is in CyU3PMipicsi.c file. This structure is for configuring the MIPI receiver according to the MIPI transmitter (sensor)

So whenever you change the sensor settings such as resolution, fps you need to make changes in the CX3 Configuration tool which would generate the new structure (i.e. as per your settings)

Regards,

Rashi

Regards,
Rashi
0 Likes

Hello Rashiv

I do not understand 'add resolution'

You need to add resolution to the configuration descriptor if you will be using USB 2.0 (High speed). We would recommend to put the resolutions suitable for USB 2.0  in CyCx3USBHSConfigDscr[]

Should I re-run configuration again?

thanks again

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Marco,

You can find the source code of APIs in the SDK itself

Path C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\fx3_sdk_1_3_4_src

I do not understand 'add resolution'

>> Please let me know that do you want to USB 2.0 or USB 3.0 application

If you want to go for USB 2.0 application

You can add one more resolution in the CX3 Configuration utility (Please refer to the attachment - Resolution 1) and again build the Cx3 utility (save the files created by utility again). Follow the same steps as in the KBA Steps to Setup up MIPI CSI Camera Solution with CX3 – KBA225748

In the cyu3imagesensor.c file, under /* Configuration settings for Resolution1 */ this heading you need to add your sensor configuration for that resolution

Practically USB 2.0 (high speed ) supports bandwidth of 25 - 30 MBps

This resolution should be such that it is supported by USB 2.0.

H_active x V_Active x bytes/pixel x frame rate <= 25 - 30 MBps

For eg: 640  x 480 x 2(16 bits/pixel) x 30 = 18 MBps < 25-30 MBps

P.S: In the attachment

Resolution 0 : USB 3.0

Resolution 1: USB 2.0 (High Speed)

Regards,

Rashi

Regards,
Rashi
0 Likes

Hello Rashiv

I successfully build a eclipse project using che suggested approach.

I am working now on device configuration using the 2-wire aka I2C i/f (basically I am reverse engineering the generated code, not easy)

Now I am struggling to match what is written in the app note AN90369

I cannot find some functions source code of some functions (e.g. CyU3PI2cReceiveBytes, CyU3PDeviceInit,  CyU3PDeviceCacheControl, CyU3PDeviceConfigureIOMatrix ... just curious: are they encripted or in some lib?

0 Likes