cancel
Showing results for 
Search instead for 
Did you mean: 

Howto trigger flushFrameBuffer(Rect&)

GEngi.2072
Associate II

Hi all,

we have a STM32F103 MCU with an Epson TFT controller with an internal framebuffer. This framebuffer is attached via FSMC bus and memory-mapped at 0x68000000. We already have an application that draws graphics successfully to our display (using Atollic TrueStudio 9). Now we are evaluating touchGFX as an abstraction layer to create the GUI. What we have achieved so far:

  • created a small demo app with touch designer (background + 1 Button); this runs in windows simulator
  • added the generated code to our Atollic project; compiles and runs
  • use application template from F4 Disco board
  • followed the instructions in MCUs without TFT controller, Running TouchGFX without an operating system and old support thread Porting TouchGFX to 8080-based LCDs
  • from the second link we use the OSWrappers class
  • we have defined an own HAL: class STM32F103HAL : public STM32F4HAL
  • our timer triggers OSWrappers::signalVSync() (verified with debugger)

Most important steps we are doing in pseudo-code:

init_our_hardware();
NoDMA dma;
LCD16bpp display;
NoTouchController tc
touchgfx_init() {
  HAL& hal = touchgfx_generic_init<STM32F103HAL>(dma, display, tc, 320, 240, 0, 0);
  hal.setFrameBufferStartAddress((uint16_t*)frameBuf0, 16, false, false);
  hal.lockDMAToFrontPorch(false);
  // if we uncomment the next two lines we can draw pixels on the TFT via the framebuffer pointer:
  // Rect r(0,0,320,240);
  // hal.flushFrameBuffer(r);
}
create_20hz_timer();
HAL::getInstance()->taskEntry();

Finally we have two issues that are not clear to us / that do not work:

  1. our flushFrameBuffer(Rect&) is never called by touchgfx main loop (can't be the bug mentioned in the third linked support thread, we use 4.10.0); when we uncomment the lines 10&11 in above code, our STM32F103HAL::flushFrameBuffer(Rect&) *is* called; And:
  2. we have declared the frame buffer start address to touchgfx (line 7), so in our flushFrameBuffer function we just call the base implementation ("STM32F4HAL::flushFrameBuffer(rect);"); but touchgfx doesn't generate any output, the display remains dark (as mentioned, via the frame buffer pointer we manually can draw pixels, so the hardware is set up);

When trying to address problem 1 we already fiddled with Model::tick() and HAL::tick() but without success.

Thanks in advance for any ideas!

10 REPLIES 10