Cx3 I2C and Configuration

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

cross mob
ReA_3297666
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello we are using CX3 RDK board receive a RAW 10bit MIPI sensor Input, We made the configuration as shown below 

ReA_3297666_0-1619044435867.png

In the image configuration , the necessary I2C details has been entered

ReA_3297666_1-1619044516518.png

When programmed the CX3-RDK board enumerates as CX3 UVC device, but when we probe the i2c lines of sensor no values is being written from CX3. Are we missing something?

 

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please try the following suggestions and let me know if you still face issues:

1. The image sensor register configuration value is of 1 byte as per the snapshot. But you have used the type CySensorReg16_t for the image sensor configuration structure which assumes that the sensor configuration value is of 2 bytes. Please change this to CySensorReg8_t as this makes use of 1 byte sensor configuration value. Please use the same type (CySensorReg8_t ) for all the configuration settings (base and resolutions).

2. The function to initialize  the image sensor should be of the following form:

CyU3PReturnStatus_t
CyCx3_ImageSensor_Init(
void)
{
uint16_t configSize;

#ifdef SENSOR_DEBUG
CyU3PDebugPrint(4,"\r\n Sensor Initialization");
#endif

CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

configSize = (sizeof(SENSOR_BaseConfigurationSettings))/(sizeof(CySensorReg8_t));
status = Sensor_WriteConfigurationSettings_Reg8(SENSOR_BaseConfigurationSettings, configSize);

/*Include any other I2C write required during Sensor Init here*/

return status;
}

Similarly, the function for configuring the image sensor should be of the following form:

CyU3PReturnStatus_t
CyCx3_Set_null_YUY2_Resolution1(
void)
{
uint16_t configSize;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

configSize = (sizeof(null_YUY2_Resolution1ConfigurationSettings))/(sizeof(CySensorReg8_t));
status = Sensor_WriteConfigurationSettings_Reg8(null_YUY2_Resolution1ConfigurationSettings, configSize);

return status;
}

3. The macros SENSOR_I2C_READ_ADDRESS and SENSOR_I2C_WRITE_ADDRESS should be defined with the correct I2C address based on the image sensor used.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
14 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please try the following suggestions and let me know if you still face issues:

1. The image sensor register configuration value is of 1 byte as per the snapshot. But you have used the type CySensorReg16_t for the image sensor configuration structure which assumes that the sensor configuration value is of 2 bytes. Please change this to CySensorReg8_t as this makes use of 1 byte sensor configuration value. Please use the same type (CySensorReg8_t ) for all the configuration settings (base and resolutions).

2. The function to initialize  the image sensor should be of the following form:

CyU3PReturnStatus_t
CyCx3_ImageSensor_Init(
void)
{
uint16_t configSize;

#ifdef SENSOR_DEBUG
CyU3PDebugPrint(4,"\r\n Sensor Initialization");
#endif

CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

configSize = (sizeof(SENSOR_BaseConfigurationSettings))/(sizeof(CySensorReg8_t));
status = Sensor_WriteConfigurationSettings_Reg8(SENSOR_BaseConfigurationSettings, configSize);

/*Include any other I2C write required during Sensor Init here*/

return status;
}

Similarly, the function for configuring the image sensor should be of the following form:

CyU3PReturnStatus_t
CyCx3_Set_null_YUY2_Resolution1(
void)
{
uint16_t configSize;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

configSize = (sizeof(null_YUY2_Resolution1ConfigurationSettings))/(sizeof(CySensorReg8_t));
status = Sensor_WriteConfigurationSettings_Reg8(null_YUY2_Resolution1ConfigurationSettings, configSize);

return status;
}

3. The macros SENSOR_I2C_READ_ADDRESS and SENSOR_I2C_WRITE_ADDRESS should be defined with the correct I2C address based on the image sensor used.

Best Regards,
Jayakrishna
0 Likes

Hello @JayakrishnaT_76 

"1. The image sensor register configuration value is of 1 byte as per the snapshot. But you have used the type CySensorReg16_t for the image sensor configuration structure which assumes that the sensor configuration value is of 2 bytes. Please change this to CySensorReg8_t as this makes use of 1 byte sensor configuration value. Please use the same type (CySensorReg8_t ) for all the configuration settings (base and resolutions)."

Here our register address is 2 bytes and the register value is 1 byte, thats the reason why we gave CySensorReg16_t instead of CySensorReg8_t. Still do we need to change it to CySensorReg8_t?

2) Attached screenshot of the init function, we are doing any specfic thing here so we left the functions as such

ReA_3297666_0-1619072073601.png

 

3) Macros for i2c address were given properly

 

During project build we got the following warnings

ReA_3297666_1-1619072203016.png

 

Anything we need to change?

0 Likes
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please find my comments below:

1. Here our register address is 2 bytes and the register value is 1 byte, thats the reason why we gave CySensorReg16_t instead of CySensorReg8_t. Still do we need to change it to CySensorReg8_t?

>> Yes, CySensorReg8_t should be used instead of CySensorReg16_t . The type CySensorReg8_t makes use of 2 bytes for register address and 1 byte for register value. So, for your use case CySensorReg8_t itself should be used.

2. Attached screenshot of the init function, we are doing any specfic thing here so we left the functions as such

>> Please modify the init function and sensor configuration functions as mentioned in my previous response. 

Best Regards,
Jayakrishna
0 Likes

Hello @JayakrishnaT_76 

Iam getting this following error in the CyCx3_ImageSensor_Init function,  the resolution configuration function there are no issues while building

ReA_3297666_0-1619079408961.png

 

0 Likes

Hello,

Please let me know if you have made any changes to the source files cyu3imagesensor.c and cyu3imagesensor.h other than the ones discussed in this thread? 

By default the source file cyu3imagesensor.c generated by the MIPI configuration Utility will have a definition for the function Sensor_WriteConfigurationSettings_Reg8 (). The undefined reference error is not expected to occur here. Can you please check if the function CyCx3_ImageSensor_Init() is defined below the definition of Sensor_WriteConfigurationSettings_Reg8 () or not. If the function CyCx3_ImageSensor_Init () is defined above the definition of Sensor_WriteConfigurationSettings_Reg8 (), please put the definition of CyCx3_ImageSensor_Init () below Sensor_WriteConfigurationSettings_Reg8 ().

Best Regards,
Jayakrishna
0 Likes
ReA_3297666
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello @JayakrishnaT_76 

Cleaned the project and built it again , build message attached

 

ReA_3297666_0-1619085529826.png

 


Now i can see after programming

1) Windows cant recognize the device , but before it enumerated as CX3-UVC.

2) No i2c transactions happening

 

0 Likes
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

As per my understanding, you are testing the project on Denebola kit (sensor is OV5640). Please correct me if my understanding is not correct.

If my understanding is correct, please share the complete project for us to check at our end. Please remove the sensor configuration settings from the project when it is shared.

Best Regards,
Jayakrishna
0 Likes
lock attach
Attachments are accessible only for community members.
ReA_3297666
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello @JayakrishnaT_76 

We are testing the sensor on Denebola kit but the sensor is different (Sensor from Omnivision),
The sensor supports RAW10 FHD 60FPS and RAW10 FHD 30FPS, RAW10 HD 30FPS and RAW10 HD 30FPS,

I will share you the complete project file but ill just remove the sensor register address and values. Kindly have a look into the project. Also the values of SENSOR_I2C_READ_ADDRESS and SENSOR_I2C_WRITE_ADDRESS is reverted back to FF and FE since we cant share those 
details.

Our problem is

1) We probed the I2C lines and we are not seeing any transactions, If I2C writes are proper Image sensor will start streaming

2) With this latest build the device is not enumerated as CX3-UVC

 

0 Likes
hant1216
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Is there an actual waveform for testing IIC? You can send it out

0 Likes
lock attach
Attachments are accessible only for community members.
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

I tried to program the firmware project that was shared in your previous response and found that the device enumerated properly as CX3-UVC at my end. Please find the snapshot of the same below:

JayakrishnaT_76_0-1619146522025.png

I have also added a small modification to code to remove warnings. Please find the attached project. Firstly, before changing anything to code, try building and programming the device. Please check if the device enumerates properly after this test.

If it passes, change the I2C address and add the sensor configuration register settings to the project. Then build the project again and load the firmware to the device. After this, check if the device is enumerating properly or not. If the device enumerates correctly then check the I2C lines.

Best Regards,
Jayakrishna
0 Likes

Hello @JayakrishnaT_76 

Thanks for the reply, I will try it and get back to you.

0 Likes
ReA_3297666
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello @JayakrishnaT_76 

I cant find the attachment

0 Likes

Hello,

I have re-attached the project. Please check once again.

Best Regards,
Jayakrishna
0 Likes
ReA_3297666
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello @JayakrishnaT_76 

We think there might be some hardware issue can be there , we will confirm that and get back to you

0 Likes