Skip to main content
MKoca.1
Senior
December 10, 2020
Question

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.

  • December 10, 2020
  • 39 replies
  • 6027 views

..

This topic has been closed for replies.

39 replies

Flemming Gram CHRISTENSEN
ST Employee
December 17, 2020

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
MKoca.1Author
Senior
December 17, 2020

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

MKoca.1
MKoca.1Author
Senior
December 17, 2020

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

MKoca.1
MKoca.1Author
Senior
December 17, 2020

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.

Flemming Gram CHRISTENSEN
ST Employee
December 17, 2020

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
Principal III
December 17, 2020

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
MKoca.1Author
Senior
December 17, 2020

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

MKoca.1
MKoca.1Author
Senior
December 17, 2020

I should also mention that my code doesn't fall into the functions screenViewBase :: screenViewBase () and screenView :: screenView (). Can you explain how to access these functions with interrupt? @Flemming Gram CHRISTENSEN​  @Martin KJELDSEN​ 0693W000006G8N4QAK.jpg0693W000006G8MfQAK.jpg0693W000006G8MVQA0.jpg 

I could access these functions in my works with the STM32F429's LTDC screen. But as there is a problem with my FMC configurations, I cannot access these functions via interrupt.

Martin KJELDSEN
Principal III
December 18, 2020

If you're not getting touchgfx_signalVsync() called, then TouchGFX isn't running and nothing will happen on screen. Check out the F412 AT for inspiration on FMC config..

Flemming Gram CHRISTENSEN
ST Employee
December 18, 2020

You are right Martin. With a LTDC display you get a "refresh" signal from the LTDC controller. With a display on FMC you normally use an external signal from the display (an extra line going from the display to the MCU). This is asserted by the display when a refresh starts.

The standard procedure is to hook the external interrupt to this line, and then start TouchGFX drawing. I.e. calling touchgfx_signalvsync (in above pictures) from the interrupthandler.

Thanks.

MKoca.1
MKoca.1Author
Senior
January 4, 2021

Hello, Mr. @Martin KJELDSEN​  and Mr. @Flemming Gram CHRISTENSEN​ . Finally, I was able to get the TouchGFX images and touch to my FMC screen. And I was able to design an average interface. Now I want to use ChromART.

 https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-fmc

I'm trying to follow the method here, but I don't fully understand it.

prepare ();

xSemaphoreTake

xSemaphoreGive

I do not understand what these functions do. Also, I do not use FreeRTOS. Do I have to use FreeRTOS to use ChromART?

Flemming Gram CHRISTENSEN
ST Employee
January 4, 2021

Hello.

Nice to hear, that you are progressing.

Are you using ChromART to clock out data on your bus? Or maybe you are using just the CPU (one or two for-loops) or a normal DMA.

If you are using ChromART to clock out data, you need to wait for ChromART to finish drawing in the framebuffer. This is done e.g. by calling:

  dma.flush();

The code in the article you refer to is to wait for the DMA2D to Screen transfer to finish. You can also do that by busy waiting on the DMA2D. This depends on how you start the DMA2D.

The problem is that the interrupt handler is shared with the TouchGFX code.

So the simplest is to busy wait on DMA2D and disable interrupts meanwhile.

Regards

MKoca.1
MKoca.1Author
Senior
January 5, 2021

I enable ChromART in CubeMx while creating the project. ChromART interrupts are working properly. It appears to be enabled in the code snippet in the picture. But I can't tell if it's working or not. Do I have to do something extra? I cannot understand this as I cannot display the CPU working percentage on the screen.