cancel
Showing results for 
Search instead for 
Did you mean: 

Circle and Shape Widget not the correct color on the LCD

psilvaggio
Associate III

The circles and shape widgets in my application do not display the correct color on my LCD, they all show as (looks like) pure white. They appear fine when run in the simulator. Box widget colors are fine, as are images and buttons.

Any clues on why colors appear fine in the simulator but not on the application LCD?

Edit: note this is on TouchGFX version 4.18.0

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

Maybe try to use the XRGB painter. They use only 32-bit word writes while the ARGB8888 painters use byte writes.

/Romain

View solution in original post

11 REPLIES 11
Peter BENSCH
ST Employee

Welcome, @psilvaggio​, to the community!

You didn't mention which hardware you're testing on: your own or a DISCOVERY from ST?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Sorry about that. This is my own hardware. STM32F429IIT6 with external RAM and 24-bit LCD

OK, with your own hardware, of course, all components have to interact and be configured correctly. Since there are so many possibilities for a misconfiguration it will be difficult to discuss that here.

Have you already worked through the tutorials, e.g. the Hardware Selection and the Board Bring Up?

Maybe you find information in similar articles in the Knowledge Base, like e.g. this one?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I'll have to run through those then. I'm using a previous hardware design that had been successfully setup for using the ST emwin library, so while I can't rule out a hardware problem, it seems unlikely.

Ok so I've been through the suggested tutorials and articles and I'm still stuck with this issue. I just want to reiterate that all other widgets have their correct colors, it's only the canvas widgets (circles, lines, shapes) that don't draw the color they're supposed to on the target LCD. It also looks like those shapes have no anti-aliasing, so that may be related.

I can verify that the frame buffer is setup in the Viewbase

touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);

buffer is defined

static const uint16_t CANVAS_BUFFER_SIZE = 7200;
uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];

And the circle is defined:

    circle2.setPosition(-7, -8, 20, 20);
    circle2.setCenter(10, 10);
    circle2.setRadius(10);
    circle2.setLineWidth(0);
    circle2.setArc(0, 360);
    circle2Painter.setColor(touchgfx::Color::getColorFromRGB(125, 189, 65));
    circle2.setPainter(circle2Painter);

These were generated by TouchGFX Designer, I did not modify them.

As a note, when I go into debug and read the framebuffer, the color in memory matches what I see on the LCD (white pixels).

Hi,

I guess you already did it but could you try to update your firmware pack to the latest one in STM32CubeMX ?

I've been trying to replicate it on my side but unsuccessfully. Could you maybe share your UI or the exact settings ?

What is your color depth by the way ?

/Romain

I'm using version STM32CubeF4 Firmware Package V1.26.0 / 12-February-2021 and just updated to TouchGFX Generator V4.18.1 yesterday.

Color depth is 32bit, ARGB8888.

Settings from my CubeMX project:

DMA2D Settings0693W00000JNaOfQAL.pngLTDC Layer Settings

0693W00000JNaP4QAL.png 

LTDC Parameter settings:

0693W00000JNaQgQAL.pngTouchGFX Generator Settings:

0693W00000JNaRPQA1.png 

I made a little demo screen as I'm not sure I want to share my application UI. See screenshots below

Simulator.

0693W00000JNaRoQAL.png 

Target LCD (sorry for the poor quality). Only the "box" widget is red.

0693W00000JNaDyQAL.png 

Thanks again.

I think we've identified what the issue is but don't know how to solve it. It looks like the Canvas widgets are utilizing byte writing to the external RAM where our current setup does not support byte writing, only word writing.

I put a breakpoint for when 0xD0400020 and 0xD0400021 are written to. This location is in the frame buffer, and that pixel should be part of a Circle widget, color #1949E6. You can see in the first row the E6 byte is written to the first byte, then when the second byte is to be written, 49, the first byte is overwritten with FF. This is why we see white instead of the correct color.

 0693W00000JOTGbQAP.png 

We are using the STM32F429IIT micro, which unfortunately shares the FMC_NBL2 with LTDC_B4 (pin PI4). We are using a 32-bit external RAM and a 24bit TFT LCD. The FMC_NBL2 pin is one of the masking pins used to use byte writing. CubeMX even recognizes there is a conflict.

 0693W00000JOTGlQAP.png 

Is there something we can configure or change for the Canvas widgets to use word writing to the frame buffer? What are other options we can explore?

Hi,

Maybe try to use the XRGB painter. They use only 32-bit word writes while the ARGB8888 painters use byte writes.

/Romain