cancel
Showing results for 
Search instead for 
Did you mean: 

Canvas buffer

Marcin1
Associate II

Hello,

I have such kind o problem with my application which contains of many screen. One of these screens is quite complicated (many modal windows, buttons, list, etc). When I call xQueueSend to forward messages between two tasks (one relates to uart and the other is GUI task) application hangs (every time). Hard fault error is called which is FORCED IMPRECISERR type. I increased TASK_STK_SIZE and respectively configTOTAL_HEAP_SIZE in FreeRTOSConfig.h but it didn't help. I noticed that when I remove canvas buffer from generated file for this screen, everything is ok, but unfortunately I cannot do it in TouchGFX Designer. That is why every time I generate new code I have to comment these lines. Do You have any solution to this problem and can You explain ma why such situation takes place?

4 REPLIES 4
Martin KJELDSEN
Chief III

Hi @Community member​,

So you're not actually using the Canvas buffer? Did you keep in mind that TASK_STK_SIZE is in words and TOTAL_HEAP_SIZE is in bytes?

Best regards,

Martin

Marcin1
Associate II

​Hi,

Now I use Canvas buffer defined for whole application in main.cpp file. Size of this buffer is (8 * 1024). Yes I know the relations between TASK_STK_SIZE and TOTAL_HEAP_SIZE. Currently I use:

#define configGUI_TASK_STK_SIZE ( 1500 )

#define configUART_TASK_STK_SIZE ( 512 )

and

#define configTOTAL_HEAP_SIZE                 ( ( size_t ) ( 50 * 1024 ) )  

which is quite huge.

If I won't find solution, one of my ideas is to simplify this screen (use less drawables). However I'd like to find the reason  of this fault to avoid problems in the future when we release our product.

Martin KJELDSEN
Chief III

Hi @Community member​,

Apologies. Just wanted to make sure we had the right settings - Classic mistake :) Can you try reducing the size of the buffer to a point where you no longer enter a hard fault? Just to see if we can make some sense of the numbers.

Marcin1
Associate II

​Hi,

I performed this test like You said. Firstly I commented Canvas buffer in main.cpp and I used buffer in automatically generated file for my problematic screen. Results are as follows:

  • for CANVAS_BUFFER_SIZE =760 and less - application fails with HardFaultError type of Usage Fault connected with attempt to execute undefined instruction (UNDEFINSTR).
  • for CANVAS_BUFFER_SIZE =775 to CANVAS_BUFFER_SIZE =4600 - everything is ok
  • for CANVAS_BUFFER_SIZE =4700 and more - I stuck in HardFault Error described in my first post.