2024-11-15 12:04 AM
Hello everyone, I present my problem.
I am doing a simple project with Touch GFX on my Discovery STM32H7S78-DK. My main goal is to display images (the ones provided by touchGFX) in RGB888.
I created the project and moved to CubeMX to view the .ioc file and change the various fields the RGB format from 565 to 888. I changed both on the LTDC and pixel format tab and automatically in Middleware->TouchGFX the change was taken.
So far so good.
Filling in the automatically generated code, without any personal additions, and after regenerating the code with TouchGFX I get the following error:
undefined reference to `touchgfx::paint::rgb888::lineFromColor(unsigned char*, unsigned int, unsigned long, unsigned char)'
Which I fix by following the following link : https://support.touchgfx.com/4.20/docs/miscellaneous/known-issues.
Fixed this I compile the code, load the firmware on my dk but the screen appears black (Backlight On but totally black).
Debugging and hitting the pause button the program is stuck in HAL_GPU2D_ErrorCallback as shown in the figure below.
Unfortunately, the values of the registers cannot be accessed from Datasheet because private.
How can I do to see correctly on my Discovery in RGB888 format?
2024-11-22 02:50 AM
Hello @Leo_Berna99 ,
If you select our TBS for the STM32H7S78-dk 24bpp, the framebuffer will be in 24bpp.
Selecting the pixel format to be ARGB8888 will ne be enough, NeoChrom accelerator do the rendering in 32bpp but then we store the framebuffer in 24bpp such as:
main.c line 377 of the 24bpp TBS:
GFXMMU_PackingTypeDef Packing;
Packing.Buffer0Activation = ENABLE;
Packing.Buffer0Mode = GFXMMU_PACKING_MSB_REMOVE; // every 3 bytes are served as 4 bytes in the virtual buffer. The most significant byte written to the virtual buffer is discarded
Packing.Buffer1Activation = ENABLE;
Packing.Buffer1Mode = GFXMMU_PACKING_MSB_REMOVE; // every 3 bytes are served as 4 bytes in the virtual buffer. The most significant byte written to the virtual buffer is discarded
Packing.DefaultAlpha = 0xff;
HAL_GFXMMU_ConfigPacking(&hgfxmmu, &Packing);
If you want, you could check the content of the framebuffer.
Their location are defined in STM32CubeMX under GFXMMU (among other places):
Yes, images in 32bpp get big quite fast.
The 24bpp TBS allows you to use 24bpp on the framebuffers to save RAM but it doesn't allow you to use 24bpp assets.
However, keep in mind that you can compress your assets.
TouchGFX offers various compression algorithms which have good performances for most images and it automatically select the best one for each specific image.
To access images stored in an SD card, I suggest you 3 links:
I hope this helps! :smiling_face_with_smiling_eyes:
If this comment or a previous one answers your question, I invite you to select it as "best answer".
Regards,