Skip to main content
awiernie
Associate III
October 27, 2021
Solved

Wrong Color on device if set with getColorFromRGB but correct on simualtor after upgrading both, touchgfx to 4.18 and stm32f4 firmware from 1.26.1 to 1.26.2

  • October 27, 2021
  • 2 replies
  • 1113 views

If I set the color of a box widget with setColor and the touchgfx::colortype is 0xFF494949, the color on the LCD is blue but not grey. This problem happens after the updates.

The color value is produced by Color::getColorFromRGB() from the 3 base colors set to 0x49.

As I understand from the description of getColorFromRGB, it should return a display specific value for the color?

I have read that there was a change in the color functions. How can I correct set the color from the 3 RGB-Values (0..255)?

This topic has been closed for replies.
Best answer by awiernie

 device configuration tool code generation solved the problem.

2 replies

awiernie
awiernieAuthor
Associate III
October 27, 2021

I have found this on Known Issues | TouchGFX Documentation:

LCD16bpp::fillRect and LCD16bpp::drawGlyph#

The fillRect and drawGlyph functions in LCD16bpp now pass the full 24bit color to the DMA, instead of the reduced 16bit (RGB565) color. This may result in wrong colors on the hardware (not the simulator) and can be fixed by regenerating the DMA classes from CubeMX.

In my case, it happens however only in a custom widget where I set the color this way. On other places, where the color comes from touchgfx settings everything is OK.

I guess that the device configuration tool code generation will generate the classes. I will try this later.

awiernie
awiernieAuthorBest answer
Associate III
October 28, 2021

 device configuration tool code generation solved the problem.