Skip to content
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

samples: lvgl: enhacements for CI check and mimxrt1060_evkc updates #84458

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hakehuang
Copy link
Collaborator

@hakehuang hakehuang commented Jan 23, 2025

fix runtime memory issue on mimxrt1060_evkc

also add regx support for this sample

fixes: #84456

@kartben kartben assigned faxe1008 and unassigned kartben Jan 23, 2025
@hakehuang hakehuang force-pushed the fix_lvgl_rt1060_evkc branch from 421c52a to 66537f9 Compare January 23, 2025 17:08
@JarmouniA JarmouniA added the area: LVGL Light and Versatile Graphics Library Support label Jan 23, 2025
Copy link
Collaborator

@faxe1008 faxe1008 left a comment

Choose a reason for hiding this comment

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

Not against this per se but some thoughts:

  • This needs to be split into two commits, one deals with fixing the memory requirement and the other adds a test harness.
  • Do not know if it is a usual thing to have a test harness for the samples. I would have thought thats what the tests are for.

while (1) {
if ((count % 100) == 0U) {
sprintf(count_str, "%d", count/100U);
lv_label_set_text(count_label, count_str);
printf("run %d\n", count/100U);
Copy link
Collaborator

Choose a reason for hiding this comment

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

count is uint32_t, needs to be %u

@kartben
Copy link
Collaborator

kartben commented Jan 24, 2025

Do not know if it is a usual thing to have a test harness for the samples. I would have thought thats what the tests are for.

I was hoping someone would say that :) I don't really think it adds any value (having the text show up on the console proves literally nothing as to whether the sample actually works and display things correctly), and it unnecessarily clutters the user's console with "unhelpful" messages.
I remember making a similar comment in #78988

It is useful to add tests for checking lvgl works correctly, no doubt about that, but I think it should be done in... tests :) The samples' primary objective should remain to provide to the point code that people can use as a starting point.

Comment on lines 4 to 6
# Enable PXP DMA engine and set rotation angle to 0 degrees.
# This allows us to verify the DMA driver functions without altering
# the output image
Copy link
Collaborator

Choose a reason for hiding this comment

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

the comment here also seems to imply this conf is really only here for testing purposes? ("verify the DMA driver"??). This doesn't sound right. Also, maybe CONFIG_MCUX_ELCDIF_PXP should simply default to Y at the board/soc level when DMA is enabled?

Copy link
Collaborator Author

@hakehuang hakehuang Jan 24, 2025

Choose a reason for hiding this comment

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

this is reused from former mimxrt1060_evk board, CONFIG_MCUX_ELCDIF_PXP consumes a lot, we do not want it enabled by default if user do not use display.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not enabling it by default is okay, but the comment needs to be changed.
I'd honestly just drop it - why would you enable DMA and PXP related settings if not to use/test them?

# Copyright 2023 NXP
# SPDX-License-Identifier: Apache-2.0

# Enable PXP DMA engine and set rotation angle to 0 degrees.
Copy link
Collaborator

Choose a reason for hiding this comment

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

where is rotation angle set to 0?

Copy link
Collaborator Author

@hakehuang hakehuang Jan 24, 2025

Choose a reason for hiding this comment

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

@kartben this is reused from former platform, in PXP engine we can rotate the image by 90/180/270 degree, so this is default setting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This still needs to be addressed, imo. The comment is not needed if it is a default. It tends to confuse anyone who reads it, because nowhere is there any config about rotation in here.

@hakehuang
Copy link
Collaborator Author

hakehuang commented Jan 24, 2025

I was hoping someone would say that :) I don't really think it adds any value (having the text show up on the console proves literally nothing as to whether the sample actually works and display things correctly), and it unnecessarily clutters the user's console with "unhelpful" messages. I remember making a similar comment in #78988

It is useful to add tests for checking lvgl works correctly, no doubt about that, but I think it should be done in... tests :) The samples' primary objective should remain to provide to the point code that people can use as a starting point.

without this fix, the build will fail by twister #84456 , as the regex is a must in harness: console, this adds a very basic check on the process, if you look at the source code below, there are several checks, if those fail, we can catch that in this pr's change. all in one, just to make the samples can pass in CI process. otherwise we can mark it as build only, as there is already a test for lvgl.

		LOG_ERR("Device not ready, aborting test");
		return 0;

@hakehuang hakehuang force-pushed the fix_lvgl_rt1060_evkc branch from 66537f9 to dfaf544 Compare January 24, 2025 08:58
@hakehuang hakehuang requested review from faxe1008 and kartben January 24, 2025 09:01
@faxe1008
Copy link
Collaborator

faxe1008 commented Jan 29, 2025

Hmm ok, the build issue is annoying. Either remove the console harness completely or go with this change then.
However the board specific change still has to go into a seperate commit either way (And also the commit title needs to be adjusted).

@hakehuang hakehuang force-pushed the fix_lvgl_rt1060_evkc branch from dfaf544 to 48d8493 Compare January 30, 2025 05:28
@hakehuang hakehuang changed the title tests: lvgl: fix run time memory issue samples: lvgl: fix run time memory issue Jan 30, 2025
@hakehuang hakehuang changed the title samples: lvgl: fix run time memory issue samples: lvgl: enhacements for CI check and mimxrt1060_evkc updates Jan 30, 2025
@hakehuang
Copy link
Collaborator Author

Hmm ok, the build issue is annoying. Either remove the console harness completely or go with this change then.
However the board specific change still has to go into a seperate commit either way (And also the commit title needs to be adjusted).

@faxe1008 thanks, I have split the PR into two commits, and update the commit message. Please check.

Copy link
Collaborator

@faxe1008 faxe1008 left a comment

Choose a reason for hiding this comment

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

For the 48d8493be4ffd7ba91deb8dd2496f8f7bad7c51f the commit message needs adjusting:

# Copyright 2023 NXP
# SPDX-License-Identifier: Apache-2.0

# Enable PXP DMA engine and set rotation angle to 0 degrees.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This still needs to be addressed, imo. The comment is not needed if it is a default. It tends to confuse anyone who reads it, because nowhere is there any config about rotation in here.

Comment on lines 4 to 6
# Enable PXP DMA engine and set rotation angle to 0 degrees.
# This allows us to verify the DMA driver functions without altering
# the output image
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not enabling it by default is okay, but the comment needs to be changed.
I'd honestly just drop it - why would you enable DMA and PXP related settings if not to use/test them?

@hakehuang hakehuang force-pushed the fix_lvgl_rt1060_evkc branch from 48d8493 to dff399b Compare January 30, 2025 16:01
@hakehuang
Copy link
Collaborator Author

@faxe1008 , thanks for reminding, I miss your former change request, and update now. please review again. sorry for troubles. and thanks again.

@kartben
Copy link
Collaborator

kartben commented Jan 30, 2025

FWIW I agree with @faxe1008 of removing the console harness altogether

@hakehuang
Copy link
Collaborator Author

FWIW I agree with @faxe1008 of removing the console harness altogether

@kartben , if in this case, samples can not covered in CI board run testing with at least minimal coverage.

@faxe1008
Copy link
Collaborator

faxe1008 commented Feb 4, 2025

There is still the tests/lib/gui/lvgl for which you can of course provide a new test config. As for the general point if samples should be used for testing:
https://docs.zephyrproject.org/latest/samples/sample_definition_and_criteria.html#samples-must-not-be-used-to-test-features-or-verify-platforms

If a sample can provide output that can be verified, then output should be evaluated against expected value to have some level of testing for the sample itself.

The PR does provide some output, but I feel like it does not provide any verification besides "the LVGL event loop has run at least once". The changes themselves look fine now. Not gonna +1 for now, but I will remove my nack.

@faxe1008 faxe1008 dismissed their stale review February 4, 2025 07:13

Changes look good, but unsure if the overall distinction between samples and tests is correctly applied here.

@hakehuang
Copy link
Collaborator Author

any verification besides "the LVGL event loop has run at least once"

@faxe1008 @kartben , the ideas are:

  1. for each samples in zephyr, try to make them as more as possible testing coverage in CI (board farm CI)
  2. tests is to ensure the framework/driver/api works, but samples is to demo that platform with necessary setting can run with combined user case, and I would say it is good that we also have some commitment that it at least runs.

add console output for sanity check in CI.
this will make twister build pass with harness: console

fixes: zephyrproject-rtos#84456

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
unify the configs and remove platform_allow as possible

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
add mipi and lcd_if tag for NXP platforms

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Display area: LVGL Light and Versatile Graphics Library Support area: Samples Samples platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: samples/subsys/display/lvgl/samples: HARNESS:Console:no regex patterns configured.
5 participants