2019-04-16 03:39 AM
Hello
I'm using TouchGFX 4.10 with a custom board (STM32F767) and I have a problem, where old value/content will be displayed when updating another value on screen.
Procedure in which the problem occurs:
I don't know where the problem is, but I assume it has something to do with the doublebuffering. When I invalidate both values in every steps, it works correctly.
But this can/should not be the solution, because this happens not only with texts also with bitmaps and other widgets.
Has anyone an idea what is wrong?
Thanks
Best regards
Marco
Solved! Go to Solution.
2019-04-23 12:12 AM
Hi @Marco.R,
I've been on easter holida, apologies. Trying to catch up.
Generally, there's no copying from one framebuffer to the other. If you're running a double framebuffer configuration the DMA will be updating the "other" framebuffer while the LTDC is reading from the framebuffer that is "done" and being displayed.
Can you provide some screenshots? And tell me what you're expecting to see?
Also, there's no documentation on that yet, but i'm trying to get it written ("Understanding TouchGFX").
/Best regards,
Martin
2019-04-16 12:21 PM
Can you post code for the screen this is happening on? Is there any chance for anything weird to happen elsewhere that also invalidates these text areas or for the screen to be re-entered and rebuilt in between these events?
2019-04-16 10:04 PM
Hi @Community member
Below some code. I simplified it and I used integer values instead of texts but the result is the same. Each method will only called once when updating ValueA and ValueB.
Model.cpp:
void Model::updateValueA(const uint32_t newValue)
{
m_valueA = newValue;
if (modelListener != 0)
{
modelListener->updateValueA(m_valueA);
}
}
void Model::updateValueB(const uint32_t newValue)
{
m_valueB = newValue;
if (modelListener != 0)
{
modelListener->updateValueB(m_valueB);
}
}
DevelopmentPresenter.cpp
void DevelopmentPresenter::updateValueA(const uint32_t newValue)
{
view.updateValueA(newValue);
}
void DevelopmentPresenter::updateValueB(const uint32_t newValue)
{
view.updateValueB(newValue);
}
DevelopmentView.cpp
void DevelopmentView::updateValueA(const uint32_t newValue)
{
Unicode::snprintf(txt_aBuffer, TXT_A_SIZE, "%d", newValue);
txt_a.invalidate();
}
void DevelopmentView::updateValueB(const uint32_t newValue)
{
Unicode::snprintf(txt_bBuffer, TXT_B_SIZE, "%d", newValue);
txt_b.invalidate();
}
In my opinion it is not wrong code for the screen, because the error happens on different screens and also with generated code (e.g. buttons -> old state will displayed).
I think TouchGFX use an outdated screenbuffer when updating a new value. We are using a HAL/DMA implementation which is adapted from the TouchGFX examples. I investigating this implementation but I did not found a difference until now. I also tried NoDMA instead of the DMA Implementation -> same result.
Any other ideas? I'm grateful for every hint.
Best regards
Marco
2019-04-17 10:20 PM
A short update:
I investigated the DMA when updating screen from Step 1 to Step 2. The following steps will be done:
Between all this steps getBlitCaps (2x) and DMA Irq will be called. There is nothing about the TextA "123" or "ABC"
From Step 2 to Step 3 the following steps will be done:
In general, the steps looks as expected. But the content on screen is wrong. What I miss is the copy of the whole screen from Framebuffer 1 to Framebuffer 2 and vice versa. I don't know where this will be done. I assume this will be done within the TouchGFX Library.
@Martin KJELDSEN : Is my assumption correct? Is there a documentation, where I can see what happens in screen update? Thanks
2019-04-18 02:23 PM
@Marco.R , the only thing I can think of if you think it's frame buffer related is to double check that your touchgfx HAL is writing the address of the right framebuffer to the CFBAR register based on the address being given to setTFTFrameBuffer(uint16_t* adr). You could also try disabling double buffering and see what happens.
Other than that, I'm not familiar enough with how touchgfx works to have any good ideas about why this would be happening, I've never had this issue before.
2019-04-23 12:12 AM
Hi @Marco.R,
I've been on easter holida, apologies. Trying to catch up.
Generally, there's no copying from one framebuffer to the other. If you're running a double framebuffer configuration the DMA will be updating the "other" framebuffer while the LTDC is reading from the framebuffer that is "done" and being displayed.
Can you provide some screenshots? And tell me what you're expecting to see?
Also, there's no documentation on that yet, but i'm trying to get it written ("Understanding TouchGFX").
/Best regards,
Martin
2019-04-23 12:37 AM
@Community member : Thanks for your reply and hints. I already checked the touchgfx HAL (see my last post). It is writing to the right address -> setTFTFrameBuffer toggles between 0xC00BB800 and 0xC0000000 . I also tried to disable double buffering. It works as expected -> no old/wrong content appears on display. But single buffering is no option. The display is flickering (screen tearing) because the touchgfx task has not the highest priority.
2019-04-23 12:54 AM
Hi @Martin KJELDSEN
Thanks for your reply. I hope you had nice holidays. :smiling_face_with_smiling_eyes:
If I understand you correct, I have to update (invalidate) every text (or element) on screen even I only want to update one text. Is that correct? Is there a function, where I can invalidate the entire screen without invalidating every element one-by-one? I attached a pdf with some screens and my expectation. But after the reply from you, I think everything's working the way it should (and I have to update my code :smiling_face_with_smiling_eyes: )
Best regards
Marco
2019-04-23 01:04 AM
Hi Marco,
Yes, you're right that you need to invalidate manually to tell TouchGFX that something should be updated in the framebuffer. Some methods do this explicitly (e.g. moveTo() ) - Invalidating the entire screen would be very costly (potentially) performance wise because you're re-rendering all the elements even if they don't change.
If you have several elements that change at the same time i'd simply create a specific method to invalidate them - e.g. updateTexts() or something.
Best regards,
Martin
2019-04-23 01:06 AM
Can you share the project? Is this also an issue with the simulator?