Skip to main content
March 20, 2024
Solved

[SOLVED] Color sequence with .png images from ExtFlashSection

  • March 20, 2024
  • 1 reply
  • 1631 views

Hey!

When I use images in TouchGFX, the color sequence seems different than in regular widgets. It only appears when images are stored on external flash (QSPI flash in my case), images stored on internal flash are fine.

Below is an example: the top 3 squares are BOX widgets, the bottom 3 are images in .png format.

In TouchGFX:

Screenshot (24).png

IRL:

ph.jpg

I'm driving RGB display with LTDC module. I'm using the ARGB pixel format, so the pixels are aligned at 32 bits:

Screenshot (25).png

Also I tried to fill framebuffer manually with pixels to verify their colors and everything showed as expected:

 

 

 const uint32_t colors[8] = {
 0xFFFF0000, // Red
 0xFF00FF00, // Green
 0xFF0000FF, // Blue
 0xFFFFFF00, // Yellow
 0xFFFF00FF, // Magenta
 0xFF00FFFF, // Cyan
 0xFF000000, // Black
 0xFFFFFFFF // White
 };

 

 

 What setting am I missing?

This topic has been closed for replies.
Best answer by

Thanks for the reply. The problem dissapeared, but I'm not sure how. I'm guessing this is due to a mismatch between the pixel format settings in CubeMX and TouchGFX here:
Screenshot (26).png

1 reply

ST Employee
March 22, 2024

Hello @unknown ,

The settings you are using look correct, and, it is interesting that the colors of the images are shown accurately, it seems like the images have shifted to left (so, the red one has become blue, the blue one green, and the green one red). Does this color exchange happen if you use only a single image with multiple colors in it?

Could you please share the linker script that you are using?

Thank you

Best answer
March 26, 2024

Thanks for the reply. The problem dissapeared, but I'm not sure how. I'm guessing this is due to a mismatch between the pixel format settings in CubeMX and TouchGFX here:
Screenshot (26).png

ST Employee
April 2, 2024

Okay, good to hear that the problem is resolved. 
Could you please mark your answer as the solution?