cancel
Showing results for 
Search instead for 
Did you mean: 

Assertion failed: No buffer allocated for CanvasWidgetRender

GMeur
Senior

Hi,

I'm getting this error message and have no clue how to resolve the problem?

(I'm getting it while trying to instantiate from the code a custom container).

Thanks in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @GMeur​,

The assert tells you that the Canvas Renderer has no buffer in which to work. If you check out the simulator/main.cpp files in our application templates you'll see that you can do something like the following which configures the size of a buffer, once, for the entire duration of the application - You could override this in a concrete view if you wanted.

#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
#define CANVAS_BUFFER_SIZE (3600)
 
static uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);

Best regards,

Martin

View solution in original post

2 REPLIES 2
Martin KJELDSEN
Chief III

Hi @GMeur​,

The assert tells you that the Canvas Renderer has no buffer in which to work. If you check out the simulator/main.cpp files in our application templates you'll see that you can do something like the following which configures the size of a buffer, once, for the entire duration of the application - You could override this in a concrete view if you wanted.

#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
#define CANVAS_BUFFER_SIZE (3600)
 
static uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);

Best regards,

Martin

This was very helpful.