2019-10-06 02:26 PM
hi
when i add yellow line in custom container TouchGFX 4.10.0 Designer report error and when i remove the yellow line simulator run successfully
Solved! Go to Solution.
2019-10-07 12:04 AM
Hi @Natali,
If you notice the assert it says that no canvas buffer is allocated. For "shapes", a buffer is required in order to render them. For application templates this is defined in main.cpp (Both simulator and target main.cpp) but you can make this more general by configuring the buffer in e.g. setupScreen() for your view if you have different memory requirements per view.
#define CANVAS_BUFFER_SIZE 3600
...
static uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
You can use small buffers, but at the cost of performance, or large buffers at the cost of memory, naturally. You can call the following method on CanvasWidgetRenderer to have it output to the console the amount of memory it requires for best performance.
void setWriteMemoryUsageReport(bool)
And enable output in the simulator by calling:
touchgfx_enable_stdio();
/Martin
2019-10-07 12:04 AM
Hi @Natali,
If you notice the assert it says that no canvas buffer is allocated. For "shapes", a buffer is required in order to render them. For application templates this is defined in main.cpp (Both simulator and target main.cpp) but you can make this more general by configuring the buffer in e.g. setupScreen() for your view if you have different memory requirements per view.
#define CANVAS_BUFFER_SIZE 3600
...
static uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
You can use small buffers, but at the cost of performance, or large buffers at the cost of memory, naturally. You can call the following method on CanvasWidgetRenderer to have it output to the console the amount of memory it requires for best performance.
void setWriteMemoryUsageReport(bool)
And enable output in the simulator by calling:
touchgfx_enable_stdio();
/Martin
2019-10-07 04:00 AM
That being said - Do not read the memory usage report as the "required" amount of memory. The wording is actually a bit vague in this respect and could be improved.
You can still make do with less memory, but at the cost of performance. However, the performance you're experiencing may be perfectly acceptable to you, so there may not be any point to paying additional memory.
/Martin