As I’m still diving into the world of LVGL, display controllers, STM32, etc, I have many questions.
Should I use the VSync pins on my display (ILI9488)?
I have a ST Nucleo 144 board (STM32F767zi)
Is 8/16 bit parallel faster than SPI with DMA?
Can you use DMA with 8/16 bit parallel connection?
What is the recommended display controller or display module for STM32F767zi?
Where do you all buy your displays from? I’ve been using buydisplay.com but it seems they have little to no display in the 3.5" - 5" (480x320 - 800x480) formats that work with the TFT_eSPI library.
with the STM32F767zi, are there any arduino based libraries that take advantage of the Chrom-Art feature (DMA2D)?
I think turning on the feature in lv_conf.h should be all that is needed. You may also need to enable the DMA2D clock (not sure), but that’s fairly straightforward to do.
In the current (7.0+) implementation, we use ChromART to speed up internal rendering processes, not the transfer of pixels to the display, so the interface connection and display type should not matter.
Thanks again. Here are some more questions and some build errors.
If Chrom-Art is for internal usage, do I still need to enable DMA on my display? Or am i getting confused on where DMA happens?
Do I need to set the LV_USE_GPU define to 0 if I’m using LV_USE_GPU_STM32_DMA2D?
I found the #define LV_USE_GPU_STM32_DMA2D in lv_conf.h and set it to 1, but received a series of compile errors. The first error was:
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:19:6: error: #error "Not supported STM32 family to use DMA2D"
19 | #error "Not supported STM32 family to use DMA2D"
looking in lv_gpu_stm32_dma2d.c, it appears if this error should only happen in the STM32F7 define has not been set. I couldn’t find any place to set that so I just added it to the lv_conf.h right after LV_USE_GPU_STM32_DMA2D. I’m not sure if that is the proper place, but doing so produced a different error:
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:57:8: error: unknown type name 'DMA2D_HandleTypeDef'
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_gc.c.o
57 | static DMA2D_HandleTypeDef hdma2d;
This new error seems to be complaining about the type DMA2D_HandleTypeDef.
for completeness, here is the entire stack of compile errors:
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:57:8: error: unknown type name 'DMA2D_HandleTypeDef'
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_gc.c.o
57 | static DMA2D_HandleTypeDef hdma2d;
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_fill':
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:80:11:
error: request for member 'Instance' in something not a structure or union
80 | hdma2d.Instance = DMA2D;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:81:11:
error: request for member 'Init' in something not a structure or union
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_ll.c.o
81 | hdma2d.Init.Mode = DMA2D_R2M;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:81:24:
error: 'DMA2D_R2M' undeclared (first use in this function); did you mean 'DMA2D_IRQn'?
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_log.c.o
81 | hdma2d.Init.Mode = DMA2D_R2M;
| ^~~~~~~~~
| DMA2D_IRQn
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:81:24:
note: each undeclared identifier is reported only once for each function it appears in
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:82:11:
error: request for member 'Init' in something not a structure or union
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_math.c.o
82 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:35:33:
error: 'DMA2D_OUTPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_OUTPUT_FORMAT'?
35 | #define DMA2D_OUTPUT_FORMAT DMA2D_OUTPUT_RGB565
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:82:29:
note: in expansion of macro 'DMA2D_OUTPUT_FORMAT'
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_mem.c.o
82 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:83:11:
error: request for member 'Init' in something not a structure or union
83 | hdma2d.Init.OutputOffset = buf_w - fill_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:84:11:
error: request for member 'LayerCfg' in something not a structure or union
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_printf.c.o
84 | hdma2d.LayerCfg[1].InputAlpha = DMA2D_NO_MODIF_ALPHA;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:84:37:
error: 'DMA2D_NO_MODIF_ALPHA' undeclared (first use in this function)
84 | hdma2d.LayerCfg[1].InputAlpha = DMA2D_NO_MODIF_ALPHA;
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_task.c.o
| ^~~~~~~~~C~ompiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_templ.c.o
~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:85:11:
error: request for member 'LayerCfg' in something not a structure or union
85 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_FORMAT;
| ^
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_txt.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:36:32:
error: 'DMA2D_INPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_RGB565'?
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_txt_ap.c.o
36 | #define DMA2D_INPUT_FORMAT DMA2D_INPUT_RGB565
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:85:41:
note: in expansion of macro 'DMA2D_INPUT_FORMAT'
85 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_misc\lv_utils.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:86:11:
error: request for member 'LayerCfg' in something not a structure or union
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_themes\lv_theme.c.o
86 | hdma2d.LayerCfg[1].InputOffset = 0;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:89:5: warning: implicit declaration of function 'HAL_DMA2D_Init'; did you mean 'HAL_DMA_DeInit'? [-Wimplicit-function-declaration]
89 | HAL_DMA2D_Init(&hdma2d);
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_themes\lv_theme_empty.c.o
| ^~~~~~~~~~~~~~
| HAL_DMA_DeInit
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:90:5: warning: implicit declaration of function 'HAL_DMA2D_ConfigLayer' [-Wimplicit-function-declaration]
90 | HAL_DMA2D_ConfigLayer(&hdma2d, 1);
| ^~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:91:5: warning: implicit declaration of function 'HAL_DMA2D_Start'; did you mean 'HAL_DMA_Start'? [-Wimplicit-function-declaration]
91 | HAL_DMA2D_Start(&hdma2d, (uint32_t)lv_color_to32(color), (uint32_t)buf, fill_w, fill_h);
| ^~~~~~~Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_themes\lv_theme_material.c.o
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_themes\lv_theme_mono.c.o
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_themes\lv_theme_template.c.o
~~~~~~~~
| HAL_DMA_Start
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_fill_mask':
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:112:11: error: request for member 'Init' in something not a structure or union
112 | hdma2d.Init.Mode = DMA2D_M2M_BLEND;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:112:32: error: 'DMA2D_M2M_BLEND' undeclared (first use in this function)
112 | hdma2d.Init.Mode = DMA2D_M2M_BLEND;
| ^~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:113:11: error: request for member 'Init' in something not a structure or union
113 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:35:33:
error: 'DMA2D_OUTPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_OUTPUT_FORMAT'?
35 | #define DMA2D_OUTPUT_FORMAT DMA2D_OUTPUT_RGB565
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:113:32: note: in expansion of macro 'DMA2D_OUTPUT_FORMAT'
113 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~~
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_arc.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:114:11: error: request for member 'Init' in something not a structure or union
114 | hdma2d.Init.OutputOffset = buf_w - fill_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:120:11: error: request for member 'LayerCfg' in something not a structure or union
120 | hdma2d.LayerCfg[1].AlphaMode = DMA2D_COMBINE_ALPHA;
| ^
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_bar.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:120:42: error: 'DMA2D_COMBINE_ALPHA' undeclared (first use in this function)
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_btn.c.o
120 | hdma2d.LayerCfg[1].AlphaMode = DMA2D_COMBINE_ALPHA;
| ^~~~~~~~~~~~~~~~~~~
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_btnmatrix.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:121:11: error: request for member 'LayerCfg' in something not a structure or union
121 | hdma2d.LayerCfg[1].InputAlpha = c32.full;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:122:11: error: request for member 'LayerCfg' in something not a structure or union
122 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_A8;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:122:42: error: 'DMA2D_INPUT_A8' undeclared (first use in this function); did you mean 'DMA2D_INPUT_FORMAT'?
122 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_A8;
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_calendar.c.o
| ^~~~~~~~~~~~~~
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_canvas.c.o
| DMA2D_INPUT_FORMAT
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:123:11: error: request for member 'LayerCfg' in something not a structure or union
123 | hdma2d.LayerCfg[1].InputOffset = 0;
| ^
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_chart.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:126:11: error: request for member 'LayerCfg' in something not a structure or union
126 | hdma2d.LayerCfg[0].AlphaMode = DMA2D_NO_MODIF_ALPHA;
| ^
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_checkbox.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:126:42: error: 'DMA2D_NO_MODIF_ALPHA' undeclared (first use in this function)
126 | hdma2d.LayerCfg[0].AlphaMode = DMA2D_NO_MODIF_ALPHA;
| ^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:127:11: error: request for member 'LayerCfg' in something not a structure or union
127 | hdma2d.LayerCfg[0].InputAlpha = 0x00;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:128:11: error: request for member 'LayerCfg' in something not a structure or union
128 | hdma2d.LayerCfg[0].InputColorMode = DMA2D_INPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:36:32:
error: 'DMA2D_INPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_RGB565'?
36 | #define DMA2D_INPUT_FORMAT DMA2D_INPUT_RGB565
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:128:42: note: in expansion of macro 'DMA2D_INPUT_FORMAT'
128 | hdma2d.LayerCfg[0].InputColorMode = DMA2D_INPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:129:11: error: request for member 'LayerCfg' in something not a structure or union
129 | hdma2d.LayerCfg[0].InputOffset = buf_w - fill_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:135:5:
warning: implicit declaration of function 'HAL_DMA2D_BlendingStart' [-Wimplicit-function-declaration]
135 | HAL_DMA2D_BlendingStart(&hdma2d, (uint32_t) mask, (uint32_t) buf, (uint32_t)buf, fill_w, fill_h);
| ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_copy':
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_cont.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:154:11: error: request for member 'Instance' in something not a structure or union
154 | hdma2d.Instance = DMA2D;
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_cpicker.c.o
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:155:11: error: request for member 'Init' in something not a structure or union
155 | hdma2d.Init.Mode = DMA2D_M2M;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:155:24: error: 'DMA2D_M2M' undeclared (first use in this function)
155 | hdma2d.Init.Mode = DMA2D_M2M;
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_dropdown.c.o
| ^~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:156:11: error: request for member 'Init' in something not a structure or union
156 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:35:33:
error: 'DMA2D_OUTPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_OUTPUT_FORMAT'?
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_gauge.c.o
35 | #define DMA2D_OUTPUT_FORMAT DMA2D_OUTPUT_RGB565
| ^~~~~~~~~~~~~~~~~~~
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_img.c.o
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:156:29: note: in expansion of macro 'DMA2D_OUTPUT_FORMAT'
Compiling .pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_widgets\lv_imgbtn.c.o
156 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:157:11: error: request for member 'Init' in something not a structure or union
157 | hdma2d.Init.OutputOffset = buf_w - copy_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:160:11: error: request for member 'LayerCfg' in something not a structure or union
160 | hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:160:36: error: 'DMA2D_NO_MODIF_ALPHA' undeclared (first use in this function)
160 | hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
| ^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:161:11: error: request for member 'LayerCfg' in something not a structure or union
161 | hdma2d.LayerCfg[1].InputAlpha = 0xFF;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:162:11: error: request for member 'LayerCfg' in something not a structure or union
162 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:36:32:
error: 'DMA2D_INPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_RGB565'?
36 | #define DMA2D_INPUT_FORMAT DMA2D_INPUT_RGB565
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:162:41: note: in expansion of macro 'DMA2D_INPUT_FORMAT'
162 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:163:11: error: request for member 'LayerCfg' in something not a structure or union
163 | hdma2d.LayerCfg[1].InputOffset = map_w - copy_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_blend':
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:189:11: error: request for member 'Instance' in something not a structure or union
189 | hdma2d.Instance = DMA2D;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:190:11: error: request for member 'Init' in something not a structure or union
190 | hdma2d.Init.Mode = DMA2D_M2M_BLEND;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:190:24: error: 'DMA2D_M2M_BLEND' undeclared (first use in this function)
190 | hdma2d.Init.Mode = DMA2D_M2M_BLEND;
| ^~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:191:11: error: request for member 'Init' in something not a structure or union
191 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:35:33:
error: 'DMA2D_OUTPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_OUTPUT_FORMAT'?
35 | #define DMA2D_OUTPUT_FORMAT DMA2D_OUTPUT_RGB565
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:191:29: note: in expansion of macro 'DMA2D_OUTPUT_FORMAT'
191 | hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:192:11: error: request for member 'Init' in something not a structure or union
192 | hdma2d.Init.OutputOffset = buf_w - copy_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:195:11: error: request for member 'LayerCfg' in something not a structure or union
195 | hdma2d.LayerCfg[0].AlphaMode = DMA2D_NO_MODIF_ALPHA;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:195:36: error: 'DMA2D_NO_MODIF_ALPHA' undeclared (first use in this function)
195 | hdma2d.LayerCfg[0].AlphaMode = DMA2D_NO_MODIF_ALPHA;
| ^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:196:11: error: request for member 'LayerCfg' in something not a structure or union
196 | hdma2d.LayerCfg[0].InputColorMode = DMA2D_INPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:36:32:
error: 'DMA2D_INPUT_RGB565' undeclared (first use in this function); did you mean 'DMA2D_RGB565'?
36 | #define DMA2D_INPUT_FORMAT DMA2D_INPUT_RGB565
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:196:41: note: in expansion of macro 'DMA2D_INPUT_FORMAT'
196 | hdma2d.LayerCfg[0].InputColorMode = DMA2D_INPUT_FORMAT;
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:197:11: error: request for member 'LayerCfg' in something not a structure or union
197 | hdma2d.LayerCfg[0].InputOffset = buf_w - copy_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:200:11: error: request for member 'LayerCfg' in something not a structure or union
200 | hdma2d.LayerCfg[1].AlphaMode = DMA2D_COMBINE_ALPHA;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:200:36: error: 'DMA2D_COMBINE_ALPHA' undeclared (first use in this function)
200 | hdma2d.LayerCfg[1].AlphaMode = DMA2D_COMBINE_ALPHA;
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:201:11: error: request for member 'LayerCfg' in something not a structure or union
201 | hdma2d.LayerCfg[1].InputAlpha = opa;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:202:11: error: request for member 'LayerCfg' in something not a structure or union
202 | hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_FORMAT;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:203:11: error: request for member 'LayerCfg' in something not a structure or union
203 | hdma2d.LayerCfg[1].InputOffset = map_w - copy_w;
| ^
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'dma2d_wait':
.pio\libdeps\nucleo_f767zi\lv_arduino_ID6228\src\src\lv_gpu\lv_gpu_stm32_dma2d.c:229:11: warning: implicit declaration of function 'HAL_DMA2D_PollForTransfer'; did you mean 'HAL_DMA_PollForTransfer'? [-Wimplicit-function-declaration]
229 | while(HAL_DMA2D_PollForTransfer(&hdma2d, 0) == HAL_TIMEOUT) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| HAL_DMA_PollForTransfer
*** [.pio\build\nucleo_f767zi\lib530\lv_arduino_ID6228\src\lv_gpu\lv_gpu_stm32_dma2d.c.o] Error 1
Are you using LittlevGL 7.0 or 7.1? I forgot to mention that 7.0 is only compatible with projects using STM32Cube. 7.1 uses its own DMA2D driver and doesn’t need the ST one.
It needs to be used with a project that has STM32Cube drivers in it. I don’t think Cube is included with lv_arduino so updating to 7.1 is probably your best bet.
OK, so I just learned that I can use the core lvgl library in arduino and not use the lv_arduino library. I didn’t know that was possible. (According to these instructions).
So I’m running 7.1 as stated in the lvgl.h file:
/*********************
* DEFINES
*********************/
/*Current version of LVGL*/
#define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 1
#define LVGL_VERSION_PATCH 0
#define LVGL_VERSION_INFO ""
I can build (without DMA2D) enabled but once I enable LV_USE_GPU_STM32_DMA2D in lv_config.h I get the following errors which might have something to do with ‘RCC_AHB1ENR_DMA2DEN’ being undeclared. Searching for it in the library turns up only this one instance in lv_gpu_stm32_dma2d.c
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:14:36: error: #include expects "FILENAME" or <FILENAME>
Compiling .pio\build\nucleo_f767zi\lib74d\lvgl\lv_misc\lv_async.c.o
14 | #include LV_GPU_DMA2D_CMSIS_INCLUDE
| ^
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_init':
Compiling .pio\build\nucleo_f767zi\lib74d\lvgl\lv_misc\lv_bidi.c.o
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:65:5: error: 'RCC' undeclared (first use in this function)
Compiling .pio\build\nucleo_f767zi\lib74d\lvgl\lv_misc\lv_color.c.o
65 | RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN;
| ^~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:65:5: note: each undeclared identifier is reported only once for each function it appears in
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:65:21: error: 'RCC_AHB1ENR_DMA2DEN' undeclared
(first use in this function)
65 | RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN;
| ^~~~~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:71:5: error: 'DMA2D' undeclared (first use in this function)
71 | DMA2D->OPFCCR = LV_DMA2D_COLOR_FORMAT;
| ^~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:68:23: warning: unused variable 'temp' [-Wunused-variable]
68 | volatile uint32_t temp = RCC->AHB1ENR;
| ^~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_fill':
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:87:5: error: 'DMA2D' undeclared (first use in this function)
87 | DMA2D->CR = 0x30000;
| ^~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:92:29: error: 'DMA2D_NLR_PL_Pos' undeclared (first use in this function)
92 | DMA2D->NLR = (fill_w << DMA2D_NLR_PL_Pos) | (fill_h << DMA2D_NLR_NL_Pos);
| ^~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:92:60: error: 'DMA2D_NLR_NL_Pos' undeclared (first use in this function)
92 | DMA2D->NLR = (fill_w << DMA2D_NLR_PL_Pos) | (fill_h << DMA2D_NLR_NL_Pos);
| ^~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:95:18: error: 'DMA2D_CR_START_Msk' undeclared (first use in this function)
95 | DMA2D->CR |= DMA2D_CR_START_Msk;
| ^~~~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_copy':
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:161:5: error: 'DMA2D' undeclared (first use in
this function)
161 | DMA2D->CR = 0;
| ^~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:168:29: error: 'DMA2D_NLR_PL_Pos' undeclared (first use in this function)
168 | DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos);
| ^~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:168:60: error: 'DMA2D_NLR_NL_Pos' undeclared (first use in this function)
168 | DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos);
| ^~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:171:18: error: 'DMA2D_CR_START_Msk' undeclared
(first use in this function)
171 | DMA2D->CR |= DMA2D_CR_START_Msk;
| ^~~~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'lv_gpu_stm32_dma2d_blend':
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:190:5: error: 'DMA2D' undeclared (first use in
this function)
190 | DMA2D->CR = 0x20000;
| ^~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:198:30: error: 'DMA2D_FGPFCCR_AM_Pos' undeclared (first use in this function)
198 | | (2 << DMA2D_FGPFCCR_AM_Pos)
| ^~~~~~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:200:32: error: 'DMA2D_FGPFCCR_ALPHA_Pos' undeclared (first use in this function)
200 | | (opa << DMA2D_FGPFCCR_ALPHA_Pos);
| ^~~~~~~~~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:206:29: error: 'DMA2D_NLR_PL_Pos' undeclared (first use in this function)
206 | DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos);
| ^~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:206:60: error: 'DMA2D_NLR_NL_Pos' undeclared (first use in this function)
206 | DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos);
| ^~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:209:18: error: 'DMA2D_CR_START_Msk' undeclared
(first use in this function)
209 | DMA2D->CR |= DMA2D_CR_START_Msk;
| ^~~~~~~~~~~~~~~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c: In function 'dma2d_wait':
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:229:11: error: 'DMA2D' undeclared (first use in this function)
229 | while(DMA2D->CR & DMA2D_CR_START_Msk) {
| ^~~~~
lib\lvgl\src\lv_gpu\lv_gpu_stm32_dma2d.c:229:23: error: 'DMA2D_CR_START_Msk' undeclared
(first use in this function)
229 | while(DMA2D->CR & DMA2D_CR_START_Msk) {
| ^~~~~~~~~~~~~~~~~~
*** [.pio\build\nucleo_f767zi\lib74d\lvgl\lv_gpu\lv_gpu_stm32_dma2d.c.o] Error 1
That did the trick! Thanks again for all the support. The only major issue I’m running into now is the lack of touch when using the core lvgl library (instead of lv_arduino).
Nothing breaks if they set both - the custom callback will override the STM32 one if the former is configured in the display driver. Otherwise the STM32 one will still be used.