cancel
Showing results for 
Search instead for 
Did you mean: 

CanvasWidgetRenderer setupbuffer strange behavior

JHarding
Senior

Thanks to the forums, I have been making great progress, so much in fact that I have been making regular commits to a private repository to help track my changes. So once again thank you.

My git commits helped track down this strange behavior happening in a generated file. This has happened twice, the first time I didn't have version control in place so I was unable to see what broke the project, but this time I was able to capture it.

Here are the list of tools I am using:

  • STM32CubeIDE 1.2.1
  • TouchGFX Designer 4.13.0
  • STM32F746BG

I have a screen called Tests. So TouchGFX Designer generates a couple files:

  • TestsViewBase.cpp
  • TestsViewBase.hpp

In these files my initial commit shows these lines in the hpp file:

/*
* Canvas Buffer Size
*/
static const uint16_t CANVAS_BUFFER_SIZE = 4080;
uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];

and this corresponding line in the cpp file:

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

Just this morning I regenerated the code from within TouchGFX Desginer and these lines of code were removed from the generated files. This ultimately broke the screen. It would not transition or show the screen.

I then followed these steps:

  1. I manually inserted the code back, and the screen started working again.
  2. I Regenerated the project, and TouchGFX Designer removed the lines again. This broke the screen once again.
  3. I closed TouchGFX Designer, reopened, CHECKED the "Override default buffer size" check box, and then UNCHECKED the "Override default buffer size" checkbox and regenerated the code. Now TouchGFX added the lines of code back by itself.

To me, this is unexpected behavior and I do not really know what is causing it. Maybe someone else can shine some light on this issue?

3 REPLIES 3
JHarding
Senior

Any insight on this @Martin KJELDSEN​?

Martin KJELDSEN
Chief III

Are you modifying a "read-only" generated file? (1 and 2). That's expected for the -Base.cpp/hpp files to be re-generated. If you want to add something, do it in the inherited classes (inside the gui/ folder).

I'll investigate to see if there's an actual issue with overriding the size of the canvas buffer

/Martin

Yes I am modifying the read only file, but only to prove that these lines being removed are what is breaking the particular screen.

TouchGFX Designer sometimes puts these lines of code into the read only file, and sometimes it doesn't. When it doesn't, that particular screen doesn't work, hence me having to manually modify a file I shouldn't need to.