Skip to content

Conversation

zacck
Copy link

@zacck zacck commented Oct 3, 2025

The video capture sample does not work when using a combination of the FRDM-MCXN236 and the OV5640 camera and this is due to the sensor and the underlying interface having different defaults. This patch sets the interface resolution to that selected by the sample which in turn is set in the CONFIG.

Copy link
Contributor

@JarmouniA JarmouniA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into 2 commits: driver changes, sample changes.
Also, explain why the driver change is needed in the commit message.

@zacck zacck force-pushed the pr-patch-sdma-for-mcxn236 branch from 91be28e to bafe2fb Compare October 3, 2025 19:31
@zacck
Copy link
Author

zacck commented Oct 3, 2025

Please split this into 2 commits: driver changes, sample changes. Also, explain why the driver change is needed in the commit message.

Thank you, this is done.

zacck added 2 commits October 6, 2025 07:17
Ensure Image sensors using video_sdma only use the valid
RGB565 format.

Signed-off-by: Zacck Osiemo <[email protected]>
This board uses sdma as its video driver and that requires
this size frame to be set for the sample to work

Signed-off-by: Zacck Osiemo <[email protected]>
@zacck zacck force-pushed the pr-patch-sdma-for-mcxn236 branch from bafe2fb to aa93037 Compare October 6, 2025 05:19
Copy link

sonarqubecloud bot commented Oct 6, 2025

Comment on lines +266 to +275
/* Verify that format is RGB565 */
if ((fmt->pixelformat != fmts[0].pixelformat) ||
(fmt->width != fmts[0].width_min) ||
(fmt->height != fmts[0].height_min)) {
return -ENOTSUP;
ret = video_set_format(config->sensor_dev, fmt);

if (ret < 0) {
LOG_ERR("Sensor device does not support RGB565");
return ret;
}
Copy link
Contributor

@josuah josuah Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for this is ultimately in the capture sample IMHO, but for the sake of a workaround that stll makes sense.

Another compromise in the meantime is to configure the default format in _init() and make this call always return the default supported format without asking the source?

Thanks for the help!

Copy link
Contributor

@josuah josuah Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wanted to make sure that fmt = RGB565 320x240, you would also need to use fmts[0] instead of fmt: as what you propose seems like doing this?

if (/* format is not what is expected */) {
    /* use the incorrect fmt */
}

So that would need a tmp = { /* correct fmt */ } if wanting to go that path (but +1 for simply moving that in init()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants