Skip to main content
arun_cheriyan
Associate
February 21, 2019
Question

Changing to a different display

  • February 21, 2019
  • 19 replies
  • 4456 views

Hi everyone,

I'm using the STM32F429 discovery board which comes with an LCD display. I tried out some example keil projects and also made some projects on TouchGFX software with hardware integration. All was working fine. I also have a different display(ST7282 display controller-does not require any initialization) of 480*272 resolution with me and wanted to interface that to the discovery board. But TouchGFX wont let me select a different resolution after selecting STM32F429. How do I add this new display? What all files I have to modify in the generated C project? I read the article on Changing to a different display. But it didn't help.

Can someone help me?

This topic has been closed for replies.

19 replies

Martin KJELDSEN
Principal III
February 22, 2019

Hi @arun_cheriyan​,

Are you using CubeMX to generate your project or the Application Templates from within the TouchGFX Designer?

Best regards,

Martin

arun_cheriyan
Associate
February 23, 2019

Hi Martin,

I used the TouchGFX designer to generate the required project. I selected the STM32F429I discovery board option and then blank UI in the designer. Since I was using the 480*272 display I did some tinkering to the generated projects BoardConfiguration.cpp file to make the new display work( It had the configuration for 240*320 display). But the result was not good:

0690X000006Do0VQAS.jpg

There should be two buttons displayed.

Here's what I did in the BoardConfiguration.cpp file:

1.adjusted the size related things

/* Configure horizontal synchronization width */

    LtdcHandler.Init.HorizontalSync = ((uint32_t)4);

    /* Configure vertical synchronization height */

    LtdcHandler.Init.VerticalSync = ((uint32_t)4);

    /* Configure accumulated horizontal back porch */

    LtdcHandler.Init.AccumulatedHBP = ((uint32_t)43);

    /* Configure accumulated vertical back porch */

    LtdcHandler.Init.AccumulatedVBP = ((uint32_t)12);

    /* Configure accumulated active width */

    LtdcHandler.Init.AccumulatedActiveW = 480;

    /* Configure accumulated active height */

    LtdcHandler.Init.AccumulatedActiveH = 272;

    /* Configure total width */

    LtdcHandler.Init.TotalWidth = 531;

    /* Configure total height */

    LtdcHandler.Init.TotalHeigh = 292;

2.commented the driver init function

/* LCD Init */

    //LcdDrv->Init();

3.adjusted these functions

uint32_t LCD_GetXSize(void)

  {

    //return LcdDrv->GetLcdPixelWidth();

return 480;

  }

  uint32_t LCD_GetYSize(void)

  {

    //return LcdDrv->GetLcdPixelHeight();

return 272;

  }

void touchgfx_init()

{

  HAL& hal = touchgfx_generic_init<STM32F4HAL>(dma, display, tc, 480, 272, 0, 0);

  os_inited = true;

.

.

.

.

}

4.Edited the .touchgfx file in the project to :

"Resolution": {

   "Width": 480,

   "Height": 272

  },

can you give any suggestions?

Vitaliy Chernobay
Senior
February 24, 2019

You can use F746 Discovery touch controller for example of programming fot touch

CFyfe
Visitor II
March 12, 2019

In the past when changing displays I have just changed the resolution in the json of the .touchgfx file for my project in order to be able to retain screens and just go back in and resize things. It's a little annoying cause you have to find/replace your resolution in multiple places but this worked for me in TouchGFX v4.10.0.

arun_cheriyan
Associate
March 19, 2019

@Community member​ 

Thats exactly what I did. I had to edit the BoardConfiguration.cpp file too. anyways now its working .

Ciuffoly
Senior
December 21, 2019

Could you explain me what you have changed to solve the lcd and touch problems ?

I would like to make the same operation.

Tell me the model of the display used.