cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746BGT6 LCD TFT 7'' flickering

Tran Minh Cong
Associate II
Posted on April 02, 2018 at 08:50

Dear every body,

I are using

LCD TFT 7 inch 800x480 

/external-link.jspa?url=https%3A%2F%2Fwww.buydisplay.com%2Fdefault%2F7-tft-lcd-touch-screen-display-module-800x480-for-mp4-gps-tablet-pc

  in our design with STM32F746BTG6 processor working at  200 MHz frequency.

We are using STemWin Library on RTOS operating system

/external-link.jspa?url=https%3A%2F%2Fwww.freertos.org%2F

  with LTDC support.

GUIBuilder.exe software will generate gui data.

I are statically storing the required ARGB format in external SDRAM.

The data is loaded from SDRAM to LTDC (STM32F7 LCD Controller)

using DMA2D and FMC interface

(Flexible Memory Controller – Working at 200/2 MHz).

Timing LCD TFT 7 inch from datasheet:

/external-link.jspa?url=http%3A%2F%2Fwww.buydisplay.com%2Fdownload%2Fic%2FOTA7001A.pdf

 0690X0000060AMkQAM.png

 About frequency in system:

- SDRAM: 100MHz, use same bus data 16bit with other device. Examples:nor flash.

/* Timing configuration for 100Mhz as SD clock frequency (System clock is up to 200Mhz) */

Timing.LoadToActiveDelay = 2;

Timing.ExitSelfRefreshDelay = 7;

Timing.SelfRefreshTime = 4;

Timing.RowCycleDelay = 7;

Timing.WriteRecoveryTime = 2;

Timing.RPDelay = 2;

Timing.RCDDelay = 2;

sdramHandle.Init.SDBank = FMC_SDRAM_BANK1;

sdramHandle.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9;

sdramHandle.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13;

sdramHandle.Init.MemoryDataWidth = SDRAM_MEMORY_WIDTH;

sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;

sdramHandle.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;

sdramHandle.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;

sdramHandle.Init.SDClockPeriod = SDCLOCK_PERIOD;

sdramHandle.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;

sdramHandle.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;

- LTDC: 19.2 MHz.

PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;

PeriphClkInitStruct.PLLSAI.PLLSAIN = 192;

PeriphClkInitStruct.PLLSAI.PLLSAIR = 5;

PeriphClkInitStruct.PLLSAIDivR = 2;

HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);

While I'm getting data in norflash, LCD have prolems is flickering.

I know that LTDC will gennerate data to LCD automatically after SDRAM refresh, isn't it?

What is solution to hold data on LTDC while other device use bus data of SDRAM (16 bit data)?

Can you tell me solutions to fix that bug, please?

Thank you so much!

null
22 REPLIES 22
Tran Minh Cong
Associate II
Posted on April 02, 2018 at 08:51

Dear everybody,

Beside, I want ask about FPU.

How to enable to use FPU in STM32F746BGT6?

How is configure FPU accuracy and MCU can run faster?

Imen.D
ST Employee

Posted on April 02, 2018 at 11:58

Hellocong.tran_minh ,

To check if the problem here seems related to the hardware environment, you can exclude the two layers and display ONLY a bluebackgroundwith Layers disabled, the idea for that test is to exclude any wrong LTDC layer settings.

 Also, It’s recommended to disable the FMC bank1 if not used, and configure correctly the MPU for the SDRAM as well…

Please have a look to the AN4861 and follow the recommendation in the section ' 

4.6 Special recommendations for Cortex®-M7 (STM32F7 Series)', exactly about 'Disable FMC bank1 if not used' and 'Configure the memory protection unit (MPU)'. Thismay help you on to prevent graphical performance issues related to the Cortex-M7 speculative read accesses and cache maintenance.

You can enable FIFO underrun interrupt for determining the display size compatibility, this will help you to detect display issue (In the https://www.st.com/content/ccc/resource/technical/document/application_note/group0/25/ca/f9/b4/ae/fc/4e/1e/DM00287603/files/DM00287603.pdf/jcr:content/translations/en.DM00287603.pdf)

see Section 4.2.2 Checking display compatibility considering the memory bandwidth requirements).

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
T J
Lead
Posted on April 02, 2018 at 14:43

You should check that your power supply is not drooping,

that would give you 50/60Hz flicker.

Posted on April 03, 2018 at 04:01

Dear

DAHMEN.IMEN

,

Marsh.Nick

I'll checkinfomations.

Thank you.

Posted on April 03, 2018 at 12:03

Dear

DAHMEN.IMEN

,

Memory of SDRAM which i'm using is: 32Mbytes.

https://www.micron.com/parts/dram/sdram/mt48lc16m16a2p-6a

#define REFRESH_COUNT ((uint32_t)0x0603)/* SDRAM refresh counter (100Mhz SD clock) */

My code config MPU:

static void MPU_Config(void)

{

MPU_Region_InitTypeDef MPU_InitStruct;

/* Disable the MPU */

HAL_MPU_Disable();

MPU_InitStruct.Enable = MPU_REGION_ENABLE;

MPU_InitStruct.BaseAddress = 0x60000000;

MPU_InitStruct.Size = MPU_REGION_SIZE_256KB;

//-> What is caculate that memory region? LCD TFT: 800x480xbit per pixel?

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/bc/2d/f7/bd/fb/3f/48/47/DM00272912/files/DM002729pdf/jcr:content/translations/en.DM002729pdf

3 Example for setting up the MPU with cube HAL

MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;

MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

MPU_InitStruct.Number = MPU_REGION_NUMBER1;

MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

MPU_InitStruct.SubRegionDisable = 0x00;

MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;

HAL_MPU_ConfigRegion(&MPU_InitStruct);

/* Enable the MPU */

HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

}

uint8_t BSP_SDRAM_Init(void)

{

static uint8_t sdramstatus = SDRAM_ERROR;

/* SDRAM device configuration */

sdramHandle.Instance = FMC_SDRAM_DEVICE;

/* Timing configuration for 100Mhz as SD clock frequency (System clock is up to 200Mhz) */

Timing.LoadToActiveDelay = 2;

Timing.ExitSelfRefreshDelay = 7;

Timing.SelfRefreshTime = 4;

Timing.RowCycleDelay = 7;

Timing.WriteRecoveryTime = 2;

Timing.RPDelay = 2;

Timing.RCDDelay = 2;

sdramHandle.Init.SDBank = FMC_SDRAM_BANK1;

sdramHandle.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9;

sdramHandle.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13;

sdramHandle.Init.MemoryDataWidth = SDRAM_MEMORY_WIDTH;

sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;

sdramHandle.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;

sdramHandle.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;

sdramHandle.Init.SDClockPeriod = SDCLOCK_PERIOD;

sdramHandle.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;

sdramHandle.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;

/* SDRAM controller initialization */

BSP_SDRAM_MspInit(&sdramHandle, NULL); /* __weak function can be rewritten by the application */

if(HAL_SDRAM_Init(&sdramHandle, &Timing) != HAL_OK)

{

sdramstatus = SDRAM_ERROR;

}

else

{

sdramstatus = SDRAM_OK;

}

/* SDRAM initialization sequence */

BSP_SDRAM_Initialization_sequence(REFRESH_COUNT);

return sdramstatus;

}

Can you check that code help me, please? Is it correctly?

Thank you!

Posted on April 04, 2018 at 04:43

Dear you,

I check 

power supply in board: 5V, 3v3....

It is good.

https://www.buydisplay.com/default/7-tft-lcd-touch-screen-display-module-800x480-for-mp4-gps-tablet-pc

 

Page 8/19:

0690X0000060APoQAM.png

I measure VLED is: 19.2V < VLED min = 21V.

However, LCD TFT haven't any 

flicker if I don't use bus data SDRAM by other device.

When LCD TFT have flicker (other device use bus data SDRAM), VLED = 19.2V is not drooping.

So, i think ''

power supply'' is not cause.

Posted on April 04, 2018 at 10:01

I use offchip LCD drivers for this very reason, but there are a few things you can check

I think any onboard Flash access should be cacheable, its much faster that way.

can you use a low priority DMA for the flash read ?

and high priority DMA for the LCD. ??

Did you configure the SDRam for Burst mode ? is there an option for that ?

increase the front porch and back porch as much as you can, see if that helps.

Posted on April 04, 2018 at 10:09

How to enable to use FPU in STM32F746BGT6?

Which toolchain you are using ?

Some IDEs automatically add the appropriate code if you select 'use FPU' during project creation.

How is configure FPU accuracy ...

Single precision (float), not configurable.

... and MCU can run faster?

Proper core clock and Flash settings, and enabling caches.

Posted on April 04, 2018 at 10:24

Thanks

meyer.frank

.

Toolol chain: MDK-ARM standard version 5.

I enabled FPU:

0690X0000060AQ8QAM.png