Skip to content

samples: video: capture_to_lvgl: disable LVGL color swap for mini_stm32h743 #93069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CharlesDias
Copy link
Contributor

@CharlesDias CharlesDias commented Jul 13, 2025

Disable CONFIG_LV_COLOR_16_SWAP for the mini_stm32h743 board to ensure proper color display in the capture_to_lvgl video sample. Issue #93067

I don't know when this problem has begun, but the color format on capture_to_lvgl is broken for mini_stm32h743 and weact_ov2640_cam_module.

Command:
west build -p -b mini_stm32h743 --shield weact_ov2640_cam_module samples/drivers/video/capture_to_lvgl/ -- -DCONFIG_BOOT_DELAY=2000

Output image:
WhatsApp Image 2025-07-13 at 13 36 42

After disable the CONFIG_LV_COLOR_16_SWAP the color format is correct. However, the background on CPU and FPS monitor are is not good.
WhatsApp Image 2025-07-13 at 13 46 47

Disable CONFIG_LV_COLOR_16_SWAP for the mini_stm32h743 board to ensure
proper color display in the capture_to_lvgl video sample.

Signed-off-by: Charles Dias <[email protected]>
Copy link

@JarmouniA
Copy link
Contributor

JarmouniA commented Jul 13, 2025

See #92343 and #92483

@avolmat-st
Copy link

avolmat-st commented Jul 13, 2025

I didn't notice issue on my side when trying with my boards (STM32 but not this board and not this sensor). Would it be also possible to confirm that the frame given by the sensor itself ? Is it possible for you to dump it into memory, say via GDB or something like that in order to inspect the data from an external machine ? UVC sample might be a candidate as well. I mean trying to figure out if that is an LTDC issue or a sensor / dcmi issue.

@CharlesDias
Copy link
Contributor Author

Hi @avolmat-st,

This board does not use the LTDC. The display is the model ST7735R.

This problem doesn't exist with stm32h7b3i_dk and st_b_cams_omv_mb1683.

@josuah
Copy link
Contributor

josuah commented Jul 13, 2025

I think this does not really solve the problem fully:

Before: gray overlay looks correct

After: gray overlay looks rainbowy:

This mean we might need a bit more investigation to align definition a bit further

Thank you for looking into this! This is not the only board affected by capture-to-lvgl and capture looking different:

esp32_s3_eye:

scrot_20250713_170358_215x221 scrot_20250713_170417_350x253

#90428

@CharlesDias CharlesDias marked this pull request as draft July 13, 2025 15:22
@josuah
Copy link
Contributor

josuah commented Jul 13, 2025

+--------------+    +----------+    +-------------+    +----------------+
| image sensor |----| lvgl img |----| lvgl engine |----| display driver |
+--------------+    +----------+    +-------------+    +----------------+
camera raw data     declared as      draws overlay      passes the bytes
                    LVGL image       on top             to the driver

It looks like the image content is inconsistent with the overlay.

Regardless the number of inversions that happens at every level, for sure, the LVGL image is considered with a different type as the LVGL driver.

.header.cf = LV_COLOR_FORMAT_NATIVE,

Maybe setting this to a different value (LV_COLOR_FORMAT_NATIVE_REVERSED?) would work.

Also, it seems like like... LV_COLOR_16_SWAP disappeared? :')

zephyr/west.yml

Lines 304 to 306 in 322da1d

- name: lvgl
revision: b03edc8e6282a963cd312cd0b409eb5ce263ea75
path: modules/lib/gui/lvgl

https://github.com/zephyrproject-rtos/lvgl/blob/b03edc8e6282a963cd312cd0b409eb5ce263ea75/lv_version.h

So v9.3.0... Let's ask #lvgl on the chat just in case...

@JarmouniA JarmouniA requested a review from faxe1008 July 13, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Samples Samples area: Video Video subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants