Showing results for 
Search instead for 
Did you mean: 

touchgfx custom spi single and double buffer


I'm working with a Nucleo L476 board, I have a 128x160 SPI TFT display connected. I have no issues with the display and the bare metal code I wrote but wanted to learn touchgfx. No issue with the partial buffer implementation but I'm stuck at single and double buffer. The partial buffer code generated by cubeMX had several routines and comments that made it easy to figure out what I needed to do to interface to the AL. the single and double buffer seem more cryptic to me and my c++ knowledge is limited. I'm able to display images and cycle thru them but when I introduce a touch button the button graphics get corrupted when I release the button. I'm sure I'm doing something wrong in how I implemented the code in TouchGFXHAL.cpp - flushFrameBuffer. advanceFrameBufferToRect confuses me. I think I've seen everything on the touchgfx help site and they discuss this to some extent but I guess I'm missing something.

Does anyone have some example code of how they've implemented flushframebuffer in a scenario like this.

I use a tick tim2 int to activate touchgfxsignalvsync and all that seems to be working well.I use SPI DMA and that seems to be working as well.

in double buffer scenario is the second framebuffer only used if needed because the graphics demand it or is it always part of the flow.


Associate II

I’m just searching the way of how to implement single or double buffer for the SPI LCD.

Currently I have a working project with the custom partial buffer mode and SPI LCD, and some other also working project with the 16-bit RGB parallel LCD interface… 

Just found this thread and it is very nicely written and it’s just a bit sad that ST still hasn’t replied… 

Looking out for your response about how to implement the single or double buffer mode with an SPI LCD. 



I was able to get things working but it's been a while so I'll have to look back and see what I did.  Let me know if you'd like to see any of my code happy to share it if it might help.

not sure I ever saw double buffering work in my project even though I thought I was enabling it.

I've done more work with touchgfx since then and I'm glad to have learned how to get the spi lcd up and running but now I've been spoiled with HAL and the touchgfx tools and if I have something new to do I'll try hard to not use spi and to let the HAL and touch tools do as much of the work as possible.

these udemy courses helped me a lot