cancel
Showing results for 
Search instead for 
Did you mean: 

Drawing a TGFX box widget in big screen (800x480) causing crash

zzzzz
Senior

I try to add a very simple screen to my project. It always crashed when I try to add a box as background. It ends up with the infinite loop in startup assembly file.

Here is what I found so far:

  1. I can draw a smaller box(50x50).
  2. if I decrease speed of LTDC clock to a certain value, I can draw any size of box I want. But the screen gets flickering for the lower refresh rate.

I am using f7 and has set clock and SDRAM to maximum speed. Does anyone has similar issue? Is there any settings to improve this issue? Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @zzzzz​,

Is this a custom board? Have you checked your LTDC and DMA registers for errors?

A few things to try just to see if there are any improvements:

  1.  hal.lockDMAToFrontPorch(true); //in boardconfiguration.cpp - Means DMA2D and TFT controller cannot access RAM at the same time, preventing memory contention issues (can cause flickering).
  2. Use NoDMA class (Boxes are drawn with DMA as well).

Let me know

/Martin

View solution in original post

8 REPLIES 8
Martin KJELDSEN
Chief III

Hi @zzzzz​,

Is this a custom board? Have you checked your LTDC and DMA registers for errors?

A few things to try just to see if there are any improvements:

  1.  hal.lockDMAToFrontPorch(true); //in boardconfiguration.cpp - Means DMA2D and TFT controller cannot access RAM at the same time, preventing memory contention issues (can cause flickering).
  2. Use NoDMA class (Boxes are drawn with DMA as well).

Let me know

/Martin

zzzzz
Senior

Thanks for your reply!

Yes, it is a custom board and it works well with STemWin before.

No error flag is set in LTDC or DMA2D registers.

I have tried hal.lockDMAToFrontPorch(true). It is not solve the issue.

Could you explain how to use NoDMA class? Does that mean I need modify STM32F7DMA.cpp?

Thanks.

Martin KJELDSEN
Chief III

Hi @zzzzz​,

You simply declare a different DMA class than the one you're using. Let me exemplify:

//BoardConfiguration.cpp
#include <touchgfx/hal/NoDMA.hpp> 
 
//STM32F7DMA dma;
NoDMA dma;
STM32F7TouchController tc;
STM32F7Instrumentation mcuInstr;

TDahl
Associate II

@Martin KJELDSEN​ 

Sorry for using this thread.

I have a similar issue using the STM32F469I-DISCO and I have been looking into your suggestions

and the NoDMA solves my issue. The question now is what it means. What am I going

the chase to resolve the problem to reenable the DMA?

I’m using STM32CubeIDE 1.01.

Best regards

Thomas

Martin KJELDSEN
Chief III

Hi @TDahl​,

The F469I-DISCO should not have this issue. Locking the DMA to the front porch is a trick you can use if you've got issues with LTDC and DMA accessing the memory at the same time. In this case you can either slow down the application somewhat (lowering pixel clock, increasing porch areas within spec, locking DMA to front porch).

CubeIDE/CubeMX will not necessarily create the best configuration for TouchGFX. Try creating an application from our TouchGFX designer using the 469-DISCO applicaiton template and compare the configurations, maybe. It for sure works.

/Martin

TDahl
Associate II

Thanks @Martin KJELDSEN​ 

I will try that.

Thomas

TDahl
Associate II

For reference I seem to have solved the problem by halving the LCD-TFT clock because of double buffering. Thanks again @Martin KJELDSEN​ 

/Thomas

Martin KJELDSEN
Chief III

Awesome, Thomas!