2024-12-09 04:11 PM
I have a STM32U5G9J-DK2 where I'm trying to write a simple test application that commands the display to be red, then blue, then green. Using the CubeIDE, I generated a project for the DK2 and enabled the DMA2D, LTDC, and GPU2D. I then had it generate the drivers and the main. I looked at the example code and as a result I have the BSP and Utilities for Font and LCD as well in my code.
In main.cc, I initialize the LCD with following calls:
BSP_LCD_Init(0, LCD_ORIENTATION_LANDSCAPE);
UTIL_LCD_SetFuncDriver(&LCD_Driver);
Then after all the MX_XXX_Init() calls, I try write to the DMA2d with UTIL_LCD_Clear(UTIL_LCD_COLOR_RED);
When I run, the UTIL_LCD_CLEAR() eventually calls HAL_DMA2D_Start() and it gets to the line __HAL_DMA2D_ENABLE(hdma2d);
However, once this is executed (Which is enabling the dma 2d), the hdma2d ptr is no longer valid. Then shortly after due to the pointer no longer be valid, an exception is generated. I've read through the reference manual, and examined the drivers and example code and can't figure out what's missing. I checked that the dma2d clock is enabled.
Are there any suggestions as to what I'm not doing. I'm essentially just using the provided HAL, BSP, and Utilities code.
Thanks
2024-12-11 07:21 AM