Skip to content

Feature/esp32c3 support #69

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

Merged
merged 9 commits into from
Jun 21, 2021
Merged

Feature/esp32c3 support #69

merged 9 commits into from
Jun 21, 2021

Conversation

C47D
Copy link
Collaborator

@C47D C47D commented Jun 11, 2021

@dastarling Could you take a look at this and test it when you have time?

Fixes lvgl/lv_port_esp32#269

@C47D C47D requested review from kisvegabor and embeddedt June 11, 2021 03:51
@C47D
Copy link
Collaborator Author

C47D commented Jun 14, 2021

@kisvegabor touch_driver got an update for LVGLv8, do you think we need any other update for that for this particular PR?

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

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

Looks good in general, only a few comments above.

On a general note, for v8 instead of adding #if LVGL_VERSION_MAJOR >= 8 I started to keep only v8 stuff because people who use v7 can use the release/v7 branch.

I'm not sure how well could it work here as the goal is to have as many drivers for as many releases as possible. So if someone adds a driver to v8 maybe the preprocessor instructions are the best way to backport them to v7. Anyway, I just wanted to mention my new approach in the hope it can help here in some form 🙂

@C47D
Copy link
Collaborator Author

C47D commented Jun 14, 2021

On a general note, for v8 instead of adding #if LVGL_VERSION_MAJOR >= 8 I started to keep only v8 stuff because people who use v7 can use the release/v7 branch.
I'm not sure how well could it work here as the goal is to have as many drivers for as many releases as possible. So if someone adds a driver to v8 maybe the preprocessor instructions are the best way to backport them to v7. Anyway, I just wanted to mention my new approach in the hope it can help here in some form 🙂

I see, I also wanted to keep a branch for drivers v7 and another for v8, but I don't know how much effort would it take to keep both in sync, as far as I've seen the differences are the indev return value of the read function is now void and the rotation support.

@embeddedt
Copy link
Member

Rotation is also available in 7.11.

@C47D
Copy link
Collaborator Author

C47D commented Jun 14, 2021

Rotation is also available in 7.11.

So the return type of indev read is the only change? Drivers wise. See my comment in the review, this might help.

@embeddedt
Copy link
Member

I believe that and the requirement for drivers to be static are the only breaking changes; yes.

@kisvegabor
Copy link
Member

I believe that and the requirement for drivers to be static are the only breaking changes; yes.

And in display driver there are some renames: disp_buf -> draw_buf.

@C47D
Copy link
Collaborator Author

C47D commented Jun 15, 2021

Ok, will do the initial changes for v8 on this driver, some of the changes are necessary in lv_port_esp32 instead.

@C47D
Copy link
Collaborator Author

C47D commented Jun 16, 2021

I guess this driver is complete, waiting for @dastarling for feedback, will work on v8 support for display drivers on another PR

@dastarling
Copy link

Thanks for all the work. I'll give it a check soon. I think I am still on v7, was thinking of updating to v8, but there were some differences I wasn't prepared to go thru at the time. I'll try to test it at v7 and see if I can then update to v8 and test again.

@C47D
Copy link
Collaborator Author

C47D commented Jun 16, 2021

Thanks for all the work. I'll give it a check soon. I think I am still on v7, was thinking of updating to v8, but there were some differences I wasn't prepared to go thru at the time. I'll try to test it at v7 and see if I can then update to v8 and test again.

v7 is fine, support for v8 will take some work. Thanks for the help :), there's also a new PR to handle better I2C (#70 ), but it's not merged just yet.

@C47D
Copy link
Collaborator Author

C47D commented Jun 21, 2021

@kisvegabor @embeddedt Think we need to merge this, some new PRs are replicating some fixes available here, what do you think?

@kisvegabor kisvegabor self-requested a review June 21, 2021 18:44
@kisvegabor
Copy link
Member

Sure!

@C47D C47D merged commit aff7d1f into master Jun 21, 2021
@C47D C47D deleted the feature/esp32c3_support branch June 21, 2021 18:47
@dastarling
Copy link

I tested Master and it builds and runs with lvgl v7.11.0. But the ili9488.c file does not include some changes I made to the flush function due to the limited memory of the C3. So the graphics output is banded on the screen with Resolution 480x320.
With lvgl v8.01 I get these compile errors:
./components/lvgl_esp32_drivers/lvgl_helpers.h:54:25: error: 'LV_HOR_RES_MAX' undeclared (first use in this function); did you mean 'LV_HOR_RES'? #define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40) ^~~~~~~~~~~~~~ ../main/main.c:95:41: note: in expansion of macro 'DISP_BUF_SIZE' lv_color_t* buf1 = heap_caps_malloc(DISP_BUF_SIZE * sizeof(lv_color_t), MALLOC_CAP_DMA); ^~~~~~~~~~~~~ ../components/lvgl_esp32_drivers/lvgl_helpers.h:54:25: note: each undeclared identifier is reported only once for each function it appears in #define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40) ^~~~~~~~~~~~~~ ../main/main.c:95:41: note: in expansion of macro 'DISP_BUF_SIZE' lv_color_t* buf1 = heap_caps_malloc(DISP_BUF_SIZE * sizeof(lv_color_t), MALLOC_CAP_DMA); ^~~~~~~~~~~~~ ../main/main.c:107:12: error: unknown type name 'lv_disp_buf_t' static lv_disp_buf_t disp_buf; ^~~~~~~~~~~~~ ../main/main.c:122:5: error: implicit declaration of function 'lv_disp_buf_init'; did you mean 'lv_disp_drv_init'? [-Werror=implicit-function-declaration] lv_disp_buf_init(&disp_buf, buf1, buf2, size_in_px); ^~~~~~~~~~~~~~~~ lv_disp_drv_init ../main/main.c:128:13: error: 'lv_disp_drv_t' {aka 'struct _lv_disp_drv_t'} has no member named 'buffer' disp_drv.buffer = &disp_buf; ^ cc1: some warnings being treated as errors [1073/1227] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/gui_sm.c.obj ../main/gui_sm.c: In function 'main_menu': ../main/gui_sm.c:196:85: warning: passing argument 2 of 'lv_obj_get_child' makes integer from pointer without a cast [-Wint-conversion] current_sensor_name = lv_label_get_text(lv_obj_get_child((lv_obj_t *)param, NULL)); ^~~~ In file included from ../components/lvgl/src/core/lv_obj.h:121, from ../components/lvgl/lvgl.h:32, from ../main/gui_sm.c:22: ../components/lvgl/src/core/lv_obj_tree.h:136:20: note: expected 'int32_t' {aka 'long int'} but argument is of type 'void *' struct _lv_obj_t * lv_obj_get_child(const struct _lv_obj_t * obj, int32_t id); ^~~~~~~~~~~~~~~~

@dastarling
Copy link

The ESP32C3 displays this message in the terminal indicating the lack of memory for a full screen DMA transfer at the 480x320 resolution

W (157073) ILI9488: Could not allocate enough DMA memory!

@dastarling
Copy link

Should I open a separate case for the lack of memory?

@dastarling
Copy link

I also found a few other minor issues;

lvgl_esp32_drivers\lvgl_tft\Kconfig: 828
range 0 21 if IDF_TARGET_ESP32C3 -> range -1 21 if IDF_TARGET_ESP32C3

lvgl_esp32_drivers\lvgl_tft\Kconfig: 840
range 0 21 if IDF_TARGET_ESP32C3 -> range -1 21 if IDF_TARGET_ESP32C3

lvgl_esp32_drivers\lvgl_touch\Kconfig:139
-> range 0 21 if IDF_TARGET_ESP32C3

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

Successfully merging this pull request may close these issues.

No support for ESP32C3
4 participants