cancel
Showing results for 
Search instead for 
Did you mean: 

Hello everyone. I want to use my 7inch LCD screen with TouchGFX using STM32F429 processor. My LCD screen has SSD1963 drive and has FT5426 touch. I can show normal images on my screen. But I didn't manage to integrate it with TouchGFX. Please help me.

MKoca.1
Senior
 
39 REPLIES 39
MKoca.1
Senior

Hello again, everyone. Dear @Flemming Gram CHRISTENSEN​  As in the example about FMC drivers, I have made my settings and adjusted the functions. I also arranged the flushFrameBuffer and copyFrameBufferBlockToLCD functions for myself. But in getClientFrameBuffer function return frameBuffer0 always returns 0 and my screen remains black. I don't understand where the event frameBuffer0 is populated by TouchGFX ????

Hello.

I am not sure I fully understand your question here.

Does getClientFrameBuffer return zero? Or a pointer to memory where you have zero?

The framebuffer is drawn to by the Widgets. So if you have created a Screen with the Designer, you can try to set a breakpoint in Screen1ViewBase::Screen1ViewBase() to see that it is actually created.

Even better is to insert a tick function in Screen1View. This should be called multiple times:

class Screen1View {

virtual void handleTickEvent() { }

};

If you don't hit this function many times, your event loop is not running.

If TouchGFX does not have the correct framebuffer pointer, it can of course not draw anything.

From the F412 template, the framebuffer is passed here:

void TouchGFXGeneratedHAL::initialize()

{

  HAL::initialize();

  registerEventListener(*(Application::getInstance()));

  setFrameBufferStartAddresses((void*)frameBuf, (void*)0, (void*)0);

You should have something similar in your project.

MKoca.1
Senior

@Flemming Gram CHRISTENSEN​ 

yes GetClientFrameBuffer always returns zero. Also, Screen1ViewBase :: Screen1ViewBase () does not have a cut. What could be the reason for this? I am sending my adjustments in the attachment.

0693W000006G4yaQAC.jpg0693W000006G4yVQAS.jpg0693W000006G4yGQAS.jpg0693W000006G4y1QAC.jpg 

In the copyFrameBufferBlockToLCD(const Rect rect) you should not loop to 480 if your display is 240x240.

This method is called when a block in the framebuffer is drawn (could be the whole screen).

I think you should also call LCD_SetDisplayWindow here with the rect coordinates.

void TouchGFXHAL::flushFrameBuffer(const Rect& rect)

{

  // Partial framebuffer might be supported for this platform only when Double

  // Buffering is enabled

  dma.flush();

  HAL::flushFrameBuffer(rect);

  /* Set Cursor */

  __ST7789H2_SetDisplayWindow(rect.x, rect.y, rect.width, rect.height);

  /* Prepare to write to LCD RAM */

  ST7789H2_WriteReg(ST7789H2_WRITE_RAM, (uint8_t*)NULL, 0);

  /* Read dummy data */

  LCD_IO_ReadData();

  this->copyFrameBufferBlockToLCD(rect);

}

void TouchGFXHAL::copyFrameBufferBlockToLCD(const Rect rect)

{

  __IO uint16_t* ptr;

  int16_t height;

  // Use default implementation (CPU copy!).

  // This can be accelerated using regular DMA hardware

  for (height = 0; height < rect.height ; height++)

  {

    ptr = getClientFrameBuffer() + rect.x + (height + rect.y) * 240;

    LCD_IO_WriteMultipleData((uint16_t*)ptr, rect.width);

  }

}

MKoca.1
Senior

@Flemming Gram CHRISTENSEN​  Ekranım 800x480 çözünürlükte 7inch bir ekran.

MKoca.1
Senior

@Flemming Gram CHRISTENSEN​  My screen is a 7inch screen with 800x480 resolution.

MKoca.1
Senior

Sorry, @Flemming Gram CHRISTENSEN​ photo it is 240x240. Because I tried it with other resolution values. Although I tried 240x240 resolution, ptr = getClientFrameBuffer () + rect.x + (height + rect.y) * 240; , Although I tried 800x480 resolution ptr = getClientFrameBuffer () + rect.x + (height + rect.y) * 480; I am making my adjustments.

How do you tick TouchGFX on screen refresh?

Do you have code like this:

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

{

 /* Prevent unused argument(s) compilation warning */

 if(GPIO_Pin == LCD_TE_Pin)

 {

  uint8_t PinStatus = (HAL_GPIO_ReadPin(LCD_TE_GPIO_Port, LCD_TE_Pin) == GPIO_PIN_SET ? 1 : 0);

  TouchGFX_TickHandler(PinStatus);

 }

}

TouchGFX is only drawing something when the screen is updating. So you need to propagate the signal. This is from the F412 template.

Martin KJELDSEN
Chief III

To emphasize what Flemming says, please check the STM32F412-Disco FMC Application Template from TouchGFX Designer for a concrete example. You may find some hints. Generally i would (which flemming also mentioned):

1) Verify Generator configuration (Custom LCD interface, Custom TouchGFX tick driver)

2) Verify your tick driver implementation (handleTickEvent() should be called continuously in your view) - get inspiration from f412 AT.

3) Verify that your driver can transfer something to display. Verify that you can do it from flushFrameBuffer(Rect& rect)

4) Inspect 0x60000000 to see if TouchGFX is rendering something. Is your memory configured correctly? CubeMX does not help you here with latency configuration, etc, since chip dependant - configure in a user code section.

/Martin

MKoca.1
Senior

@Flemming Gram CHRISTENSEN​  Yes, there is.0693W000006G7RyQAK.jpg0693W000006G7RUQA0.jpg0693W000006G7QqQAK.jpg0693W000006G7QWQA0.jpg