cancel
Showing results for 
Search instead for 
Did you mean: 

Double buffering doesn't work for STM32H747I-DISCO board. What am I doing wrong?

HTD
Senior III

I enable double buffering in Cube, switching Framebuffer Strategy to Double Buffer. When I run my application I get the start screen but it hangs on initial screen. I'm sure I have enough memory for a second buffer, I used the block for Animation Storage and it worked (but it was very slow). To see if it can get any faster I enabled double buffering and it just died. Where's the catch? I use TouchGFX 4.19.1 and run my application on STM32H747I-DISCO board.

9 REPLIES 9
Osman SOYKURT
ST Employee

Hello HTD,

Can you share with us the configuration you have or your project ? (framebuffer start addresses, display interface, width, height etc ...)

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

Would suggest providing minimal code that demonstrates the issue.

Hard to guess at what you're doing wrong from the description.

Pretty sure the hardware works as designed and intended. So start at things like the memory used, the buses it has to traverse, if the DMA throws some error, etc.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Of course, here it goes:

  • software pack configuration:

0693W00000NrWMbQAN.png 

  • cortex M7 memory region protection:

0693W00000NrWNtQAN.png 

  • LTDC parameters:

0693W00000NrWOmQAN.png 

  • LTDC layer settings:

0693W00000NrWP1QAN.png 

  • DSIHOST display interface

0693W00000NrWPVQA3.png 

  • DSIHOST LTDC interfece

0693W00000NrWPpQAN.png

  • DSIHOST DSI clocks

0693W00000NrWQTQA3.png

  • DSIHOST timeout counters:

0693W00000NrWQYQA3.png

  • DSIHOST data and clock lanes

0693W00000NrWQxQAN.pngThe configuration presented is for single buffer, because when I switch to double buffer my application crashes.

My current code uses followin user code initialization:

    /* USER CODE BEGIN initialize step 2 */
 
    setAnimationStorage((void*)0xD0180000); // right after frame buffer, to enable slide transitions.
    HAL::getInstance()->setFrameRateCompensation(true); // to make slide transitions blazing fast.
 
    lockDMAToFrontPorch(false);
 
    mcuInstr.init();
    setMCUInstrumentation(&mcuInstr);
    enableMCULoadCalculation(true);
 
    /* USER CODE END initialize step 2 */

For double buffer I used address 0xD0300000 for the animation storage, 0xD0180000 was the second frame buffer address.

Please read the configuration I've just pasted in previous comment.

I include touchgfx/target/generated files.

To replicate the issue:

  • Create a new application in TouchGFX designer.
  • Create 2 screens with Hello World text, a button that proceeds from sceen1 to screen2 with slide transition.
  • Upload to STM32H747I-DISCO. Test - it works (no slide transition though, that requires changes mentioned in previous comment).
  • Go to Cube, TouchGFX settings, enable double buffering.
  • Upload to STM32H747I-DISCO. Test - it doesn't work. The previous content is displayed on the screen, software button (if visible) doesn't react to touching.

Since I'm critically busy, that's all for now, I'll create a github repo with examples right after I finish my current work, so it will be like next week. What I described should (probably) make the problem apparent. Exact board model, the hardware configuration, and how to trigger the crash. BTW, animations and slide effects are not important here - it crashes regardless of the animation storage set or not. I just first noticed the missing transition effects, I enabled the animation storage, it worked but looked bad because was too slow, then enabled double buffering and it died. I worked around the frame rate issue with enabling frame skipping option and went with single buffer to continue my work.

Osman SOYKURT
ST Employee

Hello HTD,

This TBS (TouchGFX Board Setup) is not prepared for double framebuffer actually. Unfortunately it's something that you won't be able to use, until we update this TBS. And I can't promise you something on it soon.

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

Thanks for info.

I've tested that it's not a matter of DCache issue on H7, but indeed it behaves differently with DCache disabled. With DCache enabled I got occasional garbage on the screen while downloading / connecting debugger, with DCache disabled the issue disappeared. From what I've read on H7 DCache enabled requires extra steps performed while using DMA and original HAL drivers (at least those provided with my board) don't do it, so the data corruption occurs.

Also, that would be nice if Animation Storage and Frame Rate Compensation options appeared in the TouchGFX Generator Cube options in the next version ;).

We ran into this same issue... It has been over 1 year since this post was posted. Is there any planned updates to help correct/fix this issue? Or any workarounds that can be done to resolve it?

We you ever able to get this resolved?

ST doesnt care about anything last few years. The fix of bug from CubeMx about number overflow took them two years to fix. So this is reported two years ago so fix will be within next three.