Showing results for 
Search instead for 
Did you mean: 

textArea not rendered to framebuffer upon entering endFrame()



I'm working on a project where we are utilising the dynamic bitmaps and "TextAreaWithOneWildcard" widgets to achieve "dynamic" Page generation during runtime. We are using STM32U599 with DMA2D, and TouchGFX 4.22.

One of the problems we faced was also the screen orientation, for which we decided to try rotating the whole framebuffer 90 deegres clockwise, right after the touchGFX framework is done rendering all the elements, and prior to display controller updating the screen.

We selected a `void TouchGFXHAL::endFrame()` as a promising moment at which we can perform a rotation of the framebuffer (using single framebuffer currently, with possibility of adding a second). Rotation in the endFrame() will be performed only once, when a "flag" is set indicating that our "Page" has been updated and we set the elements for rendering using invalidate().

Here is where the problem occurs - when a new "Page" has arrived, we invalidate all the widgets (textAreaWithOneWildcard and Images) that should be rendered, then set the "flag" which is polled in endFrame() in order to perform rotation when touchGFX is done with rendering our updated "Page". After the rotation is performed once, our "flag" is reset.
However, the outcome is that one textArea (the last one that was "marked" with invalidate()) ends up not rotated (other elements rotate as expected), indicating that it was not present in the framebuffer at the time  rotation was performed. Looks like it was rendered to framebuffer too late compared to other elements, and after we already rotated the framebuffer once, so it stays at a "default" orientation. I expected that all the elements with which the invalidate() was invoked will surely be in the framebuffer, at the time the `endFrame()` occurs.

I found similar scenario under "known issues" in the Documentation, under v4.10.0 issues ( :( 


But the proposed solution didn't work for us, as `dma.isDMARunning()` is never "true" at this moment.

Some other observations:
- When I force an Image to be prepared for rendering last (after textAreas), all the textAreas are successfully rotated with rest of the elements - all okay.

- When I use only two textAreas on the Page, both are rotated as expected. Meaning, only when 3+ textAreas have been invalidated(), the one that comes last in the render order is not in the framebuffer at the time of rotation.

Does this issue with textAreas sound familiar? Any other thing we could be doing wrong?
We have a fallback option to take care that the images are always renderend last, but if there is a more ***-proof solution that would be great.

Thanks in advance